08-29-2024
09:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-29-2024
09:36 AM
Hi @drafter_sby2. All you can do is try. If it does not work, then there is your answer. The process is still pretty much the same. Only since the 2022 version, we are working with ModelStates, instead of LevelOfDetailRepresentations, which are what records suppression status. ModelStates sort of made it slightly simpler, since the default ModelState is not 'locked' (which some folks want to make happen), but the introduction of ModelStates also greatly complicated a lot of things that we do by code.
Sub Main
Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
If oADoc Is Nothing Then Return
For Each oOcc As ComponentOccurrence In oADoc.ComponentDefinition.Occurrences
If oOcc.Suppressed Then
ConstraintAndJointSuppression(oOcc, True)
Else
ConstraintAndJointSuppression(oOcc, False)
End If
Next
oADoc.Update2(True)
End Sub
Sub ConstraintAndJointSuppression(oOcc As ComponentOccurrence, bSuppress As Boolean)
For Each oConst As AssemblyConstraint In oOcc.Constraints
Try : oConst.Suppressed = bSuppress : Catch : End Try
Next
For Each oJoint As AssemblyJoint In oOcc.Joints
Try : oJoint.Suppressed = bSuppress : Catch : End Try
Next
End Sub
Wesley Crihfield
(Not an Autodesk Employee)