Export family parameter to SPF

I would like to export a family parameter to the shared parameter file (or wherever).

I’m struggling to find API methods for export button. I assume its not exposed?
{81642B88-D9D4-4EC7-A54D-4C79B16F97EB}

I’m only seeing these methods but no export :frowning:

doc.FamilyManager.MakeReporting(FamilyParameter)
doc.FamilyManager.ReplaceParameter()
doc.FamilyManager.Set()
doc.FamilyManager.FamilyParameter()
doc.FamilyManager.SetDescription()

@Kervin

here are also used packages (genius-loci) in python… should be possible to modify.

1 Like

In case you haven’t yet found a solution, there are two steps; first get the shared parameter data from the project, pyRevit code to do that is here: RevitToolsForNotepadpp/pyRevit/pyMAW.extension/pyMAW.tab/Notepad++.panel/lib/Notepadpp.py at d408713719988ca67aa789c9508026dbdb433320 · mawdesign/RevitToolsForNotepadpp · GitHub

Second, open the shared parameter file for writing (it’s just a text file) and add the parameter to it. That same script has functions that find the current shared parameter file and one writes files in the shared parameter format so you should be able to cut and paste the necessary bits together to suit your purposes.

File locking might be a problem, with Revit and pyRevit reading and writing the same file. Also, the shared parameter groups are not stored in Revit which is probably why the export button uses a default “exported” group, you’ll need to see if the group name you want to use is already there and if not add it, but that is not as easy as simply appending another parameter at the end of the file.

1 Like