create several constraints thusly:
Code: Select all
lock_x = DocSke.addConstraint(Sketcher.Constraint('DistanceX',Vert_ID,Pos_ID, sel_vec.x))
lock_y = DocSke.addConstraint(Sketcher.Constraint('DistanceY',Vert_ID,Pos_ID, sel_vec.y))
...and a bunch more...
Code: Select all
DocSke.delConstraint(lock_x)
DocSke.delConstraint(lock_y)
Only constraint lock_x goes away, it appears lock_y does not because the list has changed.
Reverse order and both go.
Code: Select all
DocSke.delConstraint(lock_y)
DocSke.delConstraint(lock_x)
Noted while watching in debugger:
The constraint list doesn't seem to be orderly, i.e. constraints don't appear to be stored in the order created.
What is the correct way to delete specific constraints programmatically? (I.e. if other operations have reordered the list then the return ID (like lock_x/lock_y above) aren't reliable. for use later in removing constraints.