нет атрибута в ifcopenshell - Python - PullRequest
0 голосов
/ 13 января 2020

Я сталкиваюсь с этой проблемой

enter image description here

Мне нравится эта картинка , Я не знаю, как ее исправить

Мой код здесь:

import ifcopenshell
ifc_file = ifcopenshell.open(r'C:\Users\18640\Desktop\IFC+RVT\total model\小别墅.ifc')
product = ifc_file.by_type('IfcWall')[0]

for definition in product.IsDefinedBy:
    property_definition = definition.RelatingPropertyDefinition
    print(property_definition.Name)

for property in property_definition.HasProperties:
    if property.is_a('IfcPropertySingleValue'):
        print(property.Name)
        print(property.NominalValue.wrappedValue)

результат:

Traceback (most recent call last):
  File "C:/Users/18640/Desktop/ifcopenshell/sample.py", line 6, in <module>
    property_definition = definition.RelatingPropertyDefinition
  File "C:\ProgramData\Anaconda3\lib\site-packages\ifcopenshell\entity_instance.py", line 68, in __getattr__
    "entity instance of type '%s' has no attribute '%s'" % (self.wrapped_data.is_a(), name))
AttributeError: entity instance of type 'IfcRelDefinesByType' has no attribute 'RelatingPropertyDefinition'

...