Convert Family Parameter to Existing Shared Parameter

I’ve done some digging but haven’t found anything yet to convert a family parameter into a specific shared parameter.

Revit Parameter Organizer (http://netspiderstudio.com/help/RPO/index.html) will convert a family parameter into a new shared parameter that can be exported from the family into a shared parameter file but that’s not what I’m after.

I got this far using nodes from #orchid and it almost seems like it works except that the family parameters are still family parameters. The messy part in the middle is there because I couldn’t find a way to pull the parameter group in the family from the parameters. I think it’s possible with builtin nodes but I’d need an element to select first and the RFA is the element so… no I guess.

The code here – https://spiderinnet.typepad.com/blog/2011/06/parameter-of-revit-api-51-parameter-converter-familyparameter-to-sharedparameter.html – is what I think RPO is using (or a variation of it). The answer might be in here but I’m having trouble reading it.

Thoughts? Am I barking up an impossible tree?

1 Like

Nothin?

If I can’t figure this out it’s. So. Much. Work.

i think you can use this ReplaceParameter Method to convert your family parameter into existing sharedparameter. The trick is to load your sharedparameter file into the document first and get its external definition. Then using definition name to match your family parameter name and hence using that method. I believe it is doable.

But i think for your application, it is best to write your own python script

That does look promising! Thanks.

Now for the hard part…

Did you ever figure this out? I’m not that great at writing stuff in Python yet and am having trouble.

sadly, no – and i was just looking into it again the other day!

I cracked this one a while back, and added custom nodes to Crumple to help with it also.

In this tutorial I use them to replace shared parameters with family parameters in a family, then swap those to shared parameters. It’s the second half you’ll be intrerested in I guess!

2 Likes

Interesting to me that this thread has a “solution” but doesn’t appear resolved. That’s usually a sure fire way to not get additional help.

Hopefully @GavinCrump video will put you on the home stretch!

1 Like

The solution was marked on Gavin’s post… don’t know by who but since it does solve the initial question I think it’s A-OKAY!

1 Like

BUMP

Followed the video, but either i misunderstand things or the node isn’t working.

I try to replace a existing Family Parameter with a Shared Paramter (with the same name).

Reminder/note to self to look into this tomorrow. Generally these nodes should be working for single family documents.

I uploaded a script for bulk processing here also if it helps in the meantime (but for shared > shared):

Thanks for your reply.

I really need Family (non shared) > Shared. From your video I understood that should be possible?
Or did i asume wrong?

FYI; i tried it on a single Family document (Revit 2022).

NB
Learning Python is on my list. :upside_down_face:

So you will need to put your parameters and exdefs into a list if there is only one. My nodes work with a list input only so that it functions as intended at levels I believe.

Replace parameters.dyn (20.9 KB)
Test parameters.txt (942 Bytes)
Test family.rfa (404 KB)

That is also not working.

I did try something similar before i posted my question, but with the same result.

image

EDIT
It works when the Non Shared name is DIFFERENT than the Shared name.
Looking back at the video i guess this is intended(?) and i missed that(?).

Follow up questions;

Question 1
Can the graph / node / python be edited in such way it can work with the same namefor Non Shared and Shared?

Question 2
And can this :point_down: also be used for bulk Non Shared to Shared (if i would change something)?

Compare my sample files to yours then and spot the difference - mine work, something must be different about your family or parameters (maybe being the same name is an issue?).

My best guess is your parameters have differing data types, in which case a swap is not valid I believe.

1 Like

@GavinCrump

I found the issue and have two follow up questions (see my previous post).

PS
Your help and work is much appreciated.

The script I uploaded before has bulk shared to shared based on an excel list of matches, with some python edits it could be made to do non shared to shared. Hopefully the script I shared is workable into what you need. If you aren’t familiar with Python but want to do these types of workflows, time to learn.

I have nodes in Crumple that do shared > family > shared. Shared > shared is not possible in Revit API so a temporary change to family is necessary before going family > shared.

1 Like

If you could make the change or tell me what i have to change in the Python to make it work
for Non Shared to Shared that would be much appreciated (again :innocent:).

Sort of. I guess i have to rename the Parameters i want to change firs, but that i can do…

Agreed. As i said, it is really on my list. I probably have some time ‘dip my toes’ into this next
few weeks. :smile:

Added a modified version here. It temporarily renames the family parameter first to ‘Temporary name’ so that the name clash isn’t a problem.

I will try it later. TYVM so far!

1 Like