Volume Computations

Hello all,

I am trying to enable and disable the Volume Computations in a Revit project. I found something on the Building Coder but I cannot find anything in the API. The code also seems different than most of the code I have seen from the API. Has anyone accomplished this or have any more information?

https://thebuildingcoder.typepad.com/blog/2009/06/volume-computation-enable.html

Here is the reference on API Docs.
http://www.revitapidocs.com/2015/254e3348-0153-b766-b45c-cfcbc9f52d72.htm

1 Like

This should work.

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument
#The inputs to this node will be stored as a list in the IN variables.
results = []

TransactionManager.Instance.EnsureInTransaction(doc)

settings = AreaVolumeSettings.GetAreaVolumeSettings(doc)
try:
	settings.ComputeVolumes = True
	results.append(True)
except:
	results.append(False)
TransactionManager.Instance.TransactionTaskDone()
#Assign your output to the OUT variable.
OUT = results
2 Likes

Sean that works perfectly. Thank you so much for your help.

Great to hear. Please mark the post a resolved.