Select Constraints

Select Constraints

al.popovich
Contributor Contributor
433 Views
2 Replies
Message 1 of 3

Select Constraints

al.popovich
Contributor
Contributor

Good morning, Friends,

 

Is there a way to select all suppressed constraints, similar to select all suppressed components?

 

I have an automation project which suppresses and un-suppresses a lot of constraints as needed.

At the end of the project generation, I'd like to delete all the suppressed constraints.

 

Ideally, I'd like to go back into each component, from the top level assembly, to perform this.

 

Thank You, Al

0 Likes
Accepted solutions (1)
434 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @al.popovich . This rule looks for a suppressed constraint and removes it:

Sub main
	Dim oDoc As Document = ThisDoc.Document
	If Not TypeOf oDoc Is AssemblyDocument Then Exit Sub
	Dim oAsmDoc As AssemblyDocument = oDoc
	Dim oCnsts As AssemblyConstraints = oAsmDoc.ComponentDefinition.Constraints
	If oCnsts.Count = 0 Then Exit Sub
	For Each oCnst As AssemblyConstraint In oCnsts
		If oCnst.Suppressed Then oCnst.Delete()
	Next
End Sub

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 3

al.popovich
Contributor
Contributor

Very much appreciated!

0 Likes