GS标记子实体
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();
}
更多文章
-
用AcedGrRead()函数实现一拖多
实现代码:#include "StdAfx.h"#include "StdArx.h"#include "..\..\Common\我的类\Arc.h"#include <acedads.h>#include "..\..\Common\Entity\LineUtil.h"#include <geassign.h>#include <dbents.h>#include "..\..\Common\Others\ConvertUtil.h"#in
-
改变多段线区直
代码:#include "StdAfx.h"#include "StdArx.h"#include <dbpl.h>#include "..\..\Common\Others\ConvertUtil.h"#include <geassign.h>#include "..\..\Common\Entity\ArcUtil.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <afxwin.h&
-
获取任意路径Dwg文件内所有块在控件中显示并能选择插入当前模型空间
主对话框CPP内代码:#include "StdAfx.h"#include "resource.h"#include "BlockDialog.h"#include "..\..\Common\我的类\file.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <dbents.h>#include <dbmain.h>#include "..\..\Chapter11
-
多段线动态切割闭合区域
#include "StdAfx.h"#include "StdArx.h"#include <dbpl.h>#include "..\..\Common\Others\ConvertUtil.h"#include "..\..\Common\Document\DwgDatabaseUtil.h"#include <dbents.h>#include <dbregion.h>#include "..\..\Common\Entity\RegionUtil.h"
-
自创实体类从AcDbCurve派生,实现一些类方法并动态绘制
MyCurve.cpp:#include "StdAfx.h"#include "MyCurve.h"#include "actrans.h"#include "aced.h"//-----------------------------------------------------------------------------Adesk::UInt32 CMyCurve::kCurrentVersionNumber =1 ;//----------------------------------------