Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dim oOccurrence As ComponentOccurrence Dim Prop As String Try oOccurrence = ThisDoc.Document.SelectSet.Item(1) Catch MessageBox.Show("Please select a part / subAssembly!", "Get Index of Part / SubAssembly", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) Return End Try 'active assembly s Dim oMainAsm As AssemblyDocument = ThisDoc.Document Dim oAsmDef As AssemblyComponentDefinition = oMainAsm.ComponentDefinition index = oOccurrence."INDEX OF THE SELECTED PART / SUBASSEMBLY" ??? ' get the occurrence by its position in the occurrences collection Dim oOcc As ComponentOccurrence = oAsmDef.Occurrences.Item(index)
Is it possible to get the index from oOccurrence as shown in the Code above?
Solved! Go to Solution.