Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

set the parameter "Define Thermal Properties by"

2 REPLIES 2
Reply
Message 1 of 3
m.walterN99B3
102 Views, 2 Replies

set the parameter "Define Thermal Properties by"

I'd like to set the parameter "Define Thermal Properties by" of window and door families to the value "User Defined".

 

 

set define thermal properties by.png

 

Actually I only know how to get the parameter:

FamilyParameter familyParameter = familyManager.get_Parameter(BuiltInParameter.ANALYTICAL_DEFINE_THERMAL_PROPERTIES_BY);

 

I assume that I have to set it via an elementId:

familyManager.Set(familyParameter, elementId);

 But where to get the Id for "User Defined"?

2 REPLIES 2
Message 2 of 3

I suggest you explore the parameter data type and the possible values that it can take via RevitLookup or some other database exploration tools. The parameter StorageType specifies what type of data can be store in it:

  

  

None None represents an invalid storage type. This value should not be used.
Integer The internal data is stored in the form of a signed 32 bit integer.
Double The data will be stored internally in the form of an 8 byte floating point number.
String The internal data will be stored in the form of a string of characters.
ElementId The data type represents an element and is stored as the id of the element.

  

Unfortunately, some parameters have the storage type None. in that case, the data that they contain cannot be accessed via API, only by internal Revit methods. In that case, there is normally some BIM constraint driving the value, or a more complex user interface widget that cannot be represented by any of the simple storage types.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3
GaryOrrMBI
in reply to: m.walterN99B3

To expand on @jeremy_tammik and as relates directly to your question:

You know how to get the parameter. Use that to query the parameter to determine what value type it contains. You will find that your assumption as to it being an ElementId is incorrect. This suprized me as well as I also expected that it would return as an ElementId and expected the User defined option to end up being the "InvalidElementId" of -1.

It is, in fact, an Integer (Revit 2023, haven't checked to see if they changed that type from 32 bit to 64 bit but this info should get you headed in the right direction).

 

0 = Building Type

1 = Schematic Type

2 = User Defined

 

I don't know if it can be reset since setting it to a value outside of these could have unexpected consequences so they may have it defined in such a way as to prevent it being changed outside of the UI.

 

-G

 

 

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report