mlampert wrote: ↑Wed Oct 11, 2017 5:54 pm
wmayer wrote: ↑Wed Oct 11, 2017 12:32 pm
When performing the deletion in a Python script you can clear the expression first (as a work around):
That's what I added to the upcoming change for Path in the onDelete callbacks. Thanks for confirming the validity of the work around.
Created
issue #3214, hope I got the title and description right.
Hello,
I am using this workaround on one of my scripts. Basically, I do this:
Code: Select all
for expression in obj.ExpressionEngine:
obj.setExpression(expression[0], None)
for i in obj.OutList:
for expression in i.ExpressionEngine:
i.setExpression(expression[0], None)
To clean up any expression associated with the object.
And only then,
Code: Select all
FreeCAD.ActiveDocument.getObject(obj.Name).removeObjectsFromDocument()
FreeCAD.ActiveDocument.removeObject(obj.Name)
Despite this, apparently, on FreeCAD.ActiveDocument.recompute() , it does not update the references correctly. The error, "Invalid DAG!", does not trigger.
May be due to some backlinks not resetting even when manually setting the expression to none? Is this a separate bug?