Automate Get Edge.TangentiallyConnectedEdges

Automate Get Edge.TangentiallyConnectedEdges

florian_wenzel
Advocate Advocate
276 Views
1 Reply
Message 1 of 2

Automate Get Edge.TangentiallyConnectedEdges

florian_wenzel
Advocate
Advocate

Hi,

Inventor 2022

API VB.NET Visual Studio

 

I try to Get a One Side of Edges from a Face.

florian_wenzel_0-1670318882658.png

As You can See, this side in this case has 2 Edges.

florian_wenzel_1-1670318922824.png

Part_A

So i want to Get One of them and Automaticly get the Other one, very simple

But in This Face the Edge Has no  TangentiallyConnected to the Second One!

 

But If i make a Body with Thicknes Feature  From this Face, Then This Edge has TangentiallyConnected Edges.

If you Pick up Edge from a Body, work Better, But not Perfect.

Part_B

florian_wenzel_3-1670319718397.png

 

 

 

My Question is, Know Someone a Solution to Get All Edges From One Side.

florian_wenzel_2-1670319425800.png

For Example, that means, that if a Vector From 1Edge has Angle to 2Edge something abot 90°, than Break

 

Or Maybe is Something with a Tolerance for the TangentiallyConnected Edges.

Or with kAllConcave or kAllConvex

 

This is my Code:

But Not Work Propely:

 

 

 

 

        Dim oPartDoc As PartDocument = g_inventorApplication.ActiveDocument
        Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
        Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
        Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
        Dim oBRep As TransientBRep = g_inventorApplication.TransientBRep


        Dim oEdgeOrigin As Edge = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Pick a Edge")

        Dim oEdgeColl As EdgeCollection = oEdgeOrigin.TangentiallyConnectedEdges

        MsgBox("oEdgeColl Count " & oEdgeColl.Count)

        Dim oSketch As Sketch3D = oCompDef.Sketches3D.Add

        For i = 1 To oEdgeColl.Count
            Dim oEdge As Edge = oEdgeColl.Item(i)
            Dim oEntity As SketchEntity3D = oSketch.Include(oEdge)
        Next

 

 

 

 

 

 

The Thing is , i want to Automate this Proces, and it not Work for all Faces.

This is only a Sample, to show a Face, that has not TangentiallyConnected Edges, and it happens from Time to Time.

 

Thanks for Any Suggestion

 

0 Likes
Accepted solutions (1)
277 Views
1 Reply
Reply (1)
Message 2 of 2

HermJan.Otterman
Advisor
Advisor
Accepted solution

All the edges have start and end points take your edge, get the start and endpoint and compair these to the start and endpoints of the other edges. if points are the same, then you know that those two edges connect.

to see if the lines are more or less colliniear create vectors between the start and end points of the edges. you could the calculate the angles between them to get if the connected line is 90deg / perpendicular or not.

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan