huangyhg 发表于 2003-10-22 21:18:00

arx提取公差标注信息

ads_nameen;
        int rc;
        ads_point pt;
rc=acedEntSel("\n Select a polyline:",en,pt);
        if(rc!=RTNORM)
        {
                ads_printf("\nError during object selection");
                return;
        }
double m_measure;
AcDbObjectId eId;
acdbGetObjectId(eId,en);
AcDbObject *pObj;
acdbOpenObject(pObj,eId,AcDb::kForRead);
AcDbFcf *ObjDim;   //这个临时变量用于存放转换为公差标注类型的实体
if(pObj->isKindOf(AcDbFcf::desc()))
{
    ObjDim = AcDbFcf::cast(pObj);
    m_measure=ObjDim->dimscale();
    ObjDim->close();
    pObj->close();
}

acutPrintf("\n dimscale is %.2f",m_measure);

huangyhg 发表于 2003-10-22 21:37:00

哦,忘了加头文件,以下的头文件有冗余!
#include "rxregsvc.h"
#include "dbsymtb.h"
#include "dbents.h"
#include "dbapserv.h"
#include "adslib.h"
#include "dbidmap.h"
#include "lngtrans.h"
#include "dbltrans.h"
#include "dbmain.h"
#include "aced.h"
#include "dbfcf.h"

sihan 发表于 2005-4-26 13:17:00

有没有LISP语言的呀
页: [1]
查看完整版本: arx提取公差标注信息