Update Project Parameters

Update Project Parameters

Nairda015
Contributor Contributor
1,604 Views
3 Replies
Message 1 of 4

Update Project Parameters

Nairda015
Contributor
Contributor

Hello 

I'm trying to update project parameters.

Nairda015_1-1628250086310.png

I have problems with updating Name and ParameterType
for example I want to change “Acces” to “Access” or Text to YesNo

Following code returns true and updates BuiltInCategories and BuiltInParameterGroup but Name and ParameterType stays the same. 

 

InstanceBinding instance = _app.Create.NewInstanceBinding(parameter.CategorySet);

var result = _doc.ParameterBindings.ReInsert(parameter.ExternalDefinition, instance, parameter.BuiltInParameterGroup);


Is there any way to work around this problem?
*I'm getting data from the SharedParameters file and uploading this file isn't a problem.

 

0 Likes
Accepted solutions (1)
1,605 Views
3 Replies
Replies (3)
Message 2 of 4

RPTHOMAS108
Mentor
Mentor

I'm not clear, is the shared parameter you are replacing with an entirely new one with new GUID?

 

Otherwise as in the UI the name and parameter type can't be changed once such a parameter has been created.  ReInsert would not be appropriate for an entirely new parameter i.e. what makes the existing definition the definition being replaced.

 

ReInsert is mainly for changing associated category set however it still has implications for  Definition.VariesAcrossGroups (seemingly not maintaining the state of such).

0 Likes
Message 3 of 4

Nairda015
Contributor
Contributor
Guid do not change. I dont want parameters with duplikatem names.
So I should somehow delete old parameter and replice it? It will work with
this same Guid? I dont get it why updating name is so difficult…
0 Likes
Message 4 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

You likely have to replace the parameter the way similar to UI (new GUID).

 

I have a vague recollection that when you try renaming in the UI i.e. changing the name in the sp file remove the old one in the project and add the new one it still uses the previous name associated with that GUID. If you've not used it then that is a different story obviously.

 

You can change the group because that isn't anything that is stored outside the project in the shared parameter file. The idea is Revit can't know how those parameter definitions were used in other projects/families so it treats them as things that are unchangeable at the point of creation.

 

I've said previously we could do away with the GUID and just use a combination of Name and Parameter Type for the key to use in terms of what makes a parameter the same parameter. 

0 Likes