yorikvanhavre / FreeCAD-NativeIFC

A FreeCAD module to work with IFC files natively
GNU General Public License v3.0
66 stars 12 forks source link

AttributeError: 'NoneType' object has no attribute 'addObject' #54

Closed Mannshoch closed 11 months ago

Mannshoch commented 11 months ago

I'm playing around with the sample-test files from buildingSMART.

the Clinic_Plumbing.ifc had this import error:

16:18:48  Traceback (most recent call last):
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_viewproviders.py", line 158, in expandChildren
16:18:48      ifc_tools.create_children(
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 320, in create_children
16:18:48      result.extend(create_child(obj, child))
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 288, in create_child
16:18:48      child = create_object(element, doc, ifcfile, mode)
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 262, in create_object
16:18:48      ifc_layers.add_layers(obj, ifcentity, ifcfile)
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_layers.py", line 95, in add_layers
16:18:48      lay = get_layer(layer, proj)
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_layers.py", line 55, in get_layer
16:18:48      group = ifc_tools.get_group(project, "IfcLayersGroup")
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 1189, in get_group
16:18:48      group = add_object(doc, otype="group", oname=name)
16:18:48    File "C:\Users\%USERNAME%\AppData\Roaming\FreeCAD\Mod\FreeCAD-NativeIFC\.\ifc_tools.py", line 448, in add_object
16:18:48      obj = document.addObject(ftype, oname, proxy, vp, False)
16:18:48  AttributeError: 'NoneType' object has no attribute 'addObject'
yorikvanhavre commented 11 months ago

I don't get that error... But nevertheless I fixed the above problem

Mannshoch commented 11 months ago

May a stupid question, but how could I update this? The add-on manager say Native IFC is version 2022-10-20 (a whole year behind)

yorikvanhavre commented 11 months ago

Oh I think I need to update https://github.com/yorikvanhavre/FreeCAD-NativeIFC/blob/main/package.xml manually... Thanks for the hint!