02-29-2024
03:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
02-29-2024
03:37 AM
Hi!
I recommend to not use LevelOfDetailRepresentations anymore, since the level of details are removed from Inventor, we only have Model States and View Representations
you can use following code to activate a view representation or add one:
Try oDoc.ComponentDefinition.RepresentationsManager.DesignViewRepresentations.Item("Default").Activate Catch oDoc.ComponentDefinition.RepresentationsManager.DesignViewRepresentations.Add("Default") End Try
and following to activate a model state or add one
Try oDoc.ComponentDefinition.ModelStates.ActiveModelState = "Default" Catch oDoc.ComponentDefinition.ModelStates.Add("Default") End Try
just replacing "LevelOfDetailRepresentation" with "DesignViewRepresentations" should also be enough to fix your code
Happy coding!