1 Answers
A:
Here is your content converted into **HTML format** with clean structure and preserved VBA code: ```html
Setting Model State via API (for non-iAssembly documents)
Here’s how to set the active Model State for a part or assembly document:
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oModelStates As ModelStates
Set oModelStates = oDoc.ComponentDefinition.ModelStates
' Activate a specific model state by name
Dim targetState As String
targetState = "CustomState1"
If oModelStates.Item(targetState).Name <> oDoc.ComponentDefinition.ActiveModelState.Name Then
oModelStates.Item(targetState).Activate
End If
Autodesk Inventor
AutodeskHelp the community
Be the First to Answer these questions
Disclaimer
Techjockey’s software industry experts offer advice for educational and informational purposes only. A category or product query or issue posted, created, or compiled by Techjockey is not meant to replace your independent judgment.
20,000+ Software Listed
Best
Price Guaranteed
Free Expert
Consultation
2M+
Happy Customers