How can I check if a FamilyParameter is a BuiltInParameter?

How can I check if a FamilyParameter is a BuiltInParameter?

Anonymous
Not applicable
2,611 Views
5 Replies
Message 1 of 6

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
Accepted solutions (2)
2,612 Views
5 Replies
Replies (5)
Message 2 of 6

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

Message 3 of 6

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
Message 4 of 6

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





Message 5 of 6

Anonymous
Not applicable

Thanks a lot for your feedback!

0 Likes
Message 6 of 6

frankholidayjunior
Advocate
Advocate

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

0 Likes