I don’t usually revive older threads in forums but as I was searching for a way to convert project units from one system to another when I came across this thread. I’m curious about the 2 Python Script boxes in the image John posted. I have to admit that I’m still fairly new at Dynamo and my Python & Revit API knowledge is really basic and I just started a Python tutorial a couple nights ago. Now I was able to somewhat replicate a result similar to the result in the first box but that is about as much as I can figure out.
…and here is my very basic code! haha.
from Autodesk.Revit.DB import *
result = FormatOptions()
#Assign your output to the OUT variable.
OUT = result
I realize that I’m probably not even close but I was just trying random stuff from looking up things to do with units in the 2016 API document.
I would like to learn how to do what John’s scripts are doing to retrieve the project units information. Hopefully as I get through the tutorial I’ll have a better understanding of how this was done. I don’t want to be a “take the code and run” kind of guy, but if someone is able to offer an explanation of some kind as to what is happening in the two scripts it would be appreciated. Sort of along the lines of “you need to do such such in a loop” or someting like that, hopefully you get my meaning.