How to convert an AcGeCircArc3d to an AcDbArc and vice versa?

By Gopinath Taget

The following ARX code does this:

void convertArc2Arc( AcGeCircArc3d*pGeArc, AcDbArc*&pDbArc )

{

AcGePoint3d center = pGeArc->center();

AcGeVector3d normal = pGeArc->normal();

AcGeVector3d refVec = pGeArc->refVec();

AcGePlane plane = AcGePlane(center, normal);

 double ang = refVec.angleOnPlane(plane);

pDbArc = new AcDbArc(center, normal,

  pGeArc->radius(),pGeArc->startAng() + ang,

  pGeArc->endAng() + ang );

}

 

void convertArc2Arc( AcDbArc*pDbArc, AcGeCircArc3d*&pGeArc)

{

pGeArc = new AcGeCircArc3d(

pDbArc->center(),

pDbArc->normal(),

pDbArc->normal().perpVector(),

pDbArc->radius(),

pDbArc->startAngle(),

pDbArc->endAngle());

}


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading