- UID
- 237010
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-4-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
可以派生出来的,但好象有些函数不能用,比如TRIM EXTEND等,请大家讨论一下还有哪些函数需要重载?
以下是代码:
#include "aced.h"
#include "adslib.h"
#include "dbsymtb.h"
#include "acgi.h"
#include "dbapserv.h"
#include "dbents.h"
class myline: public AcDbLine
{
public:
ACRX_DECLARE_MEMBERS(myline);
myline();
~myline();
};
ACRX_DXF_DEFINE_MEMBERS(myline,AcDbEntity,
AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent, 0x5,\
myline,myline);
myline::myline()
{
}
myline::~myline()
{
}
void
addmyline()
{
ads_point pt1,pt2;
if ((ads_getpoint(NULL,"\nStart point:",pt1))!=RTNORM)
return;
if ((ads_getpoint(pt1,"\nEnd point:",pt2))!=RTNORM)
return;
AcGePoint3d pt11,pt21;
pt11.set(pt1[X],pt1[Y],pt1[Z]);
pt21.set(pt2[X],pt2[Y],pt2[Z]);
myline *pNewObj = new myline;
pNewObj->setStartPoint(pt11);
pNewObj->setEndPoint(pt21);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getSymbolTable(pBlockTable, AcDb::kForRead);
AcDbBlockTableRecord *pBlock;
pBlockTable->getAt(ACDB_MODEL_SPACE, pBlock,
AcDb::kForWrite);
AcDbObjectId objId;
pBlock->appendAcDbEntity(objId, pNewObj);
pBlockTable->close();
pBlock->close();
pNewObj->close();
}
void
initapp()
{
myline::rxInit();
acrxBuildClassHierarchy();
acedRegCmds->addCommand("qx",
"qq",
"qq",
ACRX_CMD_TRANSPARENT,
addmyline);
}
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* appId)
{
switch (msg) {
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(appId);
acrxDynamicLinker->registerAppMDIAware(appId);
initapp();
break;
case AcRx::kUnloadAppMsg:
acedRegCmds->removeGroup("qx");
deleteAcRxClass(myline::desc());
}
return AcRx::kRetOK;
} |
|