Message 1 of 13
Changing the "Default" occurrence Name on Browser
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I was able to change the name of occurrences on the browser but once i pressed default on the UI ( rename browser nodes) the deafult alwasy comes back to the old occurrences Number ( :9..:10)
How can i change the name and keep it as default?
I tried iterating thorough Occurrences..
SyntaxEditor Code Snippet
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition i=0 Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences 'MessageBox.Show( oOccurrence.Definition.Document.DisplayName, "") If Left( oOccurrence.Definition.Document.DisplayName,10 ) = "Nut Safety" Then i=i+1 'MessageBox.Show( oOccurrence.Definition.Document.DisplayName, "")'MessageBox.Show( oOccurrence.Name & vbCr & CStr(i), "") oOccurrence.Name = "Nut Safety:"+ CStr(i) End If Next
Also by getting browser Node Object again under Occurrences..
SyntaxEditor Code Snippet
Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oPane As BrowserPane oPane = oDoc.BrowserPanes.Item("Model") Dim oOcc As ComponentOccurrence i = 0 For Each oOcc In oDoc.ComponentDefinition.Occurrences Dim oNode As BrowserNode oNode = oPane.GetBrowserNodeFromObject(oOcc) If Left(oNode.NativeObject.Name,9 ) = "LAG Screw" Then i = i + 1 MessageBox.Show( oNode.NativeObject.Name, "") 'oNode.NativeObject.Name = "" oNode.NativeObject.Name = "LAG Screw" + ":" + CStr(i) End If Next
But none actually set the names to default...