Hello,
I am attempting to rename a browser node. Here is the code I'm using and I'm getting a "Property 'Label' is 'ReadOnly'" error. In the API I found a note about using SetLabel() but that seems to only have ones for ClientMade browser nodes.
oSubAssyNode.BrowserNodeDefinition.Label = "XXX"
Any thoughts?
Thanks
Solved! Go to Solution.
Solved by nagwani. Go to Solution.
Hi,
You cannot definitly change the fixed nodes like Origin, X,Y,Z plane and Axes, but you can change the names of features,work geometry and sketches which were created by you.
Below is sample code taken from help, the sample code iterates the browser node tree changes changes the Label of Extrusion and Sketch through the Name property of native object.
Hope this helps!
-Ishwar N
Private Sub QueryModelTree() Dim Doc As Document If (ThisApplication.Documents.Count <> 0) Then Set Doc = ThisApplication.ActiveDocument Else MsgBox "There are no open documents!" Exit Sub End If Dim oTopNode As BrowserNode Set oTopNode = Doc.BrowserPanes("Model").TopNode Call recurse(oTopNode) End Sub Sub recurse(node As BrowserNode) If (node.Visible = True) Then Debug.Print node.BrowserNodeDefinition.Label If node.BrowserNodeDefinition.Label = "Sketch1" Then node.NativeObject.Name = "MySketch" End If If node.BrowserNodeDefinition.Label = "Extrusion1" Then node.NativeObject.Name = "MyExtrusion" End If Dim bn As BrowserNode For Each bn In node.BrowserNodes Call recurse(bn) Next End If End Sub