Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename Shared Parameter

28 REPLIES 28
SOLVED
Reply
Message 1 of 29
Anonymous
25042 Views, 28 Replies

Rename Shared Parameter

Is there a way to rename shared parameter already assigned to the project and/or family files? I would like to keep the GUID as it is but change the alias.

28 REPLIES 28
Message 2 of 29
R.van.den.Bor
in reply to: Anonymous

As far as I know, you can't change the name of a shared paramter, even not manually.

Kind regards,
Remy van den Bor
ICN Solutions B.V.
Liked this post or found it usefull, don't forget the Kudo It won't hurt (at least not me).
Message 3 of 29
rosalesduquej
in reply to: Anonymous

Dear La,

 

Unfortunately renaming an existing shared parameter is not posible. This comes from the SDK documentation when the RenameParameter method is used : " This operation is valid only for Family Parameters, and is invalid for Shared Parameters and Built-in Parameters."

 

Some workaround that I could suggest is try to export all the values of  your existing shared parameter into a temporary storage mapping each element id to its shared parameter value, delete the old shared parameter in the project file, create a new shared parameter with the updated name, and repopulate the values again in that way you will keep the GUID that you need with your new renamed Shared Parameter. it might work.

 

Cheers,



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
Message 4 of 29
Anonymous
in reply to: rosalesduquej

Which is a shame as in these days when the standards are not full yestablished yet the option like this would extermly helpfull, net necesseraly as API but as Revit option. The same way replacing GUID seamlesely should be allowed too. I know there are some workarounds but these are never save an relaible methods. I am currently setitng up stagdards for the company and have to deal with the existing projects which started before I joined the company, new standards and possible future national standards. It would be nice to have a tool which would allow me safely play with the data behind the geometry.

 

Anyway, thank you for your response, much appreciated.

 

Regards

L

Message 5 of 29
PhillipM
in reply to: Anonymous

There is actually a workaround that allows you to do this.

 

Change the SP to a family Parameter, Rename it and then convert it back to a SP.  GUIDS etc do not change.

 

Regards

 

Phillip

Message 6 of 29
RevitDevR
in reply to: PhillipM


@Anonymous wrote:

There is actually a workaround that allows you to do this.

 

Change the SP to a family Parameter, Rename it and then convert it back to a SP.  GUIDS etc do not change.

 

Regards

 

Phillip


Hi!

 

I'm interested in this workaround. Could somebody explain how someone suppose to convert back a family parameter to a shared parameter? (All I can do is creating a new shared paramater than assign it to the opened one, but I can do this without first converting it to family parameter.)

 

Thanks in advance!

Message 7 of 29
Anonymous
in reply to: PhillipM

This may work in family but in project file the option to change the SP to normal parameter is disabled.

 

I dont understand, what drives the family is the GUID not name so there should a way to replace the name of the parameter. Evan if I remove the SP from the file and load it again with new name Revit still uses the old name. Maybe there is away to purge the information about the old parameter name and GUID afer it has been removed.

 

L

Message 8 of 29
GTisRule
in reply to: Anonymous

So running into a bind with wanting to add company prefix to all of the shared parameters on our FAB sheets, I tried a lil experiment.  I edited the Shared Parameter .TXT file and renamed it there.

 

Obviously all of my labels seperated, but so far I see it seems to work.  The Parameter names seem crosswired though, areas such as Phase, were prefixed with JHK_. 

 sp1.jpg

 

 

You can clearly see the Shared Parmeter name change took here; but...

When I attempt to Edit the existing label, the name pulls in the previous version.

sp2.jpg

JHK_FAB_Line No. Worked with no issue at all, as you can see the name in the list of labels (Was previously applied.)

 

Anyone ever try to do this with any success?  Or am I simply playing with GUID fire?  (Seems the GUID's wouldn't change, since they're IN the text file as well, but then, why are the "Name" fields not fully pulling thru?  (Is this a crosswired GUID running in the background at this point?)

 

(Sometimes you severly have to break things to understand them and reverse engineer the issues!)

Message 9 of 29
Anonymous
in reply to: RevitDevR

Sorry it has taken me so long to reply to this.  I actually forgot about this until today when notified about a new post.

 

There is a trick.  You can not rename a shared Parameter, but you can change a SP to a family parameter through the API.  Check out FamilyManager.ReplaceParameter().

 

Once you have changed the Sp to a FP you can then use ReplaceParamater again to replace the newly created Fp back to any user selected SP.  The great thing about this method is that the original GUID stays the same as the original Parm.

 

I can provide a small code snippet if required.

 

Cheers

 

Phillip

Message 10 of 29
Dale.Bartlett
in reply to: Anonymous

My experience is that the Shared Parameter cannot really be deleted, even if it is unused. The reference remains and should you try to create a new Shared Parameter using the same GUID, it will assume the previous name. Dale




______________
Yes, I'm Satoshi.
Message 11 of 29

Apologies, I didn't read till the last post and responded to the solution. Phillip, I believe your suggestion only applies to a family, not a project. The code snippet would of course be appreciated. Regards, Dale




______________
Yes, I'm Satoshi.
Message 12 of 29
Anonymous
in reply to: Dale.Bartlett

Hi Dale. yes you could be right as the Replace method is part of the Family Manager class. I will take a quick look at some code tomorrow as it has been a fair while since I looked at it.
Message 13 of 29
wickedweka
in reply to: Anonymous

Hi Phil from KiwiCodes

 

You mentioned a method of changing paramter names through the API. Could you help me with a description, few screen shots on how you can do this...I found the page but unfortunately I don't code. Too hard basket? I'm a kiwi working in an architecture office in Helsinki and would be great to master this one!

 

Cheers

André 

 

Message 14 of 29
Dale.Bartlett
in reply to: wickedweka

I am of the view that this is not possible given the way in which Revit overlaps the use of GUID and Parameter Name. Nevertheless, I hope that a particularly clever work around could be suggested. PS You are a long way from home Andre.



______________
Yes, I'm Satoshi.
Message 15 of 29
oboennecUKLON
in reply to: Anonymous

Hi KiwiCodes,

Could you please provide the code for this as you described in your post?

That would be great.

I am trying to translate from US to UK family parameters that we don't understand.

Message 16 of 29
aricke59
in reply to: oboennecUKLON

This issue was recently raised by one of my clients and the solution I came up with simply requires you to:

 

1. Change/Edit the names of the parameters in your shared parameters file

2. Check each parameter in your family to see if it is in the shared parameter file under the same name

3. If the parameter is not found by name then it checks to find it by GUID

4. If the GUID exists, a temporary parameter is created and the shared parameter replaced. This is then replaced again with the altered name definition.

 

This all appears to work fine.

 

This functionality (with a lot of other functionality) is part of ARUtils - Head of the Family.

Message 17 of 29
Dale.Bartlett
in reply to: aricke59

As stated previously, I believe your suggestion only applies to a family, not a project. Project Shared Parameters are unable to be renamed whilst retaining the original GUID.




______________
Yes, I'm Satoshi.
Message 18 of 29
Ning_Zhou
in reply to: Anonymous

hi Phillip, any chance providing a small code snippet? i'm currently doing SPs cleanup, i can do it manually but renaming existing SPs in RFA and RVT via API is definitely the best option, by the way, is it doable to change visible too (i.e. VISIBLE DESCRIPTION in SP file)?

Message 19 of 29
Ning_Zhou
in reply to: Ning_Zhou

in fact, i cannot do it manually so API is the only option, seems 3rd party has already developed plugin to solve this issue but it only works in RFA, right? anyone can confirm it's doable in RVT? i mean via API

Message 20 of 29
aricke59
in reply to: Ning_Zhou

It only works in RFA files. The important command is the FamilyManager.ReplaceParameter that lets you keep all associations of the family parameter. Unfortunately there is no equivalent command for parameters in the RVT environment.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community