Hello everyone,
A node ‘GetParameterValueByName’ returns inconsistent data types - which makes totally no sense to me - so the question to you guys is if anyone has any idea why this happens?
Here’s the case:
I tried to get the parameter ‘Phase’ from rooms, quite a straightforward task, but the results are quite unexpected - one of the phases (called PhaseAAA, Id=0) is a string, while other phases (PhaseBBB, Existing) are elements. Why this happens? Has it anything to do with ID of this phase which equals 0? I tried hard to google anything, but unsuccessfully.
I look forward to a nice brainstorming, any ideas are very welcome.
Thank you!
MB
A Revit file needs at least one Phase, perhaps that’s the one BuildIn
This was a known issue in previous versions (not sure if it was specifically targeted in a fix or just kinda disappeared on its own).
If I remember correctly, some of the custom nodes specifically dealing with phases returned consistent object types, but you can always use the API.
Thank you both for your response!
@Marcel_Rijsmus
I’m not sure if this phase (PhaseAAA Id=0) is buit-in, as it wasn’t me who established the model.
What is interesting, if I start a new model with project template , there is no such issue with string/element in dynamo, all phases are elements and it is consistent. What is more, in a project started with template, Id=0 is not a phase but ‘Project Phase Information’ and the first built-in phase is Id=1. I have a gut feeling it may be relevant. Please find the snipshot below.
@Nick_Boyts
You’re right, a node ‘Collect.Phases’ from Crumple seems to return consistent data type - snipshot below.
I’m not quite familiar (yet) with Revit API. I guess I would need a python code in a dynamo node? Could you give me more clues how could I get phases of rooms by use of API?
It’s Revit 2022, I forgot to mention it earlier.
If you have the Crumple node then no need to get into the API yet. Phases as an object are a bit more difficult than I recommend for a first venture into that space. You can however open up the crumple node to see how it was built and explore that, but again it’ll be easier to just use that as is.
Double check that you’re in the latest build of 2022 just to be sure there isn’t an update missing that fixes your original issue.
Hi @jacob.small
My Revit version is:
22.1.50.17
20230915_1530(x64)
2022.1.5
which I guess is not the latest.
However, I think Revit version doesn’t matter here, as I tried upgrading the model to Revit 2023 and I ran this dynamo script again - results are the same, both string and object are returned.
Thank you all for your response. I’ll try to play with API/python later and let you know later if I find out anything.