本文整理汇总了Python中eppy.modeleditor.IDF.initnew方法的典型用法代码示例。如果您正苦于以下问题:Python IDF.initnew方法的具体用法?Python IDF.initnew怎么用?Python IDF.initnew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eppy.modeleditor.IDF
的用法示例。
在下文中一共展示了IDF.initnew方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_referenced_object
# 需要导入模块: from eppy.modeleditor import IDF [as 别名]
# 或者: from eppy.modeleditor.IDF import initnew [as 别名]
def test_get_referenced_object(self):
"""py.test for get_referenced_object"""
idf = IDF()
idf.initnew('test.idf')
idf.newidfobject('VERSION') # does not have a field "Name"
# construction material
construction = idf.newidfobject('CONSTRUCTION', 'construction')
construction.Outside_Layer = 'TestMaterial'
expected = idf.newidfobject('MATERIAL', 'TestMaterial')
fetched = idf.getobject('MATERIAL', 'TestMaterial')
assert fetched == expected
material = construction.get_referenced_object('Outside_Layer')
assert material == expected
# window material
glazing_group = idf.newidfobject(
'WINDOWMATERIAL:GLAZINGGROUP:THERMOCHROMIC', 'glazing_group')
glazing_group.Window_Material_Glazing_Name_1 = 'TestWindowMaterial'
expected = idf.newidfobject(
'WINDOWMATERIAL:GLAZING', 'TestWindowMaterial') # has several \references
fetched = idf.getobject('WINDOWMATERIAL:GLAZING', 'TestWindowMaterial')
assert fetched == expected
material = glazing_group.get_referenced_object(
'Window_Material_Glazing_Name_1')
assert material == expected