2024 Class
Changes 0
C

LocationPoint

Description:
Provides location functionality for all elements that have a single insertion point.
Remarks:
The location point objects adds additional functionality to its base location object class. This includes setting the elements location to a specific point and retrieving its rotation around its insertion point. Inplace families do not have a single insertion point and therefore do not have meaningful LocationPoint data.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.APIObject
    Autodesk.Revit.DB.Location
      Autodesk.Revit.DB.LocationPoint
public class LocationPoint : Location
void LocationInformation(LocationPoint position)
{
    String prompt = "The selected column location information:";
    prompt += "\nPoint:  (" + position.Point.X + ", "
            + position.Point.Y + ", " + position.Point.Z + ")";
    prompt += "\nRotation: " + position.Rotation;

    TaskDialog.Show("Revit",prompt);
}

bool LocationRotate(Autodesk.Revit.ApplicationServices.Application application, Autodesk.Revit.DB.Element element)
{
    bool rotated = false;
    LocationPoint location = element.Location as LocationPoint;

    if (null != location)
    {
        XYZ aa = location.Point;
        XYZ cc = new XYZ(aa.X, aa.Y, aa.Z + 10);
        Line axis = Line.CreateBound(aa,cc);
        rotated = location.Rotate(axis, Math.PI / 2.0);
    }

    return rotated;
}
Name Return Type Description Inherited From
M Dispose() None Causes the object to release immediately any resources it may be utilizing. APIObject
M Move(XYZ) bool Move the element within the project by a specified vector. Location
M Rotate(Line, Double) bool Rotate the element within the project by a specified angle around a given axis. Location
Name Return Type Description Inherited From
P Point XYZ The physical location of the element.
P Rotation double The angle of rotation around the insertion point, in radians.
P IsReadOnly bool Identifies if the object is read-only or modifiable. APIObject