RVTDocs.com

RoomTag

Class
Description:
Provides access to the room tag in Autodesk Revit.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.Element
    Autodesk.Revit.DB.SpatialElementTag
      Autodesk.Revit.DB.Architecture.RoomTag
Syntax
public class RoomTag : SpatialElementTag
Examples
private void Getinfo_RoomTag(RoomTag roomTag)
{
    string message = "Room Tag : ";
    //get the location of the roomtag
    LocationPoint location = roomTag.Location as LocationPoint;
    XYZ point = location.Point;
    message += "\nRoomTag location: (" + point.X + ", " +
                   point.Y + ", " + point.Z + ")";

    //get the name of the roomTag
    message += "\nName: " + roomTag.Name;

    //get the room that the tag is associated with
    Room room = roomTag.Room;
    message += "\nThe number of the room is : " + room.Number;

    //get the view in which the tag is placed
    Autodesk.Revit.DB.View view = roomTag.View;
    if (null != view)
    {
        message += "\nView Name: " + view.Name;
    }
    TaskDialog.Show("Revit",message);
}