admin 发表于 2024-3-14 20:29:06

[每日一码] ARC转POLYLINE

//-----------------------------------------------------------------------------//----- 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)
页: [1]
查看完整版本: [每日一码] ARC转POLYLINE