- 积分
- 784
- 明经币
- 个
- 注册时间
- 2003-11-23
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-12-26 15:38:00
|
显示全部楼层
void GetPoints(void)
{
double dpt[3];
long entname[2];
if(acedEntSel("\nSpecify a Line:",entname,dpt)!=RTNORM)
return;
AcDbObjectId EntID;
acdbGetObjectId(EntID,entname);
AcDbObject *pObj=NULL;
if(acdbOpenObject(pObj,EntID,AcDb::kForRead)!=Acad::eOk)
return;
if(pObj->isKindOf(AcDbLine::desc())!=TRUE)
{
pObj->close();
return;
}
pObj->close();
AcDbLine *pLine=NULL;
if(acdbOpenObject(pLine,EntID,AcDb::kForRead)!=Acad::eOk)
return;
AcGePoint3d agStart,agEnd;
agStart=pLine->startPoint();
agEnd=pLine->endPoint();
pLine->close();
acutPrintf("\nStart Point (%.3f,%.3f)",agStart.x,agStart.y);
acutPrintf("\nEnd Point (%.3f,%.3f)",agEnd.x,agEnd.y);
} |
|