Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: drafter_sby2

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

EESignature

(Not an Autodesk Employee)