Transform Class

A transformation of the affine 3-space.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.DBAPIObject
    Autodesk.Revit.DBTransform

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class Transform : APIObject

The Transform type exposes the following members.

Constructors
 NameDescription
Public methodTransformThe copy constructor.
Top
Properties
 NameDescription
Public propertyBasisDefines the basis of the old coordinate system in the new coordinate system.
Public propertyBasisXThe basis of the X axis of this transformation.
Public propertyBasisYThe basis of the Y axis of this transformation.
Public propertyBasisZThe basis of the Z axis of this transformation.
Public propertyDeterminantThe determinant of this transformation.
Public propertyHasReflectionThe boolean value that indicates whether this transformation produces reflection.
Public propertyStatic memberIdentityThe identity transformation.
Public propertyInverseThe inverse transformation of this transformation.
Public propertyIsConformalThe boolean value that indicates whether this transformation is conformal.
Public propertyIsIdentityThe boolean value that indicates whether this transformation is an identity.
Public propertyCode exampleIsReadOnlyIdentifies if the object is read-only or modifiable.
(Inherited from APIObject)
Public propertyIsTranslationThe boolean value that indicates whether this transformation is a translation.
Public propertyOriginDefines the origin of the old coordinate system in the new coordinate system.
Public propertyScaleThe real number that represents the scale of the transformation.
Top
Methods
 NameDescription
Public methodAlmostEqualDetermines whether this transformation and the specified transformation are the same within the tolerance (1.0e-09).
Public methodStatic memberCode exampleCreateReflection Creates a transform that represents a reflection across the given plane.
Public methodStatic memberCreateRotation Creates a transform that represents a rotation about the given axis at (0, 0, 0).
Public methodStatic memberCreateRotationAtPoint Creates a transform that represents a rotation about the given axis at the specified point.
Public methodStatic memberCreateTranslation Creates a transform that represents a translation via the specified vector.
Public methodDisposeCauses the object to release immediately any resources it may be utilizing.
(Inherited from APIObject)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodMultiplyMultiplies this transformation by the specified transformation and returns the result.
Public methodOfPointApplies the transformation to the point and returns the result.
Public methodOfVectorApplies the transform to the vector
Public methodScaleBasisScales the basis vectors of this transformation and returns the result.
Public methodScaleBasisAndOriginScales the basis vectors and the origin of this transformation and returns the result.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Operators
 NameDescription
Public operatorStatic memberMultiply(Transform, Transform)Multiplies the two specified transforms.
Top
Example
public static XYZ TransformPoint(XYZ point, Transform transform)
{
    double x = point.X;
    double y = point.Y;
    double z = point.Z;

    //transform basis of the old coordinate system in the new coordinate // system
    XYZ b0 = transform.get_Basis(0);
    XYZ b1 = transform.get_Basis(1);
    XYZ b2 = transform.get_Basis(2);
    XYZ origin = transform.Origin;

    //transform the origin of the old coordinate system in the new 
    //coordinate system
    double xTemp = x * b0.X + y * b1.X + z * b2.X + origin.X;
    double yTemp = x * b0.Y + y * b1.Y + z * b2.Y + origin.Y;
    double zTemp = x * b0.Z + y * b1.Z + z * b2.Z + origin.Z;

    return new XYZ(xTemp, yTemp, zTemp);
}
See Also