zoukankan      html  css  js  c++  java
  • acedinitget

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

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

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

     

    if (RTCAN == nRs)   // 取消

            {

                return;

            }

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

            {

                // 让用户选择一个点

                ads_point pt;

                nRs = acedGetPoint(NULL, _T(" 请选择点:"), 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(" 请输入第一个角点:"), pt1);

                    if (RTNORM != nRs)

                        return;

     

                    nRs = acedGetPoint(pt1, _T(" 请输入第二个角点:"), 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(" 输入第一个点:"), pt[0]);

                    if (RTNORM != nRs)

                        return;

     

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

                    if (RTNORM != nRs)

                        return;

     

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

                    if (RTNORM != nRs)

                        return;

     

                    nRs = acedGetPoint(pt[2], _T(" 第四个点:"), 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(" 无效输入"));

                    return;

                }

            }

            else

            {

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

                return;

            }

     

            if (RTNONE == nRs)

            {

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

                return;

            }

            elseif (RTNORM != nRs)

            {

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

                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(" 删除成功"));

            return;

        }

    } ;

     

  • 相关阅读:
    [安卓]AndroidManifest.xml文件简介及结构
    [网络技术][转]PPTP协议解析
    ubuntu 12.04 (64位)下安装oracle 11g过程及问题总结
    deb包制作(转)
    短信部分之PDU简介及其格式(转)
    Siemens3508手机AT指令发送短信的实验
    GDB中应该知道的几个调试方法【转陈浩】
    JLink间接烧写【转自armobbs】
    [转]Java事件处理机制- 事件监听器的四种实现方式
    asp.net验证码
  • 原文地址:https://www.cnblogs.com/xzh1993/p/4688382.html
Copyright © 2011-2022 走看看