Hello all,
I am attempting to query all of the display units in this Revit file (Length = Feet and Fractional inches, Area = Sq. Ft.). I’ve found a node from GeniusLoci that outputs all of the Unit Types and a python script to get the display units, but for one unit type. The issue I assume I’m running into is a conversion error. Here is a screengrab of my graph and my python script.
Cheers,
import clr
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
app = DocumentManager.Instance.CurrentUIApplication.Application
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitAPI")
from Autodesk.Revit.DB import *
clr.AddReference("RevitAPIUI")
from Autodesk.Revit.UI import *
import System
from System.Collections.Generic import *
# The inputs to this node will be stored as a list in the IN variables.
unT = UnwrapElement(IN[0])
result = []
# Place your code below this line
for i in unT:
cool = Document.GetUnits(doc).GetFormatOptions(UnitType.i).DisplayUnits
result.append(cool)
# Assign your output to the OUT variable.
OUT = result