Rename Shared Parameter

Anonymous

Rename Shared Parameter

Anonymous
Not applicable

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.

0 Likes
Reply
Accepted solutions (1)
27,521 Views
28 Replies
Replies (28)

Anonymous
Not applicable

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

0 Likes

rosalesduquej
Autodesk Support
Autodesk Support
Accepted solution

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

Anonymous
Not applicable

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

PhillipM
Advocate
Advocate

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

Anonymous
Not applicable

@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!

0 Likes

Anonymous
Not applicable

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

GTisRuleX
Advocate
Advocate

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!)

0 Likes

Anonymous
Not applicable

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

Dale.Bartlett
Collaborator
Collaborator

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.
0 Likes

Dale.Bartlett
Collaborator
Collaborator

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.
0 Likes

Anonymous
Not applicable
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.
0 Likes

Anonymous
Not applicable

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é 

 

0 Likes

Dale.Bartlett
Collaborator
Collaborator
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.
0 Likes

oboennecUKLON
Explorer
Explorer

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.

0 Likes

aricke59
Enthusiast
Enthusiast

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.

Dale.Bartlett
Collaborator
Collaborator

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.
0 Likes

Ning_Zhou
Advocate
Advocate

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)?

0 Likes

Ning_Zhou
Advocate
Advocate

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

0 Likes

aricke59
Enthusiast
Enthusiast

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.