📄 getutilities.h
字号:
#ifndef GET_UTILITIES_H
#define GET_UTILITIES_H
//////////////////////////////////////////////////////////////////////////
//
// 与acedGetXXX()相关的函数
//
// Note:
//
//////////////////////////////////////////////////////////////////////////
/*
* Purpose:
* 将ADS函数的返回值映射为Acad::ErrorStatus相应值
* Argument:
* rt [in], ADS函数返回值
* Return:
* Acad::ErrorStatus相应值.
*/
extern Acad::ErrorStatus RTtoStatus (int rt);
/*
* Purpose:
* 弹出错误信息窗口
* Argument:
* msg [in], 错误信息提示
* lineInfo [in], 显示 __FILE__, __LINE__
* file [in], 出错的__FILE__
* line [in], 出错的__LINE__
*/
extern void
errorMsg(const CString& msg,
BOOL lineInfo = FALSE,
const CString& file = "" ,
int line = 0);
/*
* Purpose:
* 选择实体返回其Id
* Argument:
* msg [in], 提示信息
* pClass [in], 需要返回的实体类型desc(),
* I.e. AcDbLine::desc () for a line entity
* if NULL, not return anything.
* Return:
* 实体Id,如果为kNull表示失败.
*/
extern AcDbObjectId
selectEntity (const char *msg=NULL, AcRxClass *pClass=NULL);
/*
* Purpose:
* Select entity, retrieve object Id and open it
* Argument:
* prompt [in], 提示信息
* id [out], 返回的实体Id
* pick [out], 输入的屏幕上的点
* mode [in], 实体打开模式
* Return:
* A non-zero return value indicates success
*/
extern AcDbEntity*
selectEntity (const char* prompt,
AcDbObjectId& id,
AcGePoint3d& pick,
AcDb::OpenMode mode=AcDb::kForRead);
/*
* Purpose:
* Let the user select a Line, Xline or Ray from the drawing
* and get correspondent AcGeLinearEnt3d
* Argument:
* msg [in], prompt message
* linearEnt [out], correspondent AcGeLinearEnt3d
* Return:
* Acad::eInvalidInput, if not linear entity selected, or no entity selected
* Acad::eOk, success, select a Line, Xline or Ray.
*/
extern Acad::ErrorStatus
selectLinearEnt (const char* msg, AcGeLinearEnt3d*& linearEnt);
/*
* Purpose:
* Get a Yes or No from the user
* Argument:
* prompt [in], user command prompt without Yes/<No>
* def [in], default value; 1 = Yes
* Return:
* 1 = yes
* 0 = no
* -1 = user canceled or error etc.
*/
extern int getYesOrNo (char* prompt, int def);
/*
* Purpose:
* prompt to the edit " Press any Key... ",
* wait for the user input, used to pause.
*/
extern void wait();
/*
* Purpose:
* get points from pick, ESC or RETURN end.
* Argument:
* prompt [in], user command prompt
* pnts [out], returned points
* Return:
* RTCAN when user canceled, RTNORM when user ended by RETURN.
*/
extern int
getPoints (const char *prompt,AcGePoint3dArray& pnts);
/*
* Purpose:
* get curve entity pointer from pick.
* Argument:
* prompt [in], user command prompt
* pObj [out], returned entity pointer
* Return:
* RTNORM if success, or RTCAN, RTERROR.
*/
extern int
selectCurve (const char* prompt,AcDbCurve *&pObj);
/*
* Purpose:
* get curves entity pointer from pick.
* Argument:
* prompt [in], user command prompt
* pCurves [out], returned entities pointer
* Return:
* RTNORM if success, or RTCAN, RTERROR.
*/
extern int
selectCurves(const char* prompt,AcDbVoidPtrArray &pCurves);
/*
* Purpose:
* get entity pointer from pick, filtered by dxfname.
* Argument:
* prompt [in], user command prompt
* dxfname [in], choice object dxf name
* pObj [out], returned entity pointer
* mode [in], object open mode
* Return:
* RTNORM if success, or RTCAN, RTERROR.
*/
extern int
selectEntity (const char* prompt,
const CString& dxfname,
AcDbEntity *&pObj,
AcDb::OpenMode mode=AcDb::kForRead);
/*
* Purpose:
* get entity pointer from pick, filtered by dxfname.
* Argument:
* prompt [in], user command prompt
* dxfname [in], choice object dxf names
* pObj [out], returned entity pointer
* mode [in], object open mode
* Return:
* RTNORM if success, or RTCAN, RTERROR.
*/
extern int
selectEntity(const char* prompt,
const CStringArray &dxfname,
AcDbEntity *&pObj,
AcDb::OpenMode mode=AcDb::kForRead);
/*
* Purpose:
* get entity pointer from pick, filtered by dxfname.
* Argument:
* prompt [in], user command prompt
* dxfname [in], choice object dxf names
* pEnts [out], returned entity pointer array
* mode [in], object open mode
* Return:
* RTNORM if success, or RTCAN, RTERROR.
*/
extern int
selectEntities(const char* prompt,const CString& dxfname, AcDbVoidPtrArray &pEnts,AcDb::OpenMode mode=AcDb::kForRead);
#endif // GET_UTILITIES_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -