- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have part of my rule that I select documents from within the assembly.
The rule is fine (i.e., the selected document gets highlighted at the time of selecting). But the color is different from default blue.
Could someone help to fix this issue! Thanks.
Public Class RWEI_0023A Sub main() Dim iL_NO As String = "0025A" Dim iL_Name As String = "Highlighted Multiple Selections" Dim iL_FFN As String = "Rule " & iL_NO & ": " & iL_Name Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oLFN_Pos As Long Dim oFFN As String 'Full file name (with extension) Dim oLFN As String 'Local file name (with extension) Dim oSelectionOptions As New ArrayList Dim oComp As String = "Component" Dim oPart As String = "Part" Dim oCancell As String = "Cancel" oSelectionOptions.Add(oComp) oSelectionOptions.Add(oPart) oSelectionOptions.Add(oCancell) Dim oSelectedSet As Inventor.HighlightSet oSelectedSet = oDoc.CreateHighlightSet oSelectedSet.Clear Dim oEntities As ObjectCollection oEntities = ThisApplication.TransientObjects.CreateObjectCollection Dim oOccurrence As ComponentOccurrence oSelection = InputListBox("SELECT", oSelectionOptions, oSelectionOptions(0), Title := iL_NO & ": COMPONENT SELECTION", ListName := iL_NO & ": Selection List") If oSelection = oCancell Then Exit Sub While True If oSelection = oComp Then oEntity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, iL_NO & ": Select Component:") Else If oSelection = oPart Then oEntity = ThisApplication.CommandManager.Pick(kAssemblyLeafOccurrenceFilter, iL_NO & ": Select Part:") End If If IsNothing(oEntity) Then Exit While oSelectedSet.AddItem(oEntity) oEntities.Add(oEntity) End While oSelectedSet.Clear i = 1 For Each oEntity In oEntities ' oDoc_Entity = oEntity.Definition.Document ' oFFN = oDoc_Entity.FullFileName ' oLFN_Return = oName_Doc_Local(oFFN, oLFN_Pos, oLFN) ' MessageBox.Show("Name - Occurrence: " & oEntity.Name _ ' & vbLf & "Name - LFN: " & oLFN_Return _ ' & vbLf & "Name - FFN: " & oDoc_Entity.FullFileName, iL_FFN) '' i += 1 Next End Sub Function oName_Doc_Local(oFFN As String, oLFN_Pos As Double, oLFN As String) oLFN_Pos = InStrRev(oFFN, "\", -1) oLFN = Mid(oFFN, oLFN_Pos + 1, Len(oFFN) - oLFN_Pos) Return oLFN End Function End Class
Solved! Go to Solution.
Link copied