At this time the dialog is already working: if you wish to try it, just copy the files of the folder in your macros path and then type
Code: Select all
import dialog4
Now, I'd like to move the section so that its CenterOfMass lies in the origin but somehow this code doesn't work in the execute() method:
Code: Select all
p = Part.makePolygon([p1,p2,p3,p4,p5,p6,p1])
s = Part.Face(p)
v=s.CenterOfMass.negative()
s.translate(v) # to move the c.o.m. in (0,0,0). Why does it not work?
obj.Shape = s
The strange thing is that if I type each line in python console to a) create the polygon and b) create the face and c) translate the face and finally d) Part.show(s), it DOES work!
Is there a difference in the .execute() method from the Part.show() command that makes the .translate() operation uneffective?
Suggestions are welcome. Thanks in advance.