OBJECTARX开发 与用户交互-- 输入函数汇总
static void TESTinputcmd(){CString outStr;
//acedGetReal
/*ads采用real realNum;
acedGetReal(采用T("输入一个实数"),&realNum);
outStr.Format(采用T("%lf"),realNum);
acutPrintf(outStr);*/
//acedGetInt
/*int iNum;
acedGetInt(采用T("输入一个整数"),&iNum);
outStr.Format(采用T("%d"),iNum);
acutPrintf(outStr);*/
//acedGetString
/*TCHAR str;
acedGetString(0,采用T("输入一个字符串"),str);
acutPrintf(str);*/
//acedGetKword
/* TCHAR kw;
acedGetKword(采用T("输入一个关键字"),kw);
acutPrintf(kw);*/
//acedGetPoint
/* ads采用point pt;
acedGetPoint(NULL,采用T("输入一个点"),pt);
outStr.Format(采用T("x:%f,y:%f"),pt,pt);
acutPrintf(outStr);*/
//acedGetCorner(要与ads采用point联合使用,完成画矩形)
/*ads采用point ptCorner;
acedGetCorner(pt,采用T("输入对角点"),ptCorner);
outStr.Format(采用T("x:%f,y:%f"),ptCorner,ptCorner);
acutPrintf(outStr);*/
//acedGetDist(和ads采用point结合使用,实现画线)
/*ads采用real ptReal;
acedGetDist(pt,采用T("输入目标值"),&ptReal);
outStr.Format(采用T("%lf"),ptReal);
acutPrintf(outStr);*/
//acedGetAngle(和ads采用point结合使用,实现画线)
/* ads采用real agReal;
acedGetAngle(pt,采用T("输入一个角度"),&agReal);
outStr.Format(采用T("%lf"),agReal);
acutPrintf(outStr);*/
}
选择对象
static BOOL SelObj(ads采用point& pt,AcDbObjectId& objId){
ads采用name en;
if(acedEntSel(采用T("\n选择对象"),en,pt) != RTNORM){
return false;
}
Acad::ErrorStatus es = acdbGetObjectId(objId,en);
return es == Acad::ErrorStatus::eOk ? true : false;
}
页:
[1]