sharksun 发表于 2004-6-13 16:08:00

[求助]用户坐标问题(不好意思,同样的问题问过一次)

<TABLE class=tableborder1 style="WIDTH: 90%" cellSpacing=1 cellPadding=5>
<TBODY>
<TR>
<TD class=tablebody1>
<HR>
</TD></TR></TBODY></TABLE><BR>



大家都用代码画过这样的图吧,不知道如何做能方便些。


如果用转换矩阵的话,那还不如现在世界坐标下话,画完之后全部选择或者形成块,再move到合适的位置。

sharksun 发表于 2004-6-13 17:11:00

问题时这样的:


我要画一个平面的三视图,为了画图方便,需要定义3个用户坐标。有没有方便的方法呢?就像转到一个用户坐标中后,直接可以在里面画?

雪山飞狐_lzh 发表于 2004-6-13 17:16:00

本帖最后由 作者 于 2004-6-13 23:13:55 编辑 <br /><br /> 用transformby方法



<P class=Heading-2>Signature
<P class=syntax>RetVal = object.TranslateCoordinates(OriginalPoint, From, To, Disp[, OCSNormal])
<P class=element>Object


<P class=element-desc><A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_utility_object.htm" target="_blank" >Utility</A><BR>The object or objects this method applies to.
<P class=element>OriginalPoint


<P class=element-desc>Variant (three-element array of doubles); input-only<BR>The 3D WCS coordinates specifying the original coordinates to be translated. This parameter can be treated as a point or a displacement vector depending on the value of Disp.
<P class=element>From


<P class=element-desc>AcCoordinateSystem enum; input-only<BR>The coordinate system from which the point originates.
<P class=Constant>acWorld
<P class=Constant>acUCS
<P class=Constant>acOCS
<P class=Constant>acDisplayDCS
<P class=Constant-Last>acPaperSpaceDCS
<P class=element>To


<P class=element-desc>AcCoordinateSystem enum; input-only<BR>The coordinate system to which the point will be converted.
<P class=Constant>acWorld
<P class=Constant>acUCS
<P class=Constant>acOCS
<P class=Constant>acDisplayDCS
<P class=Constant-Last>acPaperSpaceDCS
<P class=element>Disp


<P class=element-desc>Integer; input-only<BR>A displacement vector flag.
<P class=Constant>TRUE: OriginalPoint is treated as a displacement vector.
<P class=Constant>FALSE: OriginalPoint is treated as a point.
<P class=element>OCSNormal


<P class=element-desc>Variant (three-element array of doubles); input-only;optional<BR>The normal for the OCS.
<P class=element>RetVal


<P class=element-desc>Variant (three-element array of doubles)<BR>The translated 3D coordinate.
<P class=Heading-2>Remarks
<P class=body>You cannot directly translate a coordinate from one OCS to another OCS. To do this, first translate the coordinate from one OCS to an intermediary coordinate system such as the WCS. Then translate that coordinate into the second OCS.
<P class=body>To translate a point on a <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_polyline_object.htm" target="_blank" >Polyline</A> or <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_lightweightpolyline_object.htm" target="_blank" >LightWeightPolyline</A> object from OCS to WCS:
<P class=body>1. Get the X and Y coordinates of the OCS point from the <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_coordinate.htm" target="_blank" >Coordinate</A> or <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_coordinates.htm" target="_blank" >Coordinates</A> property.
<P class=body>2. Get the Z coordinate of the OCS point from the <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_elevation.htm" target="_blank" >Elevation</A> property.
<P class=body>3. Get the Normal for the polyline from the <A href="mk:@MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_normal.htm" target="_blank" >Normal</A> property.
<P class=body>4. Call TranslateCoordinates using the X, Y, Z coordinates and the Normal.
<P class=body>

sharksun 发表于 2004-6-15 08:30:00

谢谢飞狐兄弟。


我的意思是先转换到用户坐标,然后直接在里面作图。不是说先在世界坐标里把图做好,在转换到用户坐标里。如果这样的话,那还不如画好,再移动了。

雪山飞狐_lzh 发表于 2004-6-15 12:43:00

转换到用户坐标,然后直接在里面作图,在VBA里是做不到的

sharksun 发表于 2004-6-15 23:47:00

明白了。


多谢。
页: [1]
查看完整版本: [求助]用户坐标问题(不好意思,同样的问题问过一次)