Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
shrey9GP3F
1321 Views, 13 Replies

Suppress all contraints on suppressing the component

Hi Community,

 

I apologize if this question has been asked before. I am trying to suppress all the constraints when the component is suppressed, and do the same for unsuppress. I created a code but it is not working.

 

Thank you.

Dim aDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oCon As AssemblyConstraint
Dim oJon As AssemblyJoint
Dim oOcc As ComponentOccurrence
Dim i As Integer

For i = 1 To aDoc.SelectSet.Count 
	oOcc = aDoc.SelectSet.Item(i)
	If oOcc.Suppressed = True Then
		For Each oCon In oOcc.Constraints
			oCon.Suppressed = True
		Next
		For Each oJon In oOcc.Joints
			oJon.Suppressed = True
		Next
	ElseIf oOcc.Suppressed = False Then
		For Each oCon In oOcc.Constraints
			oCon.Suppressed = False
		Next
		For Each oJon In oOcc.Joints
			oJon.Suppressed = False
		Next
	End If
Next