How to read Revit API?

Hello,

I have a code that works, but just copy/pasted it from everywhere in the forum

this page has just vocabulary but no sentence at all

room = UnwrapElement(IN[0])

uid = UnitTypeId.Millimeters
roomheight = room.get_Parameter(BuiltInParameter.ROOM_HEIGHT ).AsDouble()
converted = UnitUtils.ConvertFromInternalUnits(roomheight, uid)  #How to use that  DUT_METERS_CENTIMETERS 

OUT = roomheight, converted

I found on the page my Units (capital letters) how do i use this vocabulary ? finaly i pasted a solution from anywhere

f.e. how do i deal with ROOM_VOLUME is it than UnitTypeId.Cubicmeters or DUT_CUBIC_METERS ?

I added the emphasis around **uid** as that is the first clue. Since this is a variable, we can scroll back in your code too find where it was defined:

And we get this. From here we can try swapping out the Millimeters bit for other unit types listed on the page you linked.

3 Likes

Like that

1 Like

check Revit API document

1 Like