We already discussed quite a few aspects of the Revit 2022 unit handling API and
- Revit 2022 released
- Replacing deprecated ParameterType with ForgeTypeId
- Removal of DisplayUnitType in RevitLookup 2022
- ParameterType and ForgeTypeId in the Revit 2022 SDK and The Building Coder samples
- What's New in the Revit 2022 API
Here are some more related questions that came up since then:
- Revit 2022 unit handling API in Dynamo
- String values for Forge units
- Unit conversion without knowing
- How will we live together?
Before diving into this topic, let us congratulate the China team in their celebration of the Dragon Boat festival today.
- Traditional sport : dragon boating race
- Customary food: Zongzi, a kind of rice dumpling, packaged in bamboo or reed leaves, sweet or salty, even in ice cream (by Starbucks :-)
- Memorials on the sage Qu Yuan, poet and politician, known for his patriotism
- Prayer for health and peace by hanging calamus or mugwort on the door
David Becroft comes to the rescue again answering
the Revit API discussion forum thread
on how to convert
Question: I am trying to port some legacy code to Revit 2022 and I am running into the problem converting some
ParameterType enum values to a
Invalid (the result for
ElementId parameters) are the most pressing ones.
There does not seem to be anything Fixture or Piping related in the
SpecTypeId class that may apply.
PipeDimension comes closest but is not, I think, the same?
Plus, it also exists separately in the ParameterType enum which makes it unlikely that it got a double meaning in Revit 2022.
According to the release documentation there should be a deprecated method in the Parameter class that can help porting ParameterType enum values to ForgeTypeId objects, but Intellisense does not seem to be aware of the existence of such a method.
Answer: These methods are in
In place of
ParameterType.FixtureUnit, you can use
ParameterType.Invalid is equivalent to an empty, default-constructed
Revit 2022 Unit Handling API in Dynamo
Konrad Sobon does a great job explaining how to deal with this in Dyname and Python in his discussion of handling the Revit 2022 unit changes.
String Values for Forge Units
The unit handling changes also affected some Forge apps:
This was discussed and resolved in the StackOverflow question on Autodesk Forge returning odd measurement data
I ended up implementing
ListForgeTypeIds in The Building Coder samples to help resolve the issue.
I also shared this in the discussion on DisplayUnitType in Revit 2022.
Unit Conversion Without Knowing
In a related vein, how can you implement a unit conversion without knowing the internal Revit unit?
This question has been around since the beginnings of The Building Coder and was first addressed in blog post #11 on units in September 2008.
It came up again in the Revit API discussion forum thread on a unit conversion question:
Simply set the value that you are analysing to 1.0 manually through the user interface using your current display units.
Then, use RevitLookup to analyse what value
V actually gets stored.
The ratio between those two values, i.e.,
V, immediately provides the conversion factor from display unit to internal database unit (or v.v.).
How Will We Live Together?
Moving from Revit to the topic of architecture in general, at La Biennale di Venezia, the 17th International Architecture Exhibition is focussed on the theme of How will we live together?
We need a new spatial contract. In the context of widening political divides and growing economic inequalities, we call on architects to imagine spaces in which we can generously live together.
At the biennale, the German pavilion looks back from the future:
2038 is the name of the German Pavilion in the 17th International Architecture Exhibition at Biennale di Venezia. A look back from the future, which the curators envision as a world where many of today’s problems have been overcome. Digital technology makes it possible to visit the pavilion from anywhere in the world: 2038.xyz