Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select Constraints

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
al.popovich
239 Views, 2 Replies

Select Constraints

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

2 REPLIES 2
Message 2 of 3

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 - Leading design engineer

LinkedIn | My free Inventor Addin | My Repositories

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

EESignature

Message 3 of 3

Very much appreciated!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report