Get the center point of circular edge

Get the center point of circular edge

fakeru
Advocate Advocate
840 Views
2 Replies
Message 1 of 3

Get the center point of circular edge

fakeru
Advocate
Advocate

So I want to create a mate constraint between a workplane and a center point of circular edge.

The edge is being picked by the user, but how can I get the center point of this edge for the constraint creation?

Like in the code below, it will not work. The oWorkPlaneProxy is defined somewhere above, so that's not a problem.

 

oEdge2 = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeCircularFilter, "Select first circular edge of second connection")
Dim Point1 As Inventor.Point = oEdge2.Geometry.Center

Dim oMate As MateConstraint
oMate = oAsmCompDef.Constraints.AddMateConstraint(oWorkPlaneProxy, Point1, 0)

 

Regards

Alexandru

Autodesk Inventor 2015 Certified Professional
0 Likes
Accepted solutions (1)
841 Views
2 Replies
Replies (2)
Message 2 of 3

JaneFan
Autodesk
Autodesk
Accepted solution

Hello Alexandru,

 

 

The geometry point can't be used as the argument Entity in function AddMateConstraint().

If you need the center point of a circular edge as the input, please create a workpoint at the center point first, then use the work point at the input, like this:

oAsmCompDef.Constraints.AddMateConstraint(oWorkPointProxy, oWP, 0, kInferredPoint, kNoInference)

 

Or there is a simpler way:
When a circular edge is chosen as an entity input, specifying the Inferred Type to kInferredPoint can do the same thing:

oAsmCompDef.Constraints.AddMateConstraint(oWP, oEdge2, 0, kNoInference, kInferredPoint)




Jane Fan
Inventor/Fusion QA Engineer
Message 3 of 3

fakeru
Advocate
Advocate

I was thinking about creating a workpoint, but that was a last solution because I just don't want my assembly to have workpoints which the users will not understand their use.

But the your second option is just what I needed! It's was so simple. Thanks!

Autodesk Inventor 2015 Certified Professional
0 Likes