Add parameters to family instance Revit 2016 Dynamo 1.3

revit
dynamo
#1

Hi i need to add one parameter or a list of parameters to all door families.
This was solved in this thread for Revit 2015. But this solution did not work in Revit 2016.
http://dynamobim.org/forums/topic/add-parameters-to-family-instance/

My result is null.

Is there another way to do it or to correct this workflow?

#2

Are you trying to add parameter in a family file or a project file?

#3

I try to add parameters in a family file.

#4

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

Here is the Python Code

#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
3 Likes
#5

Thx u for your help.
Where do you select the Family where the parameters are added?

Error: The current Document is not a Family Document

#6

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:
image
Im happy over any batch solution for Revit2016 or 2017.

#7

You have IsInstance set to false. That creates a type parameter. If you want an instance parameter you need to set that input to true.

#8

your are right!


But i need a solution that works for all door families…and this only works if u dont need to open the family editor. Any idea how this works?

#9

Batch automation then? Have you looked into this:

#10

well…cant find anything usefull on your link. But im not a pro in Dynamo yet…this can be the issue

#11

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.

Schallschutz

If you need this to be done in Dynamo there will also be a way

#12

this old post from Kulkul help me to get what i want:)

2 Likes