Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
johnPGNFG
735 Views, 4 Replies

Finding direction of a kCircleCurve

What I thought would be a straight-forward task has me banging my head against the desk.  

I'm looking to extract curve data off a part and recreate it in another program.  To start, I'm working with a flat piece of plate with no holes or inner edge loops.  I find the top face and then look at each edge and get the data I need for each one.  For straight edges all I need are the end points.  For an arc, I need the end points, center of arc, and the direction (Clockwise or Counterclockwise).  

 

I'm using     foreach(Edge edge in topface.edges)      to cycle through each edge

 

 

The problem is sometimes inventor checks the edges going clockwise around the part and other times it will go counterclockwise.  This is a problem when it comes around to an arc (circle curve) edge 

 

I tried the following but I'm not sure what "params" I'm supposed to be using here.  I searched through the API help but couldn't find any info:

 

Circle circle = arcEdge.Curve[CurveTypeEnum.kCircleCurve];

circle.Evaluator.GetCurvature(ref Double[] Params, ref Double[] Directions, ref Double[] Curvatures);

 

Should "GetCurvature" fill in the "Directions" and "Curvatures" arrays if I input the Params?  What is "Params" in this case supposed to be?  I've tried filling it in with points along the curve in hopes it would spit out the direction but no luck.  Maybe this isn't the approach I'm supposed to take but it would still be nice to know how to use "GetCurvature".  Any suggestions on how to find direction would be appreciated.