autocad2008利用objectarx二次开发,从画出的圆中得到它的圆心坐标和半径,怎样编程实现

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/28 03:25:43
autocad2008利用objectarx二次开发,从画出的圆中得到它的圆心坐标和半径,怎样编程实现
xS]OA+C/fi !k &dv綎-ݩ&A'!QM n|/8BawgΜ{w"mHϥmuzcp% ݳiWoy;;Wg{]]W['x ׺::TowKuaEvt3}w?ΘQ34rnEäwfeAWq!?ax0u u3֋hH3?A Ry)w)*g3#+xJTC#D]h)s\OH.0ys:-j%薖M0ۮ2Pe֒=%>"qJѶu (ԜQ( <+k8 (PcE`V<4 - eN/ʀ*Z Ћ.se7K?2S!gjJsVZ?An`InGu$CMݺ:@6"ЧB

autocad2008利用objectarx二次开发,从画出的圆中得到它的圆心坐标和半径,怎样编程实现
autocad2008利用objectarx二次开发,从画出的圆中得到它的圆心坐标和半径,怎样编程实现

autocad2008利用objectarx二次开发,从画出的圆中得到它的圆心坐标和半径,怎样编程实现
void GetCircleInfo()
{
ads_name ent;
ads_point p1;
while(acedEntSel(_T("\n选择圆:"),ent,p1)==RTNORM){
AcDbObjectId id;
if(Acad::eOk != acdbGetObjectId(id,ent)) continue;
AcDbEntity* pEnt;
if (Acad::eOk != acdbOpenAcDbEntity( pEnt,id,AcDb::kForRead,Adesk::kFalse )) continue;
if(pEnt->isKindOf(AcDbCircle::desc())){
AcDbCircle *pCircle = (AcDbCircle *)pEnt;
double radius = pCircle->radius();
AcGePoint3d pCen = pCircle->center();
CString msg;
msg.Format(_T("圆心:(%.f,%.f),半径:%.f"),pCen.x,pCen.y,radius);
AfxMessageBox(msg);
}
else
{
AfxMessageBox(_T("不是圆弧!"));
}
pEnt->close();
}
return;
}