PDA

View Full Version : New Parameter using ElementSet?



tha
2007-10-22, 04:08 PM
Does anyone know how, or if it posible to create a new parameter using ElementSet instead of CategorySet? Because I would like to create some new parameters for our company families only, and not to the whole category.

Thanks in advance!

Ex.

Using the code from the "CreateShared" example, what need to be modify in this code so that it only create parameter in a certain number of families, and not to the whole categories.

'create a category set with the wall category in it
Dim categories As Autodesk.Revit.CategorySet
categories = commandData.Application.Create.NewCategorySet
Dim wallCategory As Autodesk.Revit.Category
wallCategory = commandData.Application.ActiveDocument.Settings.Categories.Item("Walls")

categories.Insert(wallCategory)

'create a new instance binding for the wall categories
Dim instanceBinding As Autodesk.Revit.Parameters.InstanceBinding
instanceBinding = commandData.Application.Create.NewInstanceBinding(categories)

'add the binding
commandData.Application.ActiveDocument.ParameterBindings.Insert(sharedParameterDefinition, instanceBinding)

GuyR
2007-10-22, 08:18 PM
Does anyone know how, or if it posible to create a new parameter using ElementSet instead of CategorySet? Because I would like to create some new parameters for our company families only, and not to the whole category.

The only way to add a parameter to a specific family only is in the family itself. And you can't do this with the API yet. The sample supplied in the SDK adds a project parameter which by definition is project wide, hence the use of the category as the definer.

If you don't want the user to see the parameter you can always make it invisible.

HTH,

Guy

tha
2007-10-23, 03:12 PM
Thanks GuyR,

Hmm... now I'm thinking may be a journal file might be a better way to go.

jsimon.216607
2010-02-10, 10:01 PM
The only way to add a parameter to a specific family only is in the family itself. And you can't do this with the API yet.
Guy


Is this still so? I am trying to add an instance parameter (non shared) to a family from inside a project. Looking at the database, I cant even find where each family references it's instance parameters. For example, if I add an instance family parameter from inside the family editor, this parameter does not show up when I look at the Family or FamilySymbol from inside the project DB. I know it shows up in each FamilyInstance but that does not count because its not the family itself. Using Revit 2010. Does anyone know where family instance parameters are stored at the project level?

david.bartliff
2010-02-11, 12:03 PM
Are you using Revit 2010?
If so, then look at the Building Coder which has an example
http://thebuildingcoder.typepad.com/

jsimon.216607
2010-02-12, 10:30 PM
Thanks David,

It is indeed possible to create an instance param for a family inside a project:
With a little digging I came across a helpful page:

http://thebuildingcoder.typepad.com/blog/2009/08/the-revit-family-api.html