|
高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】怎样实现拷贝,移动,镜像,偏移,阵列等
怎样实现拷贝,移动,镜像,偏移,阵列等
怎样实现拷贝,移动,镜像,偏移,阵列等
怎样实现拷贝,移动,镜像,偏移,阵列等,但是我不想用acedcommand来调用autocad的命令,用arx怎么实现?
//移动实体
//移动实体
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<aryids.length();i++)
{
acdbobjectid id=aryids.at(i);
ads_name name;
acdbgetadsname(name,id);
ads_ssadd(name,ssname,ssname);
ads_ssfree(name);
}
ads_xformss(ssname,xform1.entry);
ads_ssfree(ssname);
}
谢谢,
那怎么样拷贝,偏移?
顶一下
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();
}
}
多谢!
ding
|