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

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

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

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

//移动实体
//移动实体
void CTszDwg::MoveEntity(const AcDbObjectIdArray& aryIds,
       AcGePoint3d ptStart,
       AcGePoint3d ptEnd)
{
AcGeMatrix3d xform1;
xform1.setTranslation(AcGeVector3d(ptEnd-ptStart));
ads_name ssname;
ads_ssadd(NULL,NULL,ssname);
for(int i=0;i谢谢,

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

那怎么样拷贝,偏移?

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

顶一下

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


AcDbObjectId CLjDwg::GetMirrorEntity(const AcDbObjectId Id,
      AcGePoint3d ptMirAxisStart,
      AcGePoint3d ptMirAxisEnd)
{
AcDbObjectId idMirror=AcDbObjectId::kNull;
AcGeMatrix3d xform1;
//xform1.setToMirroring(AcGeLine3d(ptMirAxisStart,ptMirAxisEnd));
AcGePlane Plan(ptMirAxisStart,AcGePoint3d(ptMirAxisEnd.x,ptMirAxisEnd.y,-100),ptMirAxisEnd);
xform1.setToMirroring(Plan);

AcDbEntity* pEnt=NULL;
acdbOpenObject(pEnt,Id,AcDb::kForRead);
if(pEnt)
{
AcDbEntity* pEnt0=(AcDbEntity*)pEnt->clone();
pEnt->close();
pEnt0->transformBy(xform1);
idMirror=AddEntity(pEnt0);
pEnt0->close();
}
return idMirror;
}

void CLjDwg::RotateEntity(const AcDbObjectId Id,
         const AcGePoint3d ptCenter,
         const double dAngle)
{
AcDbObjectId idMirror=AcDbObjectId::kNull;
AcGeMatrix3d xform1;
xform1.setToRotation(dAngle,AcGeVector3d(0,0,1),ptCenter);

AcDbEntity* pEnt=NULL;
acdbOpenObject(pEnt,Id,AcDb::kForWrite);
if(pEnt)
{
pEnt->transformBy(xform1);
pEnt->close();
}
}

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

多谢!

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

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