|
[code]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[100];
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[i]);
}
ACHAR str[20]={0};
acedGetString(0,_T("按回车键结束高亮显示并进入低亮显示"),str);
for (int i=0;i<sunEntNums;i++)
{
pEnt->unhighlight(subentIds[i]);
}
}
}
pEnt->close();
}[/code] |
|