Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynamoRevit 2.x Categories Dropdown Produces Inconsistent Results Between Revit versions #2281

Closed
dimven opened this issue Dec 5, 2018 · 7 comments · Fixed by DynamoDS/Dynamo#9367

Comments

@dimven
Copy link
Contributor

dimven commented Dec 5, 2018

If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.

Dynamo version

2.x

Revit version

Any two recent versions of Revit, e.g. 2018 and 2019

Operating system

Windows 10

What did you do?

Steps to reproduce:

  • start a 2.0 graph in Revit 2018
  • Place a Categories node and choose Walls from the dropdown
  • save the graph
  • open Revit 2019
  • load the graph
  • the Categories node now points to something totally differeny

What did you expect to see?

The exact same category selection between versions

What did you see instead?

Something else

This happens because the dropdown is serialized as just and index integer in the JSON, where as built-in categories are not static between Revit versions.

I imagine one way to solve this is to store the current selection as both a string and an index.

@QilongTang
Copy link
Contributor

@dimven Good suggestion!

@AndyDu1985 @ZiyunShang @BogdanZavu @sm6srw Looking for your suggestion here, let's assume the index for all categories will always change, should we override the category dropdown to serialize the category name or element id whichever is more stable?

@dimven
Copy link
Contributor Author

dimven commented Dec 5, 2018

@andydandy74 just pointed out to me that this is a regression:
DynamoDS/Dynamo#3055

@andydandy74
Copy link

Category name is not going to work across revit localizations. Use built in category name instead.

@andydandy74
Copy link

By the way - the Element Types node behaves the same way between Revit versions.

@dobriai
Copy link

dobriai commented Dec 11, 2018

@QilongTang Yes, as far as Categories go, the stable thing is the built-in ID and this is what should be serialized.
In general, for dropdowns, you want to remember built-in ids, when possible. For user-created stuff, of course, ids are no good - so there you remember strings, most likely. I am not sure how many dropdowns there are out there that fill up with user-created items, but Family Types are one such case. Materials another. Well types are also user-created.

@dobriai
Copy link

dobriai commented Dec 13, 2018

It is worse than just "inconsistent between versions". It is impossible now to even localize scripts for the same version, as lists are sorted in each language, so the index means nothing.
With the old, 1.3 XML format, things were not rosy either, but there at least the name was serialized, which could be translated for the target language.

@QilongTang
Copy link
Contributor

Closing. This should be fixed in the coming DynamoCore + DynamoRevit 2.1.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants