几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【讨论】获取AcDbDimension里的属性信息 (http://www.dimcax.com/hust/showthread.php?t=40)

huangyhg 2005-03-15 01:36 PM

【讨论】获取AcDbDimension里的属性信息
 
AcDbEntity *pEnt;



AcDbObjectId id;



AcGePoint3d ptPick;



ads_name eName;



if (acedEntSel ("Select a dimension: " , eName, asDblArray (ptPick)) != RTNORM )



return;



acdbGetObjectId (id, eName);



acdbOpenAcDbEntity (pEnt, id, AcDb::kForRead);



//----- Get the id of the block table record which owns the text entity



AcDbDimension *pDim =AcDbDimension::cast (pEnt);



if (pDim == NULL)



{



pEnt->close ();



return;



}



id =pDim->dimBlockId ();



pDim->close ();



AcDbBlockTableRecord *pr;



acdbOpenAcDbObject ((AcDbObject *&) pr, id, AcDb::kForRead);



//----- Iterating the block table record
AcDbBlockTableRecordIterator *pi;
pr->newIterator (pi);
while (!pi->done ())
{
pi->getEntity (pEnt, AcDb::kForRead);
if (pEnt->isKindOf (AcDbMText::desc ()))
{
AcDbMText *pt = (AcDbMText *) pEnt;
char *s = pt->contents ();
acutPrintf (s);
delete s;
}
pEnt->close();
pi->step();
}
pr->close();


所有的时间均为北京时间。 现在的时间是 05:39 AM.