天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 64|回复: 0

‎如何防止用户在使用 ObjectARX 使用 acedSSGet() 时选择"ALL...

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
How can I prevent the user from selecting "ALL" when using acedSSGet() using ObjectARX?
‎如何防止用户在使用 ObjectARX 使用 acedSSGet() 时选择"ALL"?‎[code]// this function allows the user to

// type "all", but only the entities

// in the current space are selected

void asdkSelectALL()

{

ads_name ss;

// get the selectionset

int res = acedSSGet (NULL, NULL, NULL, NULL, ss);

// if ok

if (res == RTNORM)

{

  // get the length of the selection set

  long length = 0l;

  acedSSLength (ss, &length);

  // see what we have

  acutPrintf(L"\nBefore ss length = %ld", length);

  // now loop round and find out which ones are in Paper space

  for (long i=0l; i<length; ++i)

  {

   ads_name ename;

   // extract the ename

   if (acedSSName (ss, i, ename) != RTNORM)

    continue;

   AcDbObjectId objId;

   // convert the ename to an object id

   acdbGetObjectId (objId, ename);

   // open the entity for read

   AcDbObjectPointer<AcDbEntity>ent (objId, AcDb::kForRead);

   // if ok

   if (ent.openStatus () == Acad::eOk)

   {

    // get the owner object for this entity

    AcDbObjectId ownerId = ent->ownerId();

    // get the current dwg database

    AcDbDatabase *dwg =

     acdbHostApplicationServices()->workingDatabase();

    // if the entity owner id is not the

    // same as the current space id

    if (dwg->currentSpaceId() != ownerId &&

     dwg->viewportTableId() != ownerId &&

     dwg->paperSpaceVportId() != ownerId)

    {

     // remove the entity from the selection set

     acedSSDel (ename, ss);

    }

   }

  }

  acedSSLength (ss, &length);

  // see what we have

  acutPrintf(L"\nAfter ss length = %ld", length);

  // test code

  acedCommand (RTSTR, "._SELECT", RTPICKS,

   ss, RTSTR, "", RTNONE);

  // free the selection set after use

  acedSSFree (ss);

}

}[/code]

 

 

 

 

‎如何防止用户在使用 ObjectARX 使用 acedSSGet() 时选择"ALL...
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 11:34 , Processed in 0.153802 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表