Digging into this again 10+ Years later…Particularly I am automating solutions to the Cluster of issues around multiple parameters named the same with different GUIDs.
Is it correct that there’s no reliable way to manage the definitions of non-shared Project Parameters or Global Parameters through the Revit API?
I’m developing a parameter manager and exploring how to programmatically add, remove, and organize parameters. are Project Parameters and Global Parameters inaccessible in the API?
Also, This is particularly frustrating; am I missing something-or is the GUID for Shared Parameters no longer accessible once they’re added to a project? I can work with it but - why is this happening?
Do Family Parameters behave the same way as the project parameters where the GUID becomes unavailable after loading?? Surely they cannot as I have projects with 10x “Door” parameters in them- so there must be some mechanism there to ID the different “Door” in each family.
Not sure what all you are trying to do exactly, but reading through this it seems like there may be some gap understanding the difference between Shared and Project parameters, their definitions and what they are intended to be used for.
If you take question #4 as an example, Family Parameters are handled differently through the FamilyManager class. However, if they are Shared then they will in fact have the same GUID because that is how they are shared and used between the two different environments.
However, if there are Family parameters that are not shared, then they will not understand the existence or values from another family with a parameter of the same name. Generally, this is why nested families with labels don’t hold values if you don’t use shared parameters.
#1: Project Parameters cannot be created, it must be a shared parameter. However, the API does have access to assigning them to different categories. However, that is done with Parameter Bindings property of the Document Class and not the parameter itself.
#2: Depends on what you mean by “inaccessible”. There are some things you can do and others you cannot. Parameters Parameter Definition
#3: Yes, the GUID is accessible after the fact, as long as you are getting the correct thing.
OUT = [[x.GetDefinition().Name,x.Id,x.GuidValue,doc.ParameterBindings.get_Item(x.GetDefinition())] for x in FilteredElementCollector(doc).OfClass(SharedParameterElement)]
I am digging in VIA ZeroTouchNodes (ZTN), finding all these things which definitely are gaps in my knowledge of the inner workings. I have two primary ZTNs - currently working through the project parameters one. We have a mess with all the varied parameters (named the same) I am trying to resolve programmatically because previous teams didn’t understand why they should use nor the value of shared parameters.
Q#4 - It makes sense the shared params would show the same in the project from different families.
Q#1- yes this is mind blowing and I almost wish we couldn’t create project parameters. I wanted to delete these out of projects or potentially map them to shared parameters but that seems inaccessible.
Q2- Delete and or replace.
Q#3- Thanks for that! I will try it next. I.e. I should be able to look up Project parameters created from shared parameters to each e.g. the “Door” in the project I am looking for is indeed the “Door” with GUID xxx from my shared params file. I’ve created a way to lock the GUID based on the param name so that is 100% consistent, so if I can reframe rogue params I should be able to gain 100% consistency in my data structures.