本帖最后由 作者 于 2004-6-13 23:13:55 编辑
用transformby方法
或
Signature
RetVal = object.TranslateCoordinates(OriginalPoint, From, To, Disp[, OCSNormal])
Object
MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_utility_object.htm" target="_blank" >Utility The object or objects this method applies to.
OriginalPoint
Variant (three-element array of doubles); input-only 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.
From
AcCoordinateSystem enum; input-only The coordinate system from which the point originates.
acWorld
acUCS
acOCS
acDisplayDCS
acPaperSpaceDCS
To
AcCoordinateSystem enum; input-only The coordinate system to which the point will be converted.
acWorld
acUCS
acOCS
acDisplayDCS
acPaperSpaceDCS
Disp
Integer; input-only A displacement vector flag.
TRUE: OriginalPoint is treated as a displacement vector.
FALSE: OriginalPoint is treated as a point.
OCSNormal
Variant (three-element array of doubles); input-only;optional The normal for the OCS.
RetVal
Variant (three-element array of doubles) The translated 3D coordinate.
Remarks
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.
To translate a point on a MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_polyline_object.htm" target="_blank" >Polyline or MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_lightweightpolyline_object.htm" target="_blank" >LightWeightPolyline object from OCS to WCS:
1. Get the X and Y coordinates of the OCS point from the MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_coordinate.htm" target="_blank" >Coordinate or MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_coordinates.htm" target="_blank" >Coordinates property.
2. Get the Z coordinate of the OCS point from the MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_elevation.htm" target="_blank" >Elevation property.
3. Get the Normal for the polyline from the MSITStore:D:\Program%20Files\AutoCAD%202005\help\acadauto.chm::/idh_normal.htm" target="_blank" >Normal property.
4. Call TranslateCoordinates using the X, Y, Z coordinates and the Normal.
|