Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Rename Browser nodes from an Assembly and all Parts to default

Anonymous

Rename Browser nodes from an Assembly and all Parts to default

Anonymous
Not applicable

Hello all,

 

how to reset assembly browser node to default

recursively.

 

Thanks, regards

Massimo

0 Likes
Reply
309 Views
1 Reply
Reply (1)

Anonymous
Not applicable

Here's one approach...

 

	Dim oAsmDef as AssemblyComponentDefinition
	oAsmDef = oAsmDoc.ComponentDefinition
	
	Dim oLeafOccs as ComponentOccurrencesEnumerator
	oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences
	
	Dim oPane As BrowserPane
	oPane = oAsmDoc.BrowserPanes.Item("Model")
	' Iterates thru the occurrences and resets the name
	Dim oOcc as ComponentOccurrence
	For Each oOcc in oLeafOccs
		Dim oNode As BrowserNode
		oNode = oPane.GetBrowserNodeFromObject(oOcc)
		' reset name
		oNode.NativeObject.Name = ""
	Next
0 Likes