Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm working with drawing views that reference assemblies with multiple model states.
I'm working on an iLogic rule that sets different model states on drawing views based on user input. My current code attempts to set a model state like this:
ModStateName = "4-5-1548-05" ActiveSheet.View("VIEW15").NativeEntity.SetActiveModelState(ModStateName & "'")
ActiveSheet.View("VIEW10").NativeEntity.SetActiveModelState(ModStateName)
How can I check if a model state name exists before trying to set it? I want to avoid errors when the model state doesn't exist in the part/assembly.
Something like
If ModelStateExists(ModStateName & "'") Then
ActiveSheet.View("VIEW15").View.Suppressed = False ActiveSheet.View("VIEW15").NativeEntity.SetActiveModelState(ModStateName & "'") Else ActiveSheet.View("VIEW15").View.Suppressed = True
End If
Inventor 2026
Has anyone dealt with this before? Any help would be appreciated!
Thanks!
Solved! Go to Solution.