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?
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