AreaVolumeSettingsComputeVolumes Property |
True to enable volume computation. False to disable it.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic bool ComputeVolumes { get; set; }
Public Property ComputeVolumes As Boolean
Get
Set
public:
property bool ComputeVolumes {
bool get ();
void set (bool value);
}
member ComputeVolumes : bool with get, set
Property Value
Boolean
Remarks
When this setting is False, rooms and spaces will be treated as simple extrusions of their 2d boundaries.
The volume parameter will report "not computed".
When this setting is True, the geometry of rooms and spaces will be trimmed
when it intersects elements such as ceilings, roofs, and floors.
Examplepublic void GetRoomDimensions(Document doc, Room room)
{
String roominfo = "Room dimensions:\n";
using (Transaction t = new Transaction(doc, "Turn on volume calculation"))
{
t.Start();
AreaVolumeSettings settings = AreaVolumeSettings.GetAreaVolumeSettings(doc);
settings.ComputeVolumes = true;
t.Commit();
}
roominfo += "Vol: " + room.Volume + "\n";
roominfo += "Area: " + room.Area + "\n";
roominfo += "Perimeter: " + room.Perimeter + "\n";
roominfo += "Unbounded height: " + room.UnboundedHeight + "\n";
TaskDialog.Show("Revit",roominfo);
}
Public Sub GetRoomDimensions(doc As Document, room As Room)
Dim roominfo As [String] = "Room dimensions:" & vbLf
Using t As New Transaction(doc, "Turn on volume calculation")
t.Start()
Dim settings As AreaVolumeSettings = AreaVolumeSettings.GetAreaVolumeSettings(doc)
settings.ComputeVolumes = True
t.Commit()
End Using
roominfo += "Vol: " & Convert.ToString(room.Volume) & vbLf
roominfo += "Area: " & Convert.ToString(room.Area) & vbLf
roominfo += "Perimeter: " & Convert.ToString(room.Perimeter) & vbLf
roominfo += "Unbounded height: " & Convert.ToString(room.UnboundedHeight) & vbLf
TaskDialog.Show("Revit", roominfo)
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also