Sunday, December 10, 2017

iLogic Delete All Sick Assembly Constraints

iLogic Delete All Sick Assembly Constraints


Issue:
You sometimes end up with a large number of broken (sick) assembly constraints, due to a particular workflow (such as swapping out a base component). You know why this is happening and dont mind fixing the assembly, but you wish there was a way to delete all of the sick assembly constraints at once, so you can re-constrain the assembly without having to be bothered by the alerts.



Solution:
Here is a quick iLogic snippet to help with this:

* A special thanks to Brendan Henderson for letting me know about a coding error I had when I first posted this. Check out Brendans own blog at: http://www.blh.com.au/#/blog/4572268941             






Dim oAssDoc As AssemblyDocument
oAssDoc = ThisApplication.ActiveDocument
Dim oConstraint As AssemblyConstraint

RUSure = MessageBox.Show _
("Are you sure you want to Delete all sick constraints?",  _
"iLogic",MessageBoxButtons.YesNo)

If RUSure = vbNo Then
Return
Else
          i = 0