Handle Category Name Change

Here is a little note I wrote sitting in Washington Dulles airport and did not get around to posting until now, to point out the importance of using language independent category comparisons:

Question: Apparently at least one category name changed in the German version of Revit from 2009 to 2010:

  • Revit 2009: “Tragende Stützen”
  • Revit 2010: “Tragwerksstützen”

We rely on category names for mapping purposes.
In this case we discovered the change that was causing problems for us, but I am worried that there may be other similar changes that I also need to be aware of.
Is there any way to use a language independent identifier that will never change?
I very much hope to find a way to identify categories in a language independent fashion.

Answer: You can use the built-in category enumeration to make your code language independent when working with categories.
We looked at this and related topics in the discussions on

category comparison
and
later explored it further for the

model element selection
,
which we recently enhanced to

handle a set of multiple categories
using
a list of built-in category enumeration values stored in _bics_to_skip and the helper method SkipThisBic to compare them all with a given value from a candidate element.


Comments

2 responses to “Handle Category Name Change”

  1. Hi Jeremy,
    additionally, not only category but also parameter names may change between the years, perhaps you could add the image I’ve sent you some days ago.
    Of course we could use BuiltInParameter enum, which is definitely the better way because of language-independed access.
    Best regards,
    Rudolf

  2. Dear Rudolf,
    Thank you for the reminder and suggestion.
    I cannot update old posts, simply due to time contraints. I prefer adding new ones instead.
    Everything is always in flux, and it is impossible to keep all old posts up to date forever.
    Best regards from the 62nd floor overlooking the desert of Las Vegas!
    Cheers, Jeremy.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading