- UID
- 5043
- 积分
- 1347
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-13
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- //-----------------------------------------------------------------------------//----- acrxEntryPoint.cpp//-----------------------------------------------------------------------------#include "StdAfx.h"#include "acedCmdNF.h"#include "resource.h"//-----------------------------------------------------------------------------#define szRDS _RXST("")//-----------------------------------------------------------------------------//----- ObjectARX EntryPointclass CMyJoinApp : public AcRxArxApp {public:CMyJoinApp() : AcRxArxApp() {}virtual AcRx::AppRetCode On_kInitAppMsg(void *pkt) {AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg(pkt);return (retCode);}virtual AcRx::AppRetCode On_kUnloadAppMsg(void *pkt) {AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg(pkt);return (retCode);}virtual void RegisterServerComponents() {}static void RivilisMyJoin() {// Check PEDITACCEPT sysvarresbuf rb = { 0, RTSHORT, 0 };acedGetVar(_T("PEDITACCEPT"), &rb);bool bPeditAccept = (rb.resval.rint == 1) ? true : false;ads_name en1; ads_point p;while (acedEntSel(_T("\nSelect first segment: "), en1, p) == RTNORM){// if PEDITACCEPT == 1 then PEDIT no ask about convertingbool bConvertToPoly = false;if (!bPeditAccept){AcDbObjectId id1; acdbGetObjectId(id1, en1);if (id1.objectClass() == AcDbLine::desc() ||id1.objectClass() == AcDbArc::desc()){bConvertToPoly = true;}}ads_name en2;if (acedEntSel(_T("\nSelect next segment: "), en2, p) == RTNORM){if (bConvertToPoly)acedCommandS(RTSTR, _T("_PEDIT"), RTENAME, en1, RTSTR, _T("_YES"), RTSTR, _T("_Join"),RTENAME, en2, RTSTR, _T(""), RTSTR, _T(""), RTNONE);elseacedCommandS(RTSTR, _T("_PEDIT"), RTENAME, en1, RTSTR, _T("_Join"),RTENAME, en2, RTSTR, _T(""), RTSTR, _T(""), RTNONE);}}}};//-----------------------------------------------------------------------------IMPLEMENT_ARX_ENTRYPOINT(CMyJoinApp)ACED_ARXCOMMAND_ENTRY_AUTO(CMyJoinApp, Rivilis, MyJoin, MyJoin, ACRX_CMD_MODAL, NULL)
|
|