05-20-2024
12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-20-2024
12:43 PM
Thank you for the quick reply.
My apologies; I did not proofread my code before I copied it to the forum.
I need to specify the occurrence name and then change its Model State.
Here is the code that is not working.
Dim oDoc As AssemblyDocument
oDoc = g_inventorApplication.ActiveDocument
Dim oAssemblyCompDef As AssemblyComponentDefinition
oAssemblyCompDef = oDoc.ComponentDefinition
' Specify an occurrence to change its active model state.
Dim oOccu As ComponentOccurrence
oOccu = oAssemblyCompDef.Occurrences.Item("Linear Bar")
' Get native document ComponentDefinition of occurrence.
Dim oOccuDef As ComponentDefinition
oOccuDef = oOccu.Definition
oOccu.ActiveModelState = "CA400"