Set Shared Parameter Files

Hello Team,

I know you can Add Parameters, Utilize Excel, And even Delete Shared Parameters if needed. I was wondering if there is a way to change the actual path of the Shared Parameter file specifically in the project?

This way I can extract the newly loaded Shared Parameter file into Families I may need parameters loaded into. Let me know what you think!

Kevin

I don’t believe this is possible through the API. There is an OpenSharedParameterFile method, but not a corresponding ChangeSharedParameterFile method or anything similar.

Edit: See Sean’s post below.

You can do this…

import clr

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager


doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

uiApp = DocumentManager.Instance.CurrentUIApplication
SP = uiApp.Application.SharedParametersFilename

path = IN[0]
new = []
#Do some action in a Transaction
uiApp.Application.SharedParametersFilename = path

OUT = path
4 Likes

Sean,

This worked absolutely perfectly! Thank you so much. Now I can do a Passthrough command, to input the parameters from this file into my families.
THANK YOU!

Sincerely,
Kevin

1 Like

Aha! Hadn’t noticed this before. Good find.

1 Like

I was honestly surprised that it was a (get; set;) method, but something to keep in mind for sure!