[请问]如何改变UCS?
<p>请问如何改变UCS?我的这个方法没有效果(想改变Z坐标值,其他的值不变):</p><p>void SetNewUCSZ(double Z)<br/>{<br/> acDocManager->lockDocument(curDoc(),AcAp::kWrite,NULL,NULL,true);</p><p> AcDbViewportTable* pVPTable;<br/> acdbHostApplicationServices()->workingDatabase() ->getViewportTable(pVPTable,AcDb::kForWrite);</p><p> AcGePoint3d ptOrigin;<br/> AcGeVector3d vecXAxis;<br/> AcGeVector3d vecYAxis;<br/> //获得当前视口记录<br/> AcDbViewportTableRecord *pVPCurrent;<br/> pVPTable->getAt("*ACTIVE", pVPCurrent, AcDb::kForWrite);</p><p><br/> //改变UCS<br/> pVPCurrent->getUcs(ptOrigin,vecXAxis,vecYAxis);<br/> ptOrigin.z=Z;<br/> Acad::ErrorStatus aa=pVPCurrent->setUcs(ptOrigin,vecXAxis,vecYAxis);<br/> pVPCurrent->close();</p><p> pVPTable->close();<br/> acDocManager->unlockDocument(curDoc());</p><p>}</p><p></p> <p>用<font size="2">acedSetCurrentUCS();来设置</font></p><p><font size="2"><font size="2">AcGeMatrix3d mat;</font><font size="2"><p></p><p>mat.entry = (aUcsRecord->xAxis()).x;</p><p>mat.entry = (aUcsRecord->xAxis()).y;</p><p>mat.entry = (aUcsRecord->xAxis()).z;</p><p>mat.entry = (aUcsRecord->yAxis()).x;</p><p>mat.entry = (aUcsRecord->yAxis()).y;</p><p>mat.entry = (aUcsRecord->yAxis()).z;<font color="#008000" size="2"></font></p></font><font color="#008000" size="2"></font><font size="2"><p>acedSetCurrentUCS(mat);</p></font></font></p><p></p><p>mat.entry = (aUcsRecord->xAxis()).x;</p><p>mat.entry = (aUcsRecord->xAxis()).y;</p><p>mat.entry = (aUcsRecord->xAxis()).z;</p><p>mat.entry = (aUcsRecord->yAxis()).x;</p><p>mat.entry = (aUcsRecord->yAxis()).y;</p><p>mat.entry = (aUcsRecord->yAxis()).z;<font color="#008000" size="2"></font></p><font size="2"><p>acedSetCurrentUCS(mat);</p></font>
页:
[1]