怎样实现拷贝,移动,镜像,偏移,阵列等
怎样实现拷贝,移动,镜像,偏移,阵列等,但是我不想用acedCommand来调用autocad的命令,用arx怎么实现? <STRONG>//移动实体<BR></STRONG>//移动实体<BR>void CTszDwg::MoveEntity(const AcDbObjectIdArray& aryIds,<BR> AcGePoint3d ptStart,<BR> AcGePoint3d ptEnd)<BR>{<BR>AcGeMatrix3d xform1;<BR>xform1.setTranslation(AcGeVector3d(ptEnd-ptStart));<BR><BR>ads_name ssname;<BR>ads_ssadd(NULL,NULL,ssname);<BR>for(int i=0;i<aryIds.length();i++)<BR>{<BR> AcDbObjectId Id=aryIds.at(i);<BR> ads_name name;<BR> acdbGetAdsName(name,Id);<BR> ads_ssadd(name,ssname,ssname);<BR> ads_ssfree(name);<BR>}<BR>ads_xformss(ssname,xform1.entry);<BR>ads_ssfree(ssname);<BR>} <P>谢谢,</P> <P>那怎么样拷贝,偏移?</P> 顶一下 <P><BR>AcDbObjectId CLjDwg::GetMirrorEntity(const AcDbObjectId Id,<BR> AcGePoint3d ptMirAxisStart,<BR> AcGePoint3d ptMirAxisEnd)<BR>{<BR> AcDbObjectId idMirror=AcDbObjectId::kNull;<BR> AcGeMatrix3d xform1;<BR> //xform1.setToMirroring(AcGeLine3d(ptMirAxisStart,ptMirAxisEnd));<BR> AcGePlane Plan(ptMirAxisStart,AcGePoint3d(ptMirAxisEnd.x,ptMirAxisEnd.y,-100),ptMirAxisEnd);<BR> xform1.setToMirroring(Plan);<BR> <BR> AcDbEntity* pEnt=NULL;<BR> acdbOpenObject(pEnt,Id,AcDb::kForRead);<BR> if(pEnt)<BR> {<BR> AcDbEntity* pEnt0=(AcDbEntity*)pEnt->clone();<BR> pEnt->close();<BR> pEnt0->transformBy(xform1);<BR> idMirror=AddEntity(pEnt0);<BR> pEnt0->close();<BR> }<BR> return idMirror;<BR>}<BR></P><P>void CLjDwg::RotateEntity(const AcDbObjectId Id,<BR> const AcGePoint3d ptCenter,<BR> const double dAngle)<BR>{<BR> AcDbObjectId idMirror=AcDbObjectId::kNull;<BR> AcGeMatrix3d xform1;<BR> xform1.setToRotation(dAngle,AcGeVector3d(0,0,1),ptCenter);<BR> <BR> AcDbEntity* pEnt=NULL;<BR> acdbOpenObject(pEnt,Id,AcDb::kForWrite);<BR> if(pEnt)<BR> { <BR> pEnt->transformBy(xform1);<BR> pEnt->close();<BR> }<BR>}</P> 多谢! <P>ding</P>
页:
[1]