I'm trying to create objects from the point and line FreeCAD's objects.
I want to change the label and add some properties.
I've started by scripting them has Yorik has done in the Draft workbench modules.
It was going fine but then I realised that that have already been done by Yorik , no need to repeat... I think.
Changing and adding properties to an object is not hard if one can have hold on the object. So in a script...
This works (case 1)...
Code: Select all
import FreeCAD
from Draft import makePoint
obj=None
doc=FreeCAD.ActiveDocument
point=makePoint(1,1,0)
obj=doc.ActiveObject
print "obj.Label= ", obj.Label
Code: Select all
import FreeCAD
from pivy import coin
from DraftTools import Point
obj=None
doc=FreeCAD.ActiveDocument
Point.Activated(Point())
obj=doc.ActiveObject
print "obj.Label= ", obj.Label
My question is:
Is there a way to wait for an operation to be executed (point and line creation) or to know if the operation has been executed and then get the object? ... scan the document be scanned for changes? ... or, is there another way?
Thank you