Community
Hi Everybody,
I would like to call the SCALE command on a set of objects from ObjectARX and let the user select a base point and specify programmatically the scale factor.
Is there a way to do that?
Thank you guys so much!
Have a good day.
try this:
AcDbObjectIdArray mas; // use for your set of entities ads_point pPoint; // use it for base point acdbUcs2Wcs(pPoint, pPoint, false); // must be in WCS. if you got it by acedGetPoint(), it must be converted. double scaleCoef = 1.0; acedInitGet( RSG_NOZERO | RSG_NONEG,NULL); if (acedGetReal(_T("\nScale coeff: <1.0> "), &scaleCoef) != RTNORM) return; AcGeMatrix3d m; m.setToScaling(scaleCoef,AcGePoint3d(pPoint[X],pPoint[Y],pPoint[Z])); for (int i = 0; i < mas.length(); i++) { AcDbEntity * obj; if (acdbOpenObject(obj,mas.at(i),AcDb::kForWrite) != Acad::eOk) continue; obj->transformBy(m); obj->downgradeOpen(); obj->draw(); obj->close(); }