I'm newbie in FreeCad forum, i've an error practising with Path Scripting following the wiki code, exactly in the section "The path shape feature", when run the following code in FreeCAD (both versions 0.17 and daily 0.18):
Code: Select all
import Part
v1 = FreeCAD.Vector(0,0,0)
v2 = FreeCAD.Vector(0,2,0)
v3 = FreeCAD.Vector(2,2,0)
v4 = FreeCAD.Vector(3,3,0)
wire = Part.makePolygon([v1,v2,v3,v4])
o = FreeCAD.ActiveDocument.addObject("Path::FeatureShape","myPath2")
>>> o.Shape = wire
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'App.DocumentObject' object has no attribute 'Shape'
Code: Select all
#option #1 with Path
>>> o.Path=Path.fromShape(wire)
#option #2 with Part
>>> po = FreeCAD.ActiveDocument.addObject("Part::Feature","myPartPath")
>>> po.Shape=wire
Thanks, great pleasure to share in FreeCAD hugs, @tximikel