05-25-2016
10:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-25-2016
10:03 PM
I do not know how your workflow is, i normally search for identic edges like this:
Sub Select_Same_Edges()
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = oApp.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = oAsmDoc.ComponentDefinition
Dim oSelectedEdge As EdgeProxy
Set oSelectedEdge = ThisApplication.CommandManager.Pick(kPartEdgeCircularFilter, "Celect circular edge")
'Occurrence ermitteln
Dim oSelectedOcc As Inventor.ComponentOccurrence
Set oSelectedOcc = oSelectedEdge.Parent.Parent
'Loop through all occs of the assembly, if want all oOccs (inc. child-occs) you have to write a recursive function
Dim oOcc As ComponentOccurrence
For Each oOcc In oAsmCompDef.Occurrences
Dim oEdge As Edge
If TypeOf oOcc.Definition.Document Is PartDocument Then
For Each oEdge In oOcc.Definition.SurfaceBodies.Item(1).Edges
If oEdge Is oSelectedEdge.NativeObject Then
Dim oEdgeProxy As EdgeProxy
Call oOcc.CreateGeometryProxy(oEdge, oEdgeProxy)
Call oAsmDoc.SelectSet.Select(oEdgeProxy)
End If
Next
End If
Next
End Sub