// 提示用户选择选择方式

acedInitGet(0, _T("W CP"));

int nRs = acedGetKword(_T("\n请输入关键字确定选择方式[窗选(W)/圈交(CP)]:<点选>"), szKword);

if (RTCAN == nRs)   // 取消

{

return;

}

elseif (RTNONE == nRs)  // 默认为点选

{

// 让用户选择一个点

ads_point pt;

nRs = acedGetPoint(NULL, _T("\n请选择点:"), pt);

if (RTNORM != nRs)  // 取消

return;

nRs = acedSSGet(NULL, pt, NULL, NULL, ss);

}

elseif (RTNORM == nRs)

{

if (_tcscmp(szKword, _T("W")) == 0)

{

// W方式选择集,需要两个点

ads_point pt1, pt2;

nRs = acedGetPoint(NULL, _T("\n请输入第一个角点:"), pt1);

if (RTNORM != nRs)

return;

nRs = acedGetPoint(pt1, _T("\n请输入第二个角点:"), pt2);

if (RTNORM != nRs)

return;

nRs = acedSSGet(_T("W"), pt1, pt2, NULL, ss);

}

elseif (_tcscmp(szKword, _T("CP")) == 0)

{

// CP方式构造选择集,需要一组点,此处需要四个点

ads_point pt[4];

nRs = acedGetPoint(NULL, _T("\n输入第一个点:"), pt[0]);

if (RTNORM != nRs)

return;

nRs = acedGetPoint(pt[0], _T("\n第二个点:"), pt[1]);

if (RTNORM != nRs)

return;

nRs = acedGetPoint(pt[1], _T("\n第三个点:"), pt[2]);

if (RTNORM != nRs)

return;

nRs = acedGetPoint(pt[2], _T("\n第四个点:"), pt[3]);

if (RTNORM != nRs)

return;

resbuf* pRb = acutBuildList(RTPOINT, pt[0], RTPOINT, pt[1], RTPOINT, pt[2], RTPOINT, pt[3], 0);

nRs = acedSSGet(_T("CP"), pRb, NULL, NULL, ss);

acutRelRb(pRb);

}

else

{

acutPrintf(_T("\n无效输入"));

return;

}

}

else

{

acutPrintf(_T("\n无效输入"));

return;

}

if (RTNONE == nRs)

{

acutPrintf(_T("\n选择集为空"));

return;

}

elseif (RTNORM != nRs)

{

acutPrintf(_T("\n构建选择集失败"));

return;

}

//////////////////////////////////////////////////////////////////////////

// 遍历选择集,删除实体

long lLen = 0;

acedSSLength(ss, &lLen);

for (long index = 0; index < lLen; index++)

{

ads_name ent;

AcDbObjectId objId;

acedSSName(ss, index, ent);

acdbGetObjectId(objId, ent);

if (!objId.isValid())

continue;

AcDbEntity* pEnt = NULL;

if (Acad::eOk != acdbOpenAcDbEntity(pEnt, objId, AcDb::kForWrite))

continue;

pEnt->erase();

pEnt->close();

}

acutPrintf(_T("\n删除成功"));

return;

}

} ;

acedinitget的更多相关文章

  1. ObjectARX® for Beginners: An Introduction

    转:ObjectARX® for Beginners: An Introduction Lee Ambrosius – Autodesk, Inc.         CP4164-L    Objec ...

  2. acedSSGet 翻译

    ObjectARX 参考指南 > 全局函数 > AcEd 全局函数 > acedSSGet 函数 acedSSGet 折叠全部 C++ int acedSSGet( const AC ...

  3. 类似倒圆角方法输入半径选择实体 kword

    ads_name ename; ads_point adspt; acedInitGet(NULL, TEXT("R")); while (1) { int rc = acedEn ...

随机推荐

  1. maven bug之Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project acSpaceCommon: Fatal error compiling: tools.jar not found: C:\Program Files\J

    maven打包项目的时候一直报这个异常  一般的解决办法我都试过 在pom.xml加代码 也不行  只有10分了  求大神解答 这是因为测试代码时遇到错误,它会停止编译.只需要在pom.xml的< ...

  2. 跳過 Windows RT的UI

    RT启动进入常规桌面 微软Surface RT发布的时间已经不短了,相信很多朋友都已经熟悉了这个全新的平板,并且已经上手.Surface RT开机默认进入的界面为Windows UI,这对于经常使用A ...

  3. C#文件运行类的VB.NET版本号

    主要差别在于事件处理要採用AddHandler和RemoveHandler,以及AddressOf三个keyword,其他基本一样. VB的操作稍微繁琐.但仍然能够实现.

  4. 用BOOST_FOREACH简化遍历操作

    BOOST_FOREACH能够方便的遍历STL容器. 仅仅须要头文件: #include <boost/foreach.hpp> 然后遍历容器vector/list/set/deque/s ...

  5. Angular常用标记

    (如果没有特别指明,则所有的HTML元素都支持该标记) (如果没有特别指明,则 AngularJS 指令不会覆盖原生js的指令) 1.数据绑定类: 1.插值语法:{{}} 2.标签内容绑定:ng-bi ...

  6. JSP开发学习参考文章

    配置JDK和Tomcat环境变量 http://blog.csdn.net/lijiazhi1987/article/details/2742181 eclipse maven plugin 插件安装 ...

  7. jsp 中声明方法的使用

    1.在"<%!"和"%>"之间声明方法,该方法在整个JSP页面有效.可是该方法内定义的变量仅仅在该方法内有效. 这些方法将在Java程序片中被调用, ...

  8. C++链表冒泡,归并,插入排序(纯指针)

    #include <iostream> using namespace std; //别问我为什么要写链表的冒泡排序. struct Node { int data; Node *next ...

  9. MapReduce03

    ======================== MapReduce 2.0基本架构 ======================== Client -------------> 与MapRed ...

  10. cas4.2的安装

    cas4.2使用的是gradle来构建项目的,项目代码在https://github.com/Jasig/cas下载. 然后之后进入项目的根目录,然后执行gradle来编译项目,如下: gradle ...