you can try this iLogic rule. Its not bug free. The first time you run it works fine afther that it started hiding parts each time you run it. (at some point it shows all part again :-S ) i could not find a solution for that. anyway copy past this in 1 ilogic rule and see what happens.
Sub Main()
Dim oCommandMgr As CommandManager = ThisApplication.CommandManager
oControlDef = oCommandMgr.ControlDefinitions.Item("DrawingBodyHiddenLinesCtxCmd")
Dim doc As DrawingDocument = ThisApplication.ActiveDocument
Dim partNameToColor As String = "strip"
Dim topNode As BrowserNode = doc.BrowserPanes.Item("DlHierarchy").TopNode
selectPart(topNode, partNameToColor)
End Sub
Public curentView As DrawingView
Public oControlDef As ControlDefinition
Public Sub selectPart(topNode As BrowserNode, name As String)
For Each node As BrowserNode In topNode.BrowserNodes
Try
node.Expanded = True
Catch ex As Exception
End Try
If (TypeOf node.NativeObject Is Sheet) Then
selectPart(node, name)
ElseIf (TypeOf node.NativeObject Is DrawingView) Then
curentView = node.NativeObject
selectPart(node, name)
ElseIf (TypeOf node.NativeObject Is AssemblyComponentDefinition) Then
selectPart(node, name)
ElseIf (TypeOf node.NativeObject Is ComponentOccurrence) Then
If (node.BrowserNodeDefinition.Label.Contains(name)) Then
node.DoSelect()
oControlDef.Execute()
colorPart(node.NativeObject, curentView)
End If
End If
Next
End Sub
Public Sub colorPart(foundOccurence As ComponentOccurrence, view As DrawingView)
Dim drawingCurves As DrawingCurvesEnumerator = view.DrawingCurves(foundOccurence)
For Each dc As DrawingCurve In drawingCurves
dc.LineWeight = 3
dc.Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
Next
End Sub
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com