PDA

View Full Version : Create Parameters in Families



kv
2007-08-28, 02:33 PM
Hi,

I'm new to the RevitAPI. Could you tell me if it is possible to do the following :
* I have an excel-sheet with parameters and values
* I have a library of about 200 families
* I want to add at each family a parameter from the excel sheet + iets value. So open each family, add parameter, add value..and this in a loop.


Reading the excel-sheet is not a problem. But can I add (shared) parameters and parametervalues to families in a loop

Kind Regards

GuyR
2007-08-28, 10:32 PM
You can create project parameters (instances or types) but you can't add family parameters to families in RAC2008.

HTH,

Guy

VinceFerrero
2007-08-29, 02:12 AM
What about rooms? Can you feed data from an excel spreadsheet to room "fields"?

Scott D Davis
2007-08-29, 02:23 AM
Hi,

I'm new to the RevitAPI. Could you tell me if it is possible to do the following :
* I have an excel-sheet with parameters and values
* I have a library of about 200 families
* I want to add at each family a parameter from the excel sheet + iets value. So open each family, add parameter, add value..and this in a loop.


Reading the excel-sheet is not a problem. But can I add (shared) parameters and parametervalues to families in a loop

Kind Regards

Why don't you make type catalogs from your excel files/ Saveas TXT from excel, using the same name as the family. If the parameter names in the family match the parameter names in the type catalog, you can open the family and pick the types you want from the list. All the AISC steel shapes are done this way if you need examples.

Steve_Stafford
2007-08-29, 04:42 AM
What about rooms? Can you feed data from an excel spreadsheet to room "fields"?After a fashion, I believe there is an example in the API folder that is on the shipping CD. I also think I recall another thread where Danny Polkinhorn and Mario Guttman have shared some code for such a task....take a look HERE (http://forums.augi.com/showthread.php?t=24029)

VinceFerrero
2007-08-29, 04:54 AM
Thanks, I' ll have a read through.

Prodev75
2007-09-06, 06:41 PM
You can create project parameters (instances or types) but you can't add family parameters to families in RAC2008.

HTH,

Guy


I just finished looking high and low for the answer to this question. As usual there is an answer somewhere on AUGI.
I hope this can be reevaluated by the Factory in the near future. Along with the ability to add object styles in both the project and the family editor. This would (IMO) hold a lot of weight in the BIM/CAD manager’s bag of tricks. Thank for the confirmation GuyR.

GuyR
2007-09-06, 09:28 PM
I hope this can be reevaluated by the Factory in the near future. Along with the ability to add object styles in both the project and the family editor.

It's high on the API wishlist. You can still use the API to help audit families. In the medium term creating family templates with your companies default object styles etc is a start.

Guy

ian.keough
2007-09-07, 02:07 PM
There's an example in the Revit 2008 SDK Samples folder which is called "Create Shared." This does exactly what you want. We wrote a piece that creates shared parameters from excel columns and fills in their values. This was in Revit Structure, but it should be exactly the same in Revit Building. That example will get you pointed in the right direction.

The clue is creating a shared parameter file, and figuring out how to attach the shared parameters programmatically to model categories, then filling in the information is just a matter of returning the new parameter on the family and setting it.

GuyR
2007-09-07, 08:08 PM
There's an example in the Revit 2008 SDK Samples folder which is called "Create Shared." This does exactly what you want.

Unfortunately his original request is to create parameters in the family. While the create shared example will allow you to bind parameters in a project as project parameters, the same can not be said with a family.

FWIW, manipulation of parameters in families is a long standing API request so hopefully we'll see some changes sooner rather than later.

Guy

ian.keough
2007-09-10, 12:51 PM
Guy,

You are absolutely correct. My oversight. The type catalogue seems the way to go then. Writing text files programatically is quite simple, so you could automate that. If they're substantially different families, I guess you're out of luck until they add the ability to get into families programmatically.

Prodev75
2007-09-10, 06:42 PM
It's high on the API wishlist. You can still use the API to help audit families. In the medium term creating family templates with your companies default object styles etc is a start.

Guy

Yes my friend I know and understand.

But it kind of messes up the entire “standards” thing when people deviate from the desired protocol and later on finding out that this deviation was scattered throughout the company. It’s kind of frustrating.

I’m also not fond of recreating the templates every time a new object style is needed.
But I think you know where I’m coming from.