Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inkscape unsaved file issue #15

Open
jfowlie opened this issue Nov 14, 2019 · 2 comments
Open

Inkscape unsaved file issue #15

jfowlie opened this issue Nov 14, 2019 · 2 comments

Comments

@jfowlie
Copy link

jfowlie commented Nov 14, 2019

I wonder if it is possible to add a test to see if the file has been saved in Inkscape before attempting to generate the paths to OpenSCAD. I just spent an hour trying to walk the code (and I don't know Python), only to realize that I had not saved the file I had created in Inkscape before trying to export to OpenSCAD.

I kept getting these errors:
Traceback (most recent call last):
File "paths2openscad.py", line 1430, in
e.affect()
File "/usr/share/inkscape/extensions/inkex.py", line 283, in affect
self.effect()
File "paths2openscad.py", line 1213, in effect
self.handleViewBox()
File "paths2openscad.py", line 594, in handleViewBox
if self.getDocProps():
File "paths2openscad.py", line 580, in getDocProps
self.inkscape_version = re.sub(" *(unknown) *", "", inkscape_version)
File "/usr/lib/python2.7/re.py", line 155, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or buffer

Thanks for your work on this! I hope to make a lot more use of it.
--James

@vmario89
Copy link

hey. indeed happened to me too fequently. The dirty quick fix is to change

self.inkscape_version = re.sub(" *(unknown) *", "", inkscape_version)

to

self.inkscape_version = "0.92.4"

then it works. regards, Mario

@vmario89
Copy link

okay might be more complex, because this is belonging to #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants