Exporting Shared Parameters to Shared Parameter File Revit 2023

Exporting Shared Parameters to Shared Parameter File Revit 2023

lee6800
Contributor Contributor
727 Views
3 Replies
Message 1 of 4

Exporting Shared Parameters to Shared Parameter File Revit 2023

lee6800
Contributor
Contributor

Hello, 

 

I am trying to collect all the shared parameters that exists within a family and export them to the shared parameter file.

I have searched the Revit Api Docs and can't find method used to achive this.

Basically I like the know what is the minimum info that is required 

just by looking at the  sp file, i can see when done manually, "PARAM", GUID, NAME, DATATYPE, DATACATEGORY, GROUP, VISIBLE,  DESCRIPTION,  USERMODIFIABLE,  HIDEWHENNOVALUE  are populated.

Do I need to extract all these values from the parameters? When I create / export manully, I don't set half of these! so where does Revit gets them from?

This is for Revit 2023 btw, as I know some of the API has changed after Revit 2021

lee6800_0-1722599137095.png

Thanks for your help in advance

 

0 Likes
728 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

I believe it is very simple. Just read the value of the Application object's SharedParametersFilename:

  

  

If it is undefined, you can set it to a pathname of your own choice. Afaict, Revit will write the data you describe to that location. You can look at The Building Coder samples module CmdCreateSharedParams.cs, for example:

  

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 4

lee6800
Contributor
Contributor
Thank you very much for your help
With the links provided above and this tool here
https://github.com/jeremytammik/RevitSdkSamples/blob/master/SDK/Samples/MultiplanarRebar/CS/SharedPa...

I think I have enough information to finish off my script now
Thanks again for your help
0 Likes
Message 4 of 4

minix6800
Participant
Participant

Hi,

 

how do you get BuiltInParameter Enumeration for revit 2025 and above

for earlier revit versions I used 

BuiltInParameterGroup groupEnum = param.Definition.ParameterGroup;

but not sure how to do this is later versions of revit?

thanks  

0 Likes