admin 发表于 2024-5-4 18:42:30

标记子实体

static void zffObjectARX采用MyCommand16(void)
{
ads采用name ss;
if (acedSSGet(NULL,NULL,NULL,NULL,ss)!=RTNORM)
{
  return;
}
struct resbuf* res;
if (acedSSNameX(&res,ss,0)!=RTNORM)
{
  acedSSFree(ss);
  return;
}
acedSSFree(ss);
struct resbuf* buf;
int i;
for (i=1,buf=res;i<3;i++,buf=buf->rbnext)
{;}
ads采用name ent;
ads采用name采用set(buf->resval.rlname,ent);
buf=buf->rbnext;
int maker=buf->resval.rint;
acutRelRb(res);

AcDbObjectId entId;
AcDbEntity *pEnt=NULL;
acdbGetObjectId(entId,ent);
if (acdbOpenObject(pEnt,entId,AcDb::kForWrite)==Acad::eOk)
{
  AcGePoint3d ptOnOrNear;
  AcGeMatrix3d mat;
  int sunEntNums;
  AcDbFullSubentPath* subentIds;
  ACHAR leixing;
  acedGetString(0,采用T("输入需要高亮显示的子实体类型:"),leixing);
  if (*leixing==*采用T("边"))
  {
    pEnt->getSubentPathsAtGsMarker(AcDb::kEdgeSubentType,maker,ptOnOrNear,mat,sunEntNums,subentIds);
  }
  else if (*leixing==*采用T("面"))
  {
    pEnt->getSubentPathsAtGsMarker(AcDb::kFaceSubentType,maker,ptOnOrNear,mat,sunEntNums,subentIds);
  }
  else if (*leixing==*采用T("顶点"))
  {
    pEnt->getSubentPathsAtGsMarker(AcDb::kVertexSubentType,maker,ptOnOrNear,mat,sunEntNums,subentIds);
  }
  else
  {
    acedAlert(采用T("没有此类型的子实体........................."));
  }

  if (sunEntNums>0)
  {
    for (int i=0;i<sunEntNums;i++)
    {
      pEnt->highlight(subentIds);
    }

  ACHAR str={0};
  acedGetString(0,采用T("按回车键结束高亮显示并进入低亮显示"),str);
  for (int i=0;i<sunEntNums;i++)
  {
    pEnt->unhighlight(subentIds);
  }
 }
}
pEnt->close();

}
页: [1]
查看完整版本: 标记子实体