背景
在使用Arx对cad进行二次开发,实现镜像功能时,发现使用系统函数AcGeMatrix3d::mirroring和AcGeMatrix3d::setToMirroring无法对自定义实体进行镜像(或许是由于自定义实体部分实现存在问题,但没有找到原因),便想到使用acedCommand或acedCommandS给cad发送命令实现镜像功能。
介绍
在使用acedCommand或acedCommandS函数过程中,其中遇到了一些问题,由于cad的函数参数介绍不是太清晰,导致使用过程中需要摸索实验,找到最终如何填充各个参数,实现镜像功能,功夫不负有心人,通过查找及实验,成功解决了使用acedCommand或acedCommandS给cad发送命令实现镜像功能。
实现
// 对选中的实体逐个实现镜像功能
ads_name ents;
ads_point pt1, pt2;
if (acedSSGet(NULL, NULL, NULL, NULL, ents) != RTNORM) {
return;
}
if (acedGetPoint(NULL, L"Pt:", pt1) != RTNORM) {
return;
}
if (acedGetPoint(pt1, L"Pt:", pt2) != RTNORM) {
return;
}
ads_name singleEnt;
long len = 0;
acedSSLength