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

Rename Browser nodes from an Assembly and all Parts to default

Hello all,

 

how to reset assembly browser node to default

recursively.

 

Thanks, regards

Massimo

Anonymous
in reply to: Anonymous

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