高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】[请问]如何改变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);
|