Skip to content

ShapeString broken in recent 1.1dev #99

@edwilliams16

Description

@edwilliams16

Try to make a shapestring

Traceback (most recent call last):
  File "/Users/ed/Library/Application Support/FreeCAD/Mod/lattice2/./lattice2ShapeString.py", line 324, in Activated
    CreateLatticeShapeString(name = "Strings")
  File "/Users/ed/Library/Application Support/FreeCAD/Mod/lattice2/./lattice2ShapeString.py", line 299, in CreateLatticeShapeString
    FreeCADGui.doCommand("f = lattice2ShapeString.makeLatticeShapeString(name='"+name+"')")
  File "<string>", line 1, in <module>
  File "/Users/ed/Library/Application Support/FreeCAD/Mod/lattice2/./lattice2ShapeString.py", line 79, in makeLatticeShapeString
    LatticeShapeString(obj)
  File "/Users/ed/Library/Application Support/FreeCAD/Mod/lattice2/./lattice2ShapeString.py", line 109, in __init__
    self.makeFoolObj(obj)
  File "/Users/ed/Library/Application Support/FreeCAD/Mod/lattice2/./lattice2ShapeString.py", line 158, in makeFoolObj
    self.draft_shape_string = _ShapeString(foolObj) 
                              ^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftobjects/shapestring.py", line 48, in __init__
    self.set_properties(obj)
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftobjects/shapestring.py", line 56, in set_properties
    obj.addProperty("App::PropertyString", "String", "Draft", _tip, locked=True)

FoolFeatureDocumentObject.addProperty() got an unexpected keyword argument 'locked'

See https://forum.freecad.org/viewtopic.php?t=97076

Possible fix:

ed@MacBookM1 lattice2 % diff lattice2ShapeString.py lattice2ShapeString\ copy.py
93c93
<     def addProperty(self, proptype, propname, group = None, hint = None, locked = False):
---
>     def addProperty(self, proptype, propname, group = None, hint = None):
95c95
<         self.properties.append((proptype, propname, group, hint, locked))
---
>         self.properties.append((proptype, propname, group, hint))
113c113
<         for (proptype, propname, group, hint, locked) in foolObj.properties:
---
>         for (proptype, propname, group, hint) in foolObj.properties:
182c182
<         for (proptype, propname, group, hint, locked ) in self.foolObj.properties:
---
>         for (proptype, propname, group, hint) in self.foolObj.properties:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions