How can I check if a FamilyParameter is a BuiltInParameter?

Anonymous

How can I check if a FamilyParameter is a BuiltInParameter?

Anonymous
Not applicable

I'd like to know if a given FamilyParameter is a system parameter that cannot be removed. How to do that?

0 Likes
Reply
Accepted solutions (2)
2,196 Views
5 Replies
Replies (5)

jeremytammik
Autodesk
Autodesk
Accepted solution

Please correct me if I am wrong or misunderstanding something.

 

Afaik, a family parameter is never a built-in parameter.

 

A family parameter has been defined by the family definition in an RFA file.

 

Unfortunately, it can only be identified by the user display name.

 

A built-in parameter can always be identified by the built-in parameter enum.

 

Here is what I learn by browsing the Revit API help file RevitAPI.chm:

 

Both have a parameter definition; the Definition object is a base object for all type of parameter definitions within the Autodesk Revit API.

 

The definition is either an ExternalDefinition or an InternalDefinition.

 

Try casting to those to find out.

 

The InternalDefinition has a BuiltInParameter property.

 

The ExternalDefinition object adds properties specific to Autodesk Revit shared parameter definitions.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Revitalizer
Advisor
Advisor

Hi Jeremy,

 

a FamilyParameter can indeed be a BuiltInParameter.

FamilyParameter.Definition is an InternalDefinition.

Its BuiltInParameter property is either invalid or a valid BuiltInParameter value.

 

BIP_Invalid.pngBIP_Manufacturer.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cheers,

Rudi




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Revitalizer
Advisor
Advisor
Accepted solution

Hi,

 

didn't read that you already wrote:

 

"The definition is either an ExternalDefinition or an InternalDefinition.

 

Try casting to those to find out.

 

The InternalDefinition has a BuiltInParameter property."

 

That's the solution, already.

 

 

Rudi

 




Rudolf Honke
Software Developer
Mensch und Maschine





Anonymous
Not applicable

Thanks a lot for your feedback!

0 Likes

frankholidayjunior
Advocate
Advocate

thanx just helped me out, didnt know you could cast like that.

0 Likes