PDA

View Full Version : Family Types Parameters



bobd.144120
2007-08-01, 02:16 AM
I'm new to Revit API's, but I've been exploring the sample files. I'm still a bit lost on how I can manage Family Types (See Settings - Family Types) via API. I thought FamilySymbol would be the way to go, but I'm getting a bit confused.

I can have multiple Family Types in a .rfa file and I have an excel sheet that can modify the different parameters based on the different types.

I cannot for the life of me find the Family Type object name.

My pressing issue at the moment is not sure which type of Object I'm looking for. I've tried to iterate through the families, but I don't seem to be getting the family types inside this family file.

Once I find the family type I need to either delete, add or modify it and its parameters. I'm pretty sure once I have the correct object type this will be straight forward.

Could someone give me some code (prefer C#) that would help me find the correct family type object so I can modify it.

TIA
Bob

GuyR
2007-08-01, 08:48 AM
Bob,


I'm new to Revit API's, but I've been exploring the sample files. I'm still a bit lost on how I can manage Family Types (See Settings - Family Types) via API. I thought FamilySymbol would be the way to go, but I'm getting a bit confused.
You are correct that FamilySymbol is the correct class for a family type. Firstly check the Definition.IsReadOnly to see if you can write a new value for a parameter.

The namespace mapping is:

Elements.FamilyInstance == the the instance of the family in the project.
Elements.Family == the root family object containing a number of family types.
Symbols.FamilySymbol == a Family Type.

Note, from a FamilyInstance you can get all possible Family Types for the selected Family by using FamilyInstance.Symbol.Family.Symbols which will return a FamilySymbolSet.



I can have multiple Family Types in a .rfa file and I have an excel sheet that can modify the different parameters based on the different types.
Have you tried using type catalogues.



Once I find the family type I need to either delete, add or modify it and its parameters. I'm pretty sure once I have the correct object type this will be straight forward.

I'm guessing you're wanting to do this in the family editor? No go at the moment sorry. HIGH on the wishlist but don't expect anything before RA2009. The options for family manipulation are limited currently via the API.

HTH,

Guy

bobd.144120
2007-08-01, 12:56 PM
Thanks for such a quick response Guy.

What I'm getting from you is that I should be able to get the current FamilyTypes (Symbols) from the file, but I won't be able to do much with them other than possibly modify their parameter values (if definition.isreadonly = false).

Any other manipulation of the Family type can not be done at this time with the API.

The information was helpful, but frustrating. I told my client this morning of this issue do you or anyone else might have a work around for this?

Thanks,
Bob

GuyR
2007-08-01, 10:46 PM
Thanks for such a quick response Guy.

What I'm getting from you is that I should be able to get the current FamilyTypes (Symbols) from the file, but I won't be able to do much with them other than possibly modify their parameter values (if definition.isreadonly = false).

Any other manipulation of the Family type can not be done at this time with the API.

The information was helpful, but frustrating. I told my client this morning of this issue do you or anyone else might have a work around for this?

Thanks,
Bob

I think you need to separate family editor API functionality from project file API. In the Family editor or by loading a family into the background no manipulation of parameter data is possible AFAICT. Certainly from my experimentation that is what I've found.

When a family is loaded into a project however some manipulation is possible.

In terms of workarounds , the easiest is type catalogues as I stated previously. Other than that look at your workflow with families and other options will become apparent....

If you are a consultant than you should be on ADN. In which case there is other information available there.

Guy