几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[请问]如何改变ucs? (http://www.dimcax.com/hust/showthread.php?t=7035)

yang686526 2009-04-16 06:37 PM

【转帖】[请问]如何改变ucs?
 
[请问]如何改变ucs?
[请问]如何改变ucs?
请问如何改变ucs?我的这个方法没有效果(想改变z坐标值,其他的值不变):
void setnewucsz(double z)
{
acdocmanager->lockdocument(curdoc(),acap::kwrite,null,null,true);
acdbviewporttable* pvptable;
acdbhostapplicationservices()->workingdatabase() ->getviewporttable(pvptable,acdb::kforwrite);
acgepoint3d ptorigin;
acgevector3d vecxaxis;
acgevector3d vecyaxis;
//获得当前视口记录
acdbviewporttablerecord *pvpcurrent;
pvptable->getat("*active", pvpcurrent, acdb::kforwrite);
//改变ucs
pvpcurrent->getucs(ptorigin,vecxaxis,vecyaxis);
ptorigin.z=z;
acad::errorstatus aa=pvpcurrent->setucs(ptorigin,vecxaxis,vecyaxis);
pvpcurrent->close();
pvptable->close();
acdocmanager->unlockdocument(curdoc());
}
用acedsetcurrentucs();来设置
acgematrix3d mat;
mat.entry[0][0] = (aucsrecord->xaxis()).x;
mat.entry[1][0] = (aucsrecord->xaxis()).y;
mat.entry[2][0] = (aucsrecord->xaxis()).z;
mat.entry[0][1] = (aucsrecord->yaxis()).x;
mat.entry[1][1] = (aucsrecord->yaxis()).y;
mat.entry[2][1] = (aucsrecord->yaxis()).z;
acedsetcurrentucs(mat);
mat.entry[0][0] = (aucsrecord->xaxis()).x;
mat.entry[1][0] = (aucsrecord->xaxis()).y;
mat.entry[2][0] = (aucsrecord->xaxis()).z;
mat.entry[0][1] = (aucsrecord->yaxis()).x;
mat.entry[1][1] = (aucsrecord->yaxis()).y;
mat.entry[2][1] = (aucsrecord->yaxis()).z;
acedsetcurrentucs(mat);


所有的时间均为北京时间。 现在的时间是 07:25 AM.