Surely there is a ‘simple’ answer, but why would some of my Revit Rooms report a “Phase Id” and some only a “Phase” (Name)?
In the below example I am looking up “Phase” and some Rooms give me their “Phase Element Id” and some return the actual Phase Name. If I change the input from Phase to Phase Id the “Phase 4 - Rooms” report “Null”.
@Joelmick thanks. Unfortunately I am not at liberty to share the model. It’s one of our office’s projects and I am not able to share this project file without permission from the client.
With regards to the Graph, there is not much to it aside from what I shared above:
Can you share part of the model? If not, I understand, but I cannot reproduce your problem. Which phases do you have in the model? In which order? What happends with the building (are rooms divided or merged in a certain phase?)
@SeanP thanks. Took me a while to check, but it doesn’t look like. I checked the rooms and actually none are in Groups nor in Design Options. There are however Design Options in the model.
I checked a few other things, but none seems to explain this behaviour. Some rooms are entirely bound by elements from linked files but again, that’s not true for all. Some rooms in question are “not placed”, but others are.
I can’t help but think that it might have something todo with how the Phase was created - but that’s a beginner’s guess.
Ok, a colleague of mine (Thank you Andrew) found actually the answer and solution:
For whatever reason the Element Id of Phase 4 is “0” as this little test demonstrates:
We thought we could fix it by adding a new phase ‘after’ Phase 4 and then merging it. We thought that would give it a new ID, but for whatever reason that didn’t work. Maybe I merged them the wrong way around? I merged the new Phase with Phase 4. I should probably have merged Phase 4 with the new one.
However, he gave me also a tip for a workaround that works for me:
We can use Parameter.ParameterByName instead of Elment.GetParameterValueByName and use String.Remove to remove "Phase : " from the results.
I still have no idea what is causing that Phase’s Id to report as “0” though.