Ok try this. The workflow extracts data from the shared parameter file and allows you select what shared parameter groups and how the parameter should be grouped in the family. The Documents.AddSharedParamsToFamily Node is from a package called Dyn_SharedParamTesting
#Copyright (c) mostafa el ayoubi
#Data-Shapes www.data-shapes.net 2016 elayoub.mostafa@gmail.com
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *
doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIDocument
app = doc.Application
TransactionManager.Instance.EnsureInTransaction(doc)
app.SharedParametersFilename =IN[0]
spfile = app.OpenSharedParameterFile()
gr = spfile.Groups
defp = [g.Definitions for g in gr]
defflat = [x for l in defp for x in l]
defflatname = [x.Name for x in defflat]
defgrname = [x.Name for x in gr]
TransactionManager.Instance.TransactionTaskDone()
OUT = defflat , defflatname , defp , defgrname
Ok…this works only if u select the family and open the family editor…but it adds the parameter to the “type parameter”
but i need them in the normal parameter list:
Im happy over any batch solution for Revit2016 or 2017.
If you want a few new parameters in your project, you could import shared parameters into your project parameters and apply them to doors. So all your doors in the project get this shared parameter.