SyntaxError docKey

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ness3333
Posts: 9
Joined: Thu Dec 12, 2019 6:07 pm

SyntaxError docKey

Post by ness3333 »

Hello im trying to run the Macro Half-Hull Model with Freecad .18 and i get this error

Code: Select all

<unknown exception traceback><class 'SyntaxError'>: ('invalid syntax', ('C:/Users/m/AppData/Roaming/FreeCAD/Macro/Half-Hull_Model.FCMacro', 1131, 13, '\tprint docKey\n'))
I try with the .17 version and i get "cant import Draft"
With the .16 work but the in the last step with the sketch ready fail to build the model i use the example models
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: SyntaxError docKey

Post by mlampert »

Looks like this macro is not compatible with Python 3. You should contact the owner and see if they can update it.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: SyntaxError docKey

Post by vocx »

ness3333 wrote: Sun Jan 26, 2020 5:06 pm Hello im trying to run the Macro Half-Hull Model with Freecad .18 and i get this error

Code: Select all

'\tprint docKey\n'
This is invalid syntax in Python 3. This means that the code of the macro may only work with Python 2.

Code: Select all

#Python 2
print docKey

#Python 3
print(docKey)
You should contact the author of the macro and ask him to update it, or do the necessary changes yourself. You may also try installing a FreeCAD version that uses Python 2. However, as Python 2 is obsolete, the best recommendation is to update the macro itself to work with Python 3.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
ness3333
Posts: 9
Joined: Thu Dec 12, 2019 6:07 pm

Re: SyntaxError docKey

Post by ness3333 »

th guys
Post Reply