acedinitget
// 提示用户选择选择方式
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的更多相关文章
- ObjectARX® for Beginners: An Introduction
转:ObjectARX® for Beginners: An Introduction Lee Ambrosius – Autodesk, Inc. CP4164-L Objec ...
- acedSSGet 翻译
ObjectARX 参考指南 > 全局函数 > AcEd 全局函数 > acedSSGet 函数 acedSSGet 折叠全部 C++ int acedSSGet( const AC ...
- 类似倒圆角方法输入半径选择实体 kword
ads_name ename; ads_point adspt; acedInitGet(NULL, TEXT("R")); while (1) { int rc = acedEn ...
随机推荐
- influxDB系列(二)--查看数据库的大小
google 搜索了好多文档,终于发现了这个靠谱的回答. https://groups.google.com/forum/#!topic/influxdb/I5eady_Ta5Y You can se ...
- 最简单的视音频播放演示样例7:SDL2播放RGB/YUV
===================================================== 最简单的视音频播放演示样例系列文章列表: 最简单的视音频播放演示样例1:总述 最简单的视音频 ...
- ViewPager中View的复用
代码例如以下: public class MyViewPagerAdapter extends PagerAdapter { //显示的数据 private List<DataBean> ...
- 从头认识Spring-1.9 内部类注入Bean
这一章节我们来讨论一下内部类注入Bean. 1.domain 蛋糕类:(跟前一章节的一样) package com.raylee.my_new_spring.my_new_spring.ch01.to ...
- 初探C++运算符重载学习笔记<2> 重载为友元函数
初探C++运算符重载学习笔记 在上面那篇博客中,写了将运算符重载为普通函数或类的成员函数这两种情况. 以下的两种情况发生.则我们须要将运算符重载为类的友元函数 <1>成员函数不能满足要求 ...
- 让mongodb执行js文件
环境: Linux js代码: 循环删除表中的数据: clear-mongodb-dialog.js print('=========BEGIN=========='); for(var i of [ ...
- visual studio推荐的插件
https://marketplace.visualstudio.com/items?itemName=EricLebetsamer.BootstrapSnippetPack https://mark ...
- 收集主机OS相关数据
#!/usr/bin/ksh touch hostinfo$(date +%Y%m%d).csv filename=hostinfo$(date +%Y%m%d).csv >${filename ...
- shell脚本-基础
shell脚本-基础 编程基础 程序是指令+ 数据 程序编程风格: 过程式:以指令为中心,数据服务于指令 对象式:以数据为中心,指令服务于数据 shell 程序提供了编程能力,解释执行. 计算运行二进 ...
- [Swift通天遁地]九、拔剑吧-(3)创建多种自定义Segment分段样式的控件
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...