Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dears,
I have some sub-assemblies need to change the new one position in representations. I'm working with this Code. Please help me to correct it. Thanks you very much!
Dim oComponent As Object
Dim oComponents As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
While True
oComponent = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Components")
If IsNothing(oComponent) Then Exit While
oComponents.Add(oComponent)
End While
For Each oComponent In oComponents
Dim sActivePosRep as String = oComponent.ComponentDefinition.RepresentationsManager.ActivePositionalRepresentation.Name
Dim MyArrayList As New ArrayList
For Each oPosRep In oComponent.ComponentDefinition.RepresentationsManager.PositionalRepresentations
MyArrayList.Add(oPosRep.Name)
Next
iArrayList = MyArrayList.Count
sPosRep = InputListBox("Select from the List:", MyArrayList, sActivePosRep, "iLogic", "Positional")
oComponent.ComponentDefinition.RepresentationsManager.PositionalRepresentations.Item(sPosRep).Activate
Next
Solved! Go to Solution.