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 ...
随机推荐
- 《从零開始学Swift》学习笔记(Day 55)——使用try?和try!差别
原创文章.欢迎转载.转载请注明:关东升的博客 在使用try进行错误处理的时候,常常会看到try后面跟有问号(? )或感叹号(!),他们有什么差别呢? 1.使用try? try?会将错误转换为可选值 ...
- 【翻译自mos文章】rman 标准版和企业版的兼容性
rman 标准版和企业版的兼容性 来源于: RMAN Standard and Enterprise Edition Compatibility (文档 ID 730193.1) 适用于: Oracl ...
- 为部门整理的mysql_db使用军规
mysql_db使用军规: 1.禁止开发測试人员在IDC环境手工删除和改动数据 2.全部需求通过DB工具系统提交 3.禁止在IDC环境DB进行測试 4.IDC环境提交的sql语句一定要经过非正式环境验 ...
- swift 2.0 语法 循环
//: Playground - noun: a place where people can play import UIKit /*: for循环 * 基本用法和OC一致 * 条件表达式必须是bo ...
- [Unity 设计模式]IOC依赖倒置
1.前言 最近在看<游戏开发与设计模式>一书,看到控制反转设计模式,作者说:上层模块不应该依赖于下层模块,上层模块和下层模块都应该依赖于接口,这样能减少耦合.然后附带举了个例子,我觉得特别 ...
- Codeforces Round #367 (Div. 2) 套题
吐槽:只能说是上分好场,可惜没打,唉 A:Beru-taxi (水题,取最小值) #include <cstdio> #include <cstring> #include & ...
- PCB 脱离IIS的Web应用
在用.net Web编程中,我们写好的Web应用首选会挂在IIS上面,因为它足稳定并且功能齐全,但这不是我们唯一的选择,微软给我们提供了Owin组件,Web应该的宿主可以不再是IIS了,有了Owin后 ...
- Vue使用html2canvas将页面转化为图片
需求是微信端将页面截屏之后保存到本地,使用了html2canvas插件 先引入插件 npm install --save html2canvas 之后在你所需要使用的页面引入 import html2 ...
- centos源更新
.备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup .下载新的CentOS-Base.r ...
- sessionStorage 的使用
sessionStorage 的使用: sessionStorage.removeItem("data"); sessionStorage.getItem("data&q ...