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: 

Thermal Properties with IronPython

2 REPLIES 2
Reply
Message 1 of 3
mohammad.abdolvand
262 Views, 2 Replies

Thermal Properties with IronPython

Hi all,

I'm trying to write an API able to retrieve thermal properties of roof and walls (such as heat transfer coefficient, absorbptance etc.). To do so, I'm using IronPython to write my code. i'm using the code below

X=DB.Element.Wall.WallType.ThermalProperties.HeatTransferCoefficient

However, I ran to the following error:

System.MissingMemberException: 'type' object has no attribute 'WallType'

I do not know how to debug this.

Would you please help me out ? Also, if you have any better idea to achieve my purpose, I would appreciate your recommendation.

 

Thanks in advance.

2 REPLIES 2
Message 2 of 3

This sounds more like a Python issue than a Revit API issue to me. The Revit API Wall object does have a WallType property:

 

https://www.revitapidocs.com/2022/0c0d155f-5b2c-c09f-d7d4-41a8600560eb.htm

 

Therefore, somethings seems to be messed up with the `DB.Element.Wall` part of your statement.

 

Afaict, the error message is telling us that it is not returning a Wall object, as I would have assumed just naively reading it.

 

I suggest that you raise this in the Dynamo forum as well; they are more versed in Python questions:

 

https://forum.dynamobim.com

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

As Jeremy says, the dynamo forums are likely a good place to go. 

That said, based on the single line of code you shared, it looks you're trying to get an property value from the Wall Class itself, instead of a wall element. What you need to do, is get either a single or list of wall elements, and then use ".WallType.ThermalProperties.HeatTransferCoefficient" on each element. Python's list comprehension makes this pretty easy.

Using the variable "htc" to hold all the Heat Transfer Coefficient values for each wall, and assuming you have a list titled "list_of_walls" holding all the wall elements you need the value out of:

 

htc = [elem.WallType.ThermalProperties.HeatTransferCoefficient for elem in list_of_walls]

 

 

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

Post to forums  

Rail Community


Autodesk Design & Make Report