ParametersParameters Description const ads_point pt Point to be translated, interpreted as either a three-dimensional point or a three-dimensional displacement vector depending on the value of disp const struct resbuf * from Coordinate system in which pt is expressed const struct resbuf * to Coordinate system in which result is expressed int disp If nonzero, pt is treated as a displacement vector; otherwise, it is treated as a point

ReturnsResult of the translation

DescriptionTranslates a point or a displacement from one coordinate system into another.

The from and to arguments can specify a coordinate system in any of the following ways:

An integer code (restype == RTSHORT) that specifies the WCS, current User Coordinate System (UCS), or current Drawing Coordinate System (DCS) (of either the current viewport or paper space), as described in the following table. An entity name (restype == RTENAME), as returned by one of the entity name or selection set functions. This specifies the ECS of the named entity. For planar entities, the ECS can differ from the WCS. If the ECS does not differ, conversion between ECS and WCS is an identity operation.

A 3D extrusion vector (restype == RT3DPOINT). This is another method of specifying an entity's ECS. Extrusion vectors are always represented in World coordinates; an extrusion vector of (0,0,1) specifies the WCS.

Coordinate system codes:

0 World (WCS) 1 User (current UCS) 2 Display:DCS of current viewport when used with code 0 or 1DCS of current model space viewport when used with code 3 3 Paper space DCS (PSDCS; used only with code 2)

Warning The paper space DCS (PSDCS) can be transformed only to or from the model space DCS. Therefore, if the from argument equals 3, the to argument must equal 2, and conversely.

If acedTrans() succeeds, it returns RTNORM; otherwise, it returns an error code. When acedTrans() fails, it sets the system variable ERRNO to a value that indicates the reason for the failure.

basePoint.TranslateCoordinates looks so useful I just wondered if it could be added as a method to point3d. AcGe.Point3d newp= dbExtensions.TranslateCoordinates(basePoint, dbExtensions.CoOrds.UCS, dbExtensions.CoOrds.WCS); works good, but sometimes I wish the enums could work without prefixing them.

Thanks Kerry !Quite old topic, but very intersting.I was missing a Trans method in .NET (it's so usefull with LISP).

So, to add to the GeomExt I began here, I complete Kerry's code to implement all parameters possibilities (as trans (LISP) or acedTrans).The coordinates systems can be specified as a coordinates system (CoordSystem enum member), an entity (ObjectId) or an extrusion direction (Vector3d).If the disp parameter (int) is specified and other than 0, the point is treated as a vector (displacement).

As it's forbidding coding (18 overloads), I share it, if someones are interseted...