|
[code]void test2()
{
// get the points
AcGePoint3d p1, p2, p3;
if(RTNORM != acedGetPoint(NULL, L"First point: ", asDblArray(p1))
|| RTNORM != acedGetPoint(NULL, L"Second point: ", asDblArray(p2))
|| RTNORM != acedGetPoint(NULL, L"Third point: ", asDblArray(p3)))
{
acutPrintf(L"\nFunction canceled\n" );
return;
}
// create an AcGeCirc
AcGeCircArc3d geArc(p1, p2, p3);
AcDbArc *pArc = NULL;
// now convert the AcGeCirc to an AcDbArc
AcDbCurve::createFromAcGeCurve(geArc, (AcDbCurve*&) pArc);
// now cast to a smart pointer so we don't have to worry about
// closing or freeing
AcDbObjectPointer<AcDbArc> arc;
arc.acquire(pArc);
// get the current database
AcDbDatabase *db = curDoc()->database();
AcDbBlockTableRecordPointer curSpace(db->currentSpaceId(), AcDb::kForWrite);
if(curSpace.openStatus() == Acad::eOk)
curSpace->appendAcDbEntity(arc.object());
}[/code] |
|