lxspine 发表于 2007-3-28 21:24:00

[请问]如何改变UCS?

<p>请问如何改变UCS?我的这个方法没有效果(想改变Z坐标值,其他的值不变):</p><p>void SetNewUCSZ(double Z)<br/>{<br/>&nbsp;acDocManager-&gt;lockDocument(curDoc(),AcAp::kWrite,NULL,NULL,true);</p><p>&nbsp;AcDbViewportTable* pVPTable;<br/>&nbsp;acdbHostApplicationServices()-&gt;workingDatabase() -&gt;getViewportTable(pVPTable,AcDb::kForWrite);</p><p>&nbsp;AcGePoint3d ptOrigin;<br/>&nbsp;AcGeVector3d vecXAxis;<br/>&nbsp;AcGeVector3d vecYAxis;<br/>&nbsp;//获得当前视口记录<br/>&nbsp;AcDbViewportTableRecord *pVPCurrent;<br/>&nbsp;pVPTable-&gt;getAt("*ACTIVE", pVPCurrent, AcDb::kForWrite);</p><p><br/>&nbsp;//改变UCS<br/>&nbsp;pVPCurrent-&gt;getUcs(ptOrigin,vecXAxis,vecYAxis);<br/>&nbsp;ptOrigin.z=Z;<br/>&nbsp;Acad::ErrorStatus aa=pVPCurrent-&gt;setUcs(ptOrigin,vecXAxis,vecYAxis);<br/>&nbsp;pVPCurrent-&gt;close();</p><p>&nbsp;pVPTable-&gt;close();<br/>&nbsp;acDocManager-&gt;unlockDocument(curDoc());</p><p>}</p><p></p>

yinpengji 发表于 2007-12-17 23:30:00

<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-&gt;xAxis()).x;</p><p>mat.entry = (aUcsRecord-&gt;xAxis()).y;</p><p>mat.entry = (aUcsRecord-&gt;xAxis()).z;</p><p>mat.entry = (aUcsRecord-&gt;yAxis()).x;</p><p>mat.entry = (aUcsRecord-&gt;yAxis()).y;</p><p>mat.entry = (aUcsRecord-&gt;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-&gt;xAxis()).x;</p><p>mat.entry = (aUcsRecord-&gt;xAxis()).y;</p><p>mat.entry = (aUcsRecord-&gt;xAxis()).z;</p><p>mat.entry = (aUcsRecord-&gt;yAxis()).x;</p><p>mat.entry = (aUcsRecord-&gt;yAxis()).y;</p><p>mat.entry = (aUcsRecord-&gt;yAxis()).z;<font color="#008000" size="2"></font></p><font size="2"><p>acedSetCurrentUCS(mat);</p></font>
页: [1]
查看完整版本: [请问]如何改变UCS?