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

I just realized you don't have to send the proxy up through each occurrence of the occurrencepath.

This will do.

'Get a nativeobject for an edge.
Dim oEdge As Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Pick edge.").NativeObject
'Get the part document the edge belongs to.
Dim oPart As PartDocument = oEdge.Parent.ComponentDefinition.Document
'Get the top level assembly
Dim oAsm As AssemblyDocument = ThisDoc.Document
'Get the Assemblys select set.
Dim oSelSet As SelectSet = oAsm.SelectSet
'Create an ObjectCollection to add all edge proxies to.
Dim oEdgeCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection

'Loop through all occurrences of the part.
For Each oOcc As ComponentOccurrence In oAsm.ComponentDefinition.Occurrences.AllReferencedOccurrences(oPart)
	'Create a proxy for the edge
	Dim oEdgeProx As EdgeProxy
	oOcc.CreateGeometryProxy(oEdge, oEdgeProx)
	'Add proxy to the object collection
	oEdgeCol.Add(oEdgeProx)
Next
'Select everything in the object collection
oSelSet.SelectMultiple(oEdgeCol)