lilq_78 发表于 2006-3-11 10:03:00

怎样实现拷贝,移动,镜像,偏移,阵列等

怎样实现拷贝,移动,镜像,偏移,阵列等,但是我不想用acedCommand来调用autocad的命令,用arx怎么实现?

jingelou 发表于 2006-3-11 23:55:00

<STRONG>//移动实体<BR></STRONG>//移动实体<BR>void CTszDwg::MoveEntity(const AcDbObjectIdArray&amp; aryIds,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcGePoint3d ptStart,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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&lt;aryIds.length();i++)<BR>{<BR>&nbsp;&nbsp;AcDbObjectId Id=aryIds.at(i);<BR>&nbsp;&nbsp;ads_name name;<BR>&nbsp;&nbsp;acdbGetAdsName(name,Id);<BR>&nbsp;&nbsp;ads_ssadd(name,ssname,ssname);<BR>&nbsp;&nbsp;ads_ssfree(name);<BR>}<BR>ads_xformss(ssname,xform1.entry);<BR>ads_ssfree(ssname);<BR>}

lilq_78 发表于 2006-3-12 07:26:00

<P>谢谢,</P>

lilq_78 发表于 2006-3-13 15:30:00

<P>那怎么样拷贝,偏移?</P>

lilq_78 发表于 2006-3-29 13:50:00

顶一下

jingelou 发表于 2006-4-5 09:02:00

<P><BR>AcDbObjectId CLjDwg::GetMirrorEntity(const AcDbObjectId Id,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcGePoint3d ptMirAxisStart,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcGePoint3d ptMirAxisEnd)<BR>{<BR>&nbsp;AcDbObjectId idMirror=AcDbObjectId::kNull;<BR>&nbsp;AcGeMatrix3d xform1;<BR>&nbsp;//xform1.setToMirroring(AcGeLine3d(ptMirAxisStart,ptMirAxisEnd));<BR>&nbsp;AcGePlane Plan(ptMirAxisStart,AcGePoint3d(ptMirAxisEnd.x,ptMirAxisEnd.y,-100),ptMirAxisEnd);<BR>&nbsp;xform1.setToMirroring(Plan);<BR>&nbsp;<BR>&nbsp;AcDbEntity* pEnt=NULL;<BR>&nbsp;acdbOpenObject(pEnt,Id,AcDb::kForRead);<BR>&nbsp;if(pEnt)<BR>&nbsp;{<BR>&nbsp;&nbsp;AcDbEntity* pEnt0=(AcDbEntity*)pEnt-&gt;clone();<BR>&nbsp;&nbsp;pEnt-&gt;close();<BR>&nbsp;&nbsp;pEnt0-&gt;transformBy(xform1);<BR>&nbsp;&nbsp;idMirror=AddEntity(pEnt0);<BR>&nbsp;&nbsp;pEnt0-&gt;close();<BR>&nbsp;}<BR>&nbsp;return idMirror;<BR>}<BR></P>
<P>void CLjDwg::RotateEntity(const AcDbObjectId Id,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const AcGePoint3d ptCenter,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const double dAngle)<BR>{<BR>&nbsp;AcDbObjectId idMirror=AcDbObjectId::kNull;<BR>&nbsp;AcGeMatrix3d xform1;<BR>&nbsp;xform1.setToRotation(dAngle,AcGeVector3d(0,0,1),ptCenter);<BR>&nbsp;&nbsp;<BR>&nbsp;AcDbEntity* pEnt=NULL;<BR>&nbsp;acdbOpenObject(pEnt,Id,AcDb::kForWrite);<BR>&nbsp;if(pEnt)<BR>&nbsp;{&nbsp;&nbsp;<BR>&nbsp;&nbsp;pEnt-&gt;transformBy(xform1);<BR>&nbsp;&nbsp;pEnt-&gt;close();<BR>&nbsp;}<BR>}</P>

lilq_78 发表于 2006-4-6 21:16:00

多谢!

jimn517 发表于 2006-4-8 21:28:00

<P>ding</P>
页: [1]
查看完整版本: 怎样实现拷贝,移动,镜像,偏移,阵列等