RoomTag Class


Provides access to the room tag in Autodesk Revit.

Namespace: Autodesk.Revit.DB.Architecture
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)

Syntax

C#
public class RoomTag : SpatialElementTag
Visual Basic
Public Class RoomTag _
	Inherits SpatialElementTag
Visual C++
public ref class RoomTag : public SpatialElementTag

Examples

Copy C#
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);
}
Copy VB.NET
Private Sub Getinfo_RoomTag(roomTag As RoomTag)
    Dim message As String = "Room Tag : "
    'get the location of the roomtag
    Dim location As LocationPoint = TryCast(roomTag.Location, LocationPoint)
    Dim point As XYZ = location.Point
    message += ((vbLf & "RoomTag location: (" + point.X & ", ") + point.Y & ", ") + point.Z & ")"

    'get the name of the roomTag
    message += vbLf & "Name: " & Convert.ToString(roomTag.Name)

    'get the room that the tag is associated with
    Dim room As Room = roomTag.Room
    message += vbLf & "The number of the room is : " + room.Number

    'get the view in which the tag is placed
    Dim view As Autodesk.Revit.DB.View = roomTag.View
    If view IsNot Nothing Then
        message += vbLf & "View Name: " + view.Name
    End If
    TaskDialog.Show("Revit", message)
End Sub

Inheritance Hierarchy

See Also

ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →