Replace Shared Parameters

Replace Shared Parameters

Anonymous
Not applicable
4,486 Views
12 Replies
Message 1 of 13

Replace Shared Parameters

Anonymous
Not applicable

Hi everyone,

 

First post here, nice to meet you all!

 

Here is my issue: I have a model where I uploaded an initial set of Shared Parameters that I am using as project parameters.

Now, the BIM coordinators gave us a new set of Shared Parameters and some of them are supposed to be substituting the old ones. They want us to get rid of the old ones and replace them with the new ones.

 

Now, I am aware that it's not possible in Revit to rename Project Parameters that come from Shared Parameters, so what I tried to do is to delete the old ones and then load the new ones. Inexplicably, when I load the new Project Parameter that should replace the old one, it takes the name of the old one!

 

Here some images to show you what happens:

(For clarity GS EQUIPMENT-ID is the new parameter, while GSSE-S2-EQUIPMENT-ID is the old one)

ProjectParam.PNGSP.PNGEQUIPMENT-ID.PNGWrongName.PNG

 

I can't understand how Revit remembers the old parameter and how to make it "forget" it so I can happily upload the new parameter.

 

Does anyone have any idea on how to solve this?

 

Thanks a lot!

 

Andrea

0 Likes
Accepted solutions (1)
4,487 Views
12 Replies
Replies (12)
Message 2 of 13

ToanDN
Consultant
Consultant

I don't think it is possible within Revit.

 

Once you loaded a shared parameter in the project, it is there regardless of you doing anything the shared parameters txt file.  Loading a new shared parameters file in only allows you to add new entries, not changes what already in the project.  Even if you delete a shared parameter and create a new one with the exact same name, when you load it in project, it is a new parameter and not a replacement of the old one.

0 Likes
Message 3 of 13

Anonymous
Not applicable

Hi ToanDN,

 

Thanks for the reply.

 

The two parameters (the old one and the new one) are actually two different parameters, from two different .txt files and with two different names! I would be more than happy to add a new entry through the new shared parameter.

 

The weird thing is exactly that. The SP txt file that is now loaded in the project doesn't even include that GGSE-S2-EQUIPMENT-ID parameter that keeps re-appearing. But somehow there must be a hook or something that every time I try to load GS EQUIPMENT-ID makes Revit remember that it already had a similar parameter but with a different name, so it automatically changes it to the old name as in the last image.

0 Likes
Message 4 of 13

ToanDN
Consultant
Consultant

How did you create the new shared parameters file?  Did you edit the old txt file manually in some text editor then save as a new file?

0 Likes
Message 5 of 13

Anonymous
Not applicable
Hi Toan,

No, the first shared parameter file has never been modified.
The second shared parameter file was created normally through Revit.
0 Likes
Message 6 of 13

Anonymous
Not applicable

There is one plug in that purge parameters so maybe you can try with that.Of course if you want to get rid of the old one..https://www.youtube.com/watch?v=q4Ne-EuV-s0  

0 Likes
Message 7 of 13

Anonymous
Not applicable
Accepted solution

Hi dcesko,

 

Thanks for the suggestion! It actually gave me enough info to get to the solution.

 

At the end I noticed that the only way to solve this issue was to delete the parameter's ID. In this way Revit completely "forgets" about the existence of the parameter and doesn't re-associate the name when you try to load the new one.

I didn't find how to do it directly in Revit (probably due to my limited knowledge) so I created a Dynamo script to do it. Now it works perfectly!

 

Thanks guys!

0 Likes
Message 8 of 13

Anonymous
Not applicable

Hi AndreaTas,

 

 

You wrote: I didn't find how to do it directly in Revit (probably due to my limited knowledge) so I created a Dynamo script to do it. Now it works perfectly!

 

Can you show us your Dynamo Script?

That would reeaaaaly help me! Thank you so much in advance! 🙂

0 Likes
Message 9 of 13

Anonymous
Not applicable

Hi @Anonymous,

 

Yeah sure no problem!

 

The workflow is actually constituted by 4 Dyanmo scripts:

1) create a "dummy" parameter to temporarily hold the values of the parameter you want to substitute and to assign this parameter to all the categories

2) copy the values of the parameter you want to substitute to the temporary dummy parameter

3) the script that actually deletes the old shared parameter completely from Revit (screenshot below)

4) copy the values from the dummy parameter to the new loaded (manually) correct parameter.

 

This is the script to delete completely a shared parameter in Revit:

 Capture.PNG

As you can see, archi-lab's node Element.Delete is not in the new package anymore unfortunately, but I haven't had the time/need to modify the script recently so I'll post it as it is. Perhaps you still have an older version of the package, otherwise it is just going to be a matter of replacing that node.

 

I hope this helps 😉

 

Andrea

Message 10 of 13

EddieSaez
Advocate
Advocate

ATassera,

Interested in this post as I need to achieve something similar but with Project parameters.
Would you be so kind as to share all 4 dynamo scripts? (can provide email if you don't want to post on here)
I will happily share my results once resolved.

Thanks,

Eddie

0 Likes
Message 11 of 13

Anonymous
Not applicable

Hi @EddieSaez,

 

Happy to share my graphs if they can be useful!

But it's probably better if you write what you're trying to achieve so we can try to help...

 

Anyways,

#1

1.PNG

#2

2.PNG

#3

3.PNG

#4

4.PNG

0 Likes
Message 12 of 13

EddieSaez
Advocate
Advocate

Perfect...
Gives me somewhere to start.
(Still learning Dynamo)

 

Really appreciate you sharing these.

Will let you know I go.

 

Regards,

Eddie

0 Likes
Message 13 of 13

tamas.deri
Advocate
Advocate

Be aware that with deleting SharedParameterElements from your project you can **** up all your families, especially tags that use that parameter (if those sp-s also added to these families even as labels, or as geometry driving parameters). It can make labels inside of tags deleted completely if they refer to that shared parameter, and you will get no notification about this at all.  You will be really sorry if this happens. Been there, done that...

0 Likes