- UID
- 3181
- 积分
- 162
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-3-20
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
AcDbBlockRefence的插入的转换矩阵是什么,知道插入实体块的组成实体的相对坐标后怎样转换成INSERT示例上的点?谢谢!
下面是获得各个实体的点:
ads_name ss;
ads_point pt;
if(acedEntSel(NULL,ss,pt)!=RTNORM)
return ;
AcDbObjectId ObjId;
acdbGetObjectId(ObjId,ss);
AcDbBlockReference *BlockRef;
acdbOpenObject(BlockRef,ObjId,AcDb::kForRead);
if(BlockRef!=NULL)
{
AcDbObjectId id=BlockRef->blockTableRecord();
AcDbBlockTableRecord *BlockRec;
acdbOpenObject(BlockRec,id,AcDb::kForRead);
if(BlockRec!=NULL)
{
AcDbBlockTableRecordIterator *pBlockIterator;
BlockRec->newIterator(pBlockIterator);
for(;!pBlockIterator->done();
pBlockIterator->step())
{
AcDbEntity *pEntity;
pBlockIterator->getEntity(pEntity,AcDb::kForRead);
AcDbCurve *pline;
acdbOpenObject(pline,pEntity->objectId(),AcDb::kForRead);
if(pline!=NULL)
{//遍历块上所有实体的点
AcGePoint3d ePt,sPt;
pline->getStartPoint(sPt);
pline->getEndPoint(ePt);
CString Str,Str1;
Str.Format("X=%f,Y=%f,Z=%f",ePt[X],ePt[Y],ePt[Z]);
Str1.Format("\nX=%f,Y=%f,Z=%f",sPt[X],sPt[Y],sPt[Z]);
Str+=Str1;
AfxMessageBox(Str);
}
pline->close();
}
} |
|