06-08-2020
02:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-08-2020
02:47 AM
Hi @Ralf_Krieg
Something like this maybe? ![]()
Sub Main 'Get a nativeobject for an edge, I dont know where you're getting the edge object from. Dim oEdge As Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Pick edge.").NativeObject Dim oPart As PartDocument = oEdge.Parent.ComponentDefinition.Document Dim oAsm As AssemblyDocument = ThisDoc.Document Dim oSelSet As SelectSet = oAsm.SelectSet Dim oEdgeCol As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection For Each oOcc As ComponentOccurrence In oAsm.ComponentDefinition.Occurrences.AllReferencedOccurrences(oPart) Dim oEdgeProx As EdgeProxy = CreateEdgeProxy(oOcc.OccurrencePath, oEdge) oEdgeCol.Add(oEdgeProx) Next oSelSet.SelectMultiple(oEdgeCol) End Sub Function CreateEdgeProxy(oOccList As ComponentOccurrencesEnumerator, oEdge As Edge) As Object Dim oProx As Object For i = oOccList.Count To 1 Step -1 If i = oOccList.Count Call oOccList(i).CreateGeometryProxy(oEdge, oProx) Else Call oOccList(i).CreateGeometryProxy(oProx, oProx) End If Next Return oProx End Function
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website