Provides access to the room tag in Autodesk Revit.
Namespace: Autodesk.Revit.DB.ArchitectureAssembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public class RoomTag : SpatialElementTag |
Visual Basic |
---|
Public Class RoomTag _ Inherits SpatialElementTag |
Visual C++ |
---|
public ref class RoomTag : public 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); }

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
System..::..Object
Autodesk.Revit.DB..::..Element
Autodesk.Revit.DB..::..SpatialElementTag
Autodesk.Revit.DB.Architecture..::..RoomTag
Autodesk.Revit.DB..::..Element
Autodesk.Revit.DB..::..SpatialElementTag
Autodesk.Revit.DB.Architecture..::..RoomTag