zoukankan      html  css  js  c++  java
  • ARX亮显问题

    转载一段acedSSSetFirst的用法仅供参考:
    打个比方,我创建了一个命令,这个命令的功能是提示用户选择,然后只过滤文本对象作为选择集,随后在屏幕上使得这个选择集的所有成员都亮显,并且能够显示出各成员上的夹点。通常我们在cad中什么命令也不输入的时候,随便框选一下图中的对象得到的选择集就是被亮显和夹取的,在ARX中如何实现?

    ads_name sset,sset_temp;

    //那个sset_temp你有没有初始化,如果没有肯定错。运行你的语句之前先加上下面的语句
    // Set ss to a null selection set.,
    acedSSAdd(NULL,NULL,sset_temp ); //初始化一个选择

    long len;
    acedSSLength(sset,&len);
    for (int i=0;i<len;i++)
    {

    ads_name ent;
    acedSSName(sset,i,ent);
    AcDbObjectId objId;
    acdbGetObjectId(objId,ent);

    ...

    acedSSAdd(ent,sset_temp,sset_temp);

    ...

    }

    acedSSFree(sset);
    acedSSSetFirst(sset_temp,NULL);

    注意启动命令要设置为CRX_CMD_REDRAW | ACRX_CMD_USEPICKSET
    sssetfirst可以控制加点或者选择的显示,但要注意注册命令的参数。

    测试代码 包括高亮

    static void PGCmds_Test()
    {
    ads_name ssName, ssTemp;
    acedSSAdd(NULL, NULL, ssTemp);

    acedSSGet(NULL, NULL, NULL, NULL, ssName);
    long len;
    acedSSLength(ssName, &len);

    for (int i = 0; i < len; i++)
    {
    ads_name ent;
    acedSSName(ssName, i, ent);

    AcDbObjectId objid;
    acdbGetObjectId(objid, ent);
    AcDbEntity *pent=NULL;
    acdbOpenAcDbEntity(pent, objid, AcDb::kForRead);
    if (pent->isKindOf(AcDbText::desc()))
    {
    acedSSAdd(ent, ssTemp, ssTemp);
    }
    pent->close();
    }
    acedSSFree(ssName);
    acedSSSetFirst(ssTemp, NULL);

    //亮显功能测试
    AcDbEntity *pent = NULL;
    AcGePoint3d pt;
    CSelectUtil::PromptSelectEntity(_T("xuanz"), AcDbLine::desc(), pent, pt);
    pent->highlight();
    pent->close();
    }

  • 相关阅读:
    LeetCode Single Number
    Leetcode Populating Next Right Pointers in Each Node
    LeetCode Permutations
    Leetcode Sum Root to Leaf Numbers
    LeetCode Candy
    LeetCode Sort List
    LeetCode Remove Duplicates from Sorted List II
    LeetCode Remove Duplicates from Sorted List
    spring MVC HandlerInterceptorAdapter
    yum
  • 原文地址:https://www.cnblogs.com/xzh1993/p/5942750.html
Copyright © 2011-2022 走看看