Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In the main assembly, there are some sub-assemblies with a design view rep. I would like to change the design view using iLogic. The below code will find my part, but instead of changing the design view, it errors. The "tan" view does exist in the sub assembly, so I'm not sure why it would error.
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oCompDef As Inventor.ComponentDefinition = oDoc.ComponentDefinition Dim oCompOcc As Inventor.ComponentOccurrence For Each oCompOcc In oCompDef.Occurrences If oCompOcc.Name = "std drwr:1" Then Try oCompOcc.RepresentationsManager.DesignViewRepresentations.Item("tan").Activate Catch MessageBox.Show("This viewrep does not exist", "Error") End Try End If Next
It would also be nice to change the view without having to cycle trough every part in the main assembly. I haven't found a way to get a part by name and perform functions on that part unless it was in the limited list on the Component Functions Reference page.
Solved! Go to Solution.