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 ...
随机推荐
- Spring MVC JSON自己定义类型转换(续)
前面提到了两种转换类型的方法(Spring MVC JSON自己定义类型转换),这里针对Json转换提供一种更简便的方法. 通过配置全局的日期转换来避免使用麻烦的注解. 首先用到了一个简单的日期工具类 ...
- ios method swizzling
阅读器 iOS开发iOS 本文由TracyYih[博客]翻译自NSHipster的文章Method Swizzling. 在上周associated objects一文中,我们开始探索Ob ...
- 【bzoj1028】[JSOI2007]麻将
首先枚举等待牌,再枚举对子牌. 然后1~n扫一遍,如果现在 s[i]不能被3整除,那么必须跟后两个数搭配几下变成能被3整除的.然后如果能被3整除,那么只要三个连续的一组可行,则三个相同的一组必定也 ...
- python pass 的用法
python pass用法 1.空语句 do nothing 2.保证格式完整 3.保证语义完整 4.以if语句为例: C/C++中写法: if(true) ; // do nothing else ...
- RDA 字库制作
制作韩语字库为例: 1.韩语UNICODE 范围 TV_IDF_uni_korean.txt [01fa,] [02c6,02c7] [02c9,02ca] [02cd,02cd] [02d8,02d ...
- residual sum of squares(ESL 读书笔记)
The learning algorithm has the property that it can modify its input/output relationship f-hat in re ...
- 【高德地图API】Pivot控件中加载地图并禁止Pivot手势
如题,解决方案,参考[Windows phone应用开发[20]-禁止Pivot手势]http://www.cnblogs.com/chenkai/p/3408658.html. xaml代码清单 ...
- ural 1012. K-based Numbers. Version 2(大数dp)
和1009相同,只是n达到了180位,可以模拟大数加和大数乘,这里用的java中的大数. import java.math.BigInteger; import java.util.Scanner; ...
- Java初学者如何排查学习中遇到的问题
大多数新手或者刚入门的人在学习的时候,不管是看视频还是看书,都会遇到各种各样的问题,比如JDK配置了,但是javac没有办法执行,Eclipse安装了,但是打不开,快捷键用不了,照着视频敲了但是和视频 ...
- DFS知识点
2019-06-01 11:14:34 加油,坚持!!! 1. 2. 3.