Message 1 of 14
Suppress all contraints on suppressing the component
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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