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;

        }

    } ;

     

  • 相关阅读:
    ps cs5 gif 动画 分解
    api 生成方法
    AVAYA 交换机
    jQuery操作input值
    CMM3 软件升级
    ehcache 使用 缓存:健值,页面,Hibernate,监控
    网络封包分析软件Wireshark
    Hacking Windows 7 SP 1 Using Java Signed Applet Social Engineering Code Execution
    以太网历史
    转:web应用开发的发展方向
  • 原文地址:https://www.cnblogs.com/xzh1993/p/4688382.html
Copyright © 2011-2022 走看看