BlenderBIM spreadsheet writer for .xlsx and .ods

124

Comments

  • The dependencies of the BlenderBim addon are located in libs/site/packages

    Coen
  • AceAce
    edited September 2022

    @Coen It seems like it does

    edit: this is flippin useful btw, I'm probably going to be using it quite alot over the next month

    Coen
  • I've created a feature here for maybe a future pull request to add to the BlenderBIM add-on:
    https://github.com/C-Claus/IfcOpenShell/tree/feature/spreadsheet_writer/src/blenderbim/blenderbim/bim/module/spreadsheet_writer
    I want to test it locally on my system, but where do I add it the menu/UI to BlenderBIM?

    Acepeperiberatheoryshaw

  • Would like to add it to the BlenderBIM panel like so, clueless on how to. I am looking into ui.py of the other modules.
    It just says
    bl_category = "BlenderBIM"
    I thought changing this parameter would work
    https://github.com/C-Claus/IfcOpenShell/commit/cc4afd7b39aa37dc3ded5910c74f2b8c8b375c1c

    But I think some more work is required.

  • @Coen my two cents about it: i thing that that panel is the right place to put the module. :-)
    Also, it should be a module like the others (pset, ifcclash, georeferencing, etc...)
    There is also the "demo" module to know how to structure a module, so if you follow that guide, you should get it

  • edited November 2022

    @Massimo
    Thanks for the feedback...
    I think I made it a module like the others?
    I placed a folder here locally called spreadsheet_writer which contains the code

    AlsoI looked into this
    https://blenderbim.org/docs/devs/hello_world.html
    It says

    To see the demo module in action, you’ll need to enable it. In src/blenderbim/blenderbim/bim/init.py, uncomment the line for the demo module. When you restart Blender, you will see a new demo panel in your scene properties interface tab. Have fun!

    I went into the demo folder, but see nothing commented, which line in which file should I uncomment?

    I see this in the __init__.py of the demo folder

    # BlenderBIM Add-on - OpenBIM Blender Add-on
    # Copyright (C) 2022 Dion Moult <dion@thinkmoult.com>
    #
    # This file is part of BlenderBIM Add-on.
    #
    # BlenderBIM Add-on is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # BlenderBIM Add-on is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with BlenderBIM Add-on.  If not, see <http://www.gnu.org/licenses/>.
    
    # ############################################################################ #
    
    # Hey there! Welcome to the BlenderBIM Add-on code. Please feel free to reach
    # out if you have any questions or need further guidance. Happy hacking!
    
    # ############################################################################ #
    
    # Every module has a __init__.py file to load all of its classes. Every
    # operation, property, and interface needs to be registered with the Blender
    # system when the add-on loads. This is where it happens.
    
    import bpy
    from . import ui, prop, operator
    
    # You'll need to provide a list of every one of your classes here. If you forget
    # to specify your class, it won't load and you won't be able to use that
    # operator, property, or interface.
    classes = (
        operator.DemonstrateHelloWorld,
        operator.DemonstrateRenameProject,
        prop.BIMDemoProperties,
        ui.BIM_PT_demo,
    )
    
    
    # When the add-on loads, this register function is called. This allows you to
    # perform additional tasks during startup. If you need to store custom
    # properties, this is where you tell Blender where they are going to be stored.
    # You might see more advanced registrations happening in other modules.
    def register():
        # Properties are usually stored on bpy.types.Scene when they are something
        # that affects everything in the project, or bpy.types.Object when they
        # affect a single BIM element.
        bpy.types.Scene.BIMDemoProperties = bpy.props.PointerProperty(type=prop.BIMDemoProperties)
    
    
    # When someone disables the add-on, we need to unload everything we loaded. This
    # does the reverse of the register function.
    def unregister():
        del bpy.types.Scene.BIMDemoProperties
    
  • edited November 2022

    @Coen It's refering to these lines of code
    you'll need to add "spreadsheet_writer": None in this dictionary so that it's automatically imported and registered afterwards. You'll also need to add your panel class in the classes list instead of
    classes = ( operator.DemonstrateHelloWorld, operator.DemonstrateRenameProject, prop.BIMDemoProperties, ui.BIM_PT_demo, )

    Coen
  • @Gorgious
    Thanks, that was not clear to me.
    Like this?

    # BlenderBIM Add-on - OpenBIM Blender Add-on
    # Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
    #
    # This file is part of BlenderBIM Add-on.
    #
    # BlenderBIM Add-on is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # BlenderBIM Add-on is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with BlenderBIM Add-on.  If not, see <http://www.gnu.org/licenses/>.
    
    import bpy
    import importlib
    from . import handler, ui, prop, operator, helper
    
    modules = {
        "project": None,
        "search": None,
        "bcf": None,
        "root": None,
        "unit": None,
        "model": None,
        "cad": None,
        "georeference": None,
        "context": None,
        "drawing": None,
        "misc": None,
        "attribute": None,
        "type": None,
        "spatial": None,
        "void": None,
        "aggregate": None,
        "geometry": None,
        "cobie": None,
        "resource": None,
        "cost": None,
        "sequence": None,
        "group": None,
        "system": None,
        "brick": None,
        "structural": None,
        "boundary": None,
        "profile": None,
        "material": None,
        "style": None,
        "layer": None,
        "owner": None,
        "pset": None,
        "qto": None,
        "classification": None,
        "library": None,
        "constraint": None,
        "document": None,
        "pset_template": None,
        "clash": None,
        "lca": None,
        "csv": None,
        "tester": None,
        "bimtester": None,
        "diff": None,
        "patch": None,
        "gis": None,
        "covetool": None,
        "augin": None,
        "debug": None,
        "spreadsheet_writer":None,
        # Uncomment this line to enable loading of the demo module. Happy hacking!
        # The name "demo" must correlate to a folder name in `bim/module/`.
        # "demo": None,
    }
    
    
    for name in modules.keys():
        modules[name] = importlib.import_module(f"blenderbim.bim.module.{name}")
    
    
    classes = [
        operator.AddIfcFile,
        operator.BIM_OT_add_section_plane,
        operator.BIM_OT_remove_section_plane,
        operator.ConfigureVisibility,
        operator.OpenUpstream,
        operator.OpenUri,
        operator.ReloadIfcFile,
        operator.RemoveIfcFile,
        operator.SelectDataDir,
        operator.SelectIfcFile,
        operator.SelectSchemaDir,
        operator.SelectURIAttribute,
        operator.EditBlenderCollection,
        operator.BIM_OT_open_webbrowser,
        operator.BIM_OT_show_description,
    
        #prop.MyItem,
        #prop.MyCollection,
        #prop.BlenderBIMSpreadSheetProperties,
        #operator.MyCollectionActions,
        #operator.ConstructDataFrame,
        #operator.WriteToXLSX,
        #operator.WriteToODS,
        #operator.FilterIFCElements,
        #operator.UnhideIFCElements,
        #ui.BlenderBIMSpreadSheet,
        #ui.MyItem,
        #ui.MyCollection,
        #ui.MyCollectionActions
    
    
        prop.StrProperty,
        operator.BIM_OT_enum_property_search,  # /!\ Register AFTER prop.StrProperty
        prop.ObjProperty,
        prop.Attribute,
        prop.ModuleVisibility,
        prop.BIMProperties,
        prop.IfcParameter,
        prop.PsetQto,
        prop.GlobalId,
        prop.BIMObjectProperties,
        prop.BIMMaterialProperties,
        prop.BIMMeshProperties,
        ui.BIM_PT_section_plane,
        ui.BIM_UL_generic,
        ui.BIM_UL_topics,
        ui.BIM_ADDON_preferences,
        # Scene panel groups
        ui.BIM_PT_project_info,
        ui.BIM_PT_project_setup,
        ui.BIM_PT_collaboration,
        ui.BIM_PT_geometry,
        ui.BIM_PT_services,
        ui.BIM_PT_structural,
        ui.BIM_PT_4D5D,
        ui.BIM_PT_quality_control,
        ui.BIM_PT_integrations,
        # Object panel groups
        ui.BIM_PT_object_metadata,
        ui.BIM_PT_geometry_object,
        ui.BIM_PT_services_object,
        ui.BIM_PT_utilities_object,
        ui.BIM_PT_misc_object,
    
    ]
    
    for mod in modules.values():
        classes.extend(mod.classes)
    
    
    def on_register(scene):
        handler.setDefaultProperties(scene)
        if not bpy.app.background:
            bpy.app.handlers.depsgraph_update_post.remove(on_register)
    
    
    def register():
        for cls in classes:
            bpy.utils.register_class(cls)
        bpy.app.handlers.depsgraph_update_post.append(on_register)
        bpy.app.handlers.undo_pre.append(handler.undo_pre)
        bpy.app.handlers.undo_post.append(handler.undo_post)
        bpy.app.handlers.redo_pre.append(handler.redo_pre)
        bpy.app.handlers.redo_post.append(handler.redo_post)
        bpy.app.handlers.load_post.append(handler.setDefaultProperties)
        bpy.app.handlers.load_post.append(handler.loadIfcStore)
        bpy.app.handlers.save_pre.append(handler.ensureIfcExported)
        bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
        bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
        bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
        bpy.types.Material.BIMMaterialProperties = bpy.props.PointerProperty(type=prop.BIMMaterialProperties)
        bpy.types.Mesh.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.SCENE_PT_unit.append(ui.ifc_units)
        if hasattr(bpy.types, "UI_MT_button_context_menu"):
            bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
    
        for mod in modules.values():
            mod.register()
    
    
    def unregister():
        for cls in reversed(classes):
            bpy.utils.unregister_class(cls)
        bpy.app.handlers.load_post.remove(handler.setDefaultProperties)
        bpy.app.handlers.load_post.remove(handler.loadIfcStore)
        bpy.app.handlers.save_pre.remove(handler.ensureIfcExported)
        del bpy.types.Scene.BIMProperties
        del bpy.types.Object.BIMObjectProperties
        del bpy.types.Material.BIMObjectProperties
        del bpy.types.Material.BIMMaterialProperties
        del bpy.types.Mesh.BIMMeshProperties
        del bpy.types.Curve.BIMMeshProperties
        del bpy.types.Camera.BIMMeshProperties
        del bpy.types.PointLight.BIMMeshProperties
        bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
        if hasattr(bpy.types, "UI_MT_button_context_menu"):
            bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
    
        for mod in reversed(list(modules.values())):
            mod.unregister()
    

    It seem when I add the classes of the spreadsheet_writer module, blenderbim won't load anymore in Blender. That's why I commented them out. Any idea on how to debug this?

  • edited November 2022

    So if I understand correctly you can keep this file like this, remove your commented lines there and add a file named __init__.py in your subfolder spreadsheet_writer with this content :

    import bpy
    from . import ui, prop, operator
    
    classes = (
        prop.MyItem,
        prop.MyCollection,
        prop.BlenderBIMSpreadSheetProperties,
        operator.MyCollectionActions,
        operator.ConstructDataFrame,
        operator.WriteToXLSX,
        operator.WriteToODS,
        operator.FilterIFCElements,
        operator.UnhideIFCElements,
        ui.BlenderBIMSpreadSheet,
        ui.MyItem,
        ui.MyCollection,
        ui.MyCollectionActions
    )
    
    def register():
        # Here you can add your custom props to specific types eg bpy.types.Scene.my_custom_collection = bpy.props.PointerProperty(type=prop.MyCollection)
        pass
    
    def unregister():
        # Here you should delete your custom props eg del bpy.types.Scene.my_custom_collection
        pass
    

    Of course you'll need to populate ui.py, operator.py and prop.py inside your spreadhseet_writer subfolder

    -> Sidenote the convention is to write "spreadsheet_writer": None and not "spreadsheet_writer":None (notice the whitespace between : and None

  • @Gorgious

    Thanks for your help, still no succes so far.
    What I have done:
    in
    ..\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\bim\module\spreadsheet_writer module I have place the following scripts

     - __init__.py
    - operator.py 
    - prop.py
    - ui.py
    

    in this __init__.py I have placed the following code:

    import bpy 
    from . import ui, prop, operator 
    
    classes  = (
        prop.MyItem,
        prop.MyCollection,
        prop.BlenderBIMSpreadSheetProperties,
        operator.MyCollectionActions,
        operator.ConstructDataFrame,
        operator.WriteToXLSX,
        operator.WriteToODS,
        operator.FilterIFCElements,
        operator.UnhideIFCElements,
        ui.BlenderBIMSpreadSheet,
        ui.MyItem,
        ui.MyCollection,
        ui.MyCollectionActions
    )
    
    def register():
        pass
    
    def unregister(): 
        pass
    

    Then I went to:
    ..\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\bim modeule and opened the __init__.py there, I added the space after in "spreadsheet_writer": None,
    The file now looks this:

    # BlenderBIM Add-on - OpenBIM Blender Add-on
    # Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
    #
    # This file is part of BlenderBIM Add-on.
    #
    # BlenderBIM Add-on is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # BlenderBIM Add-on is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with BlenderBIM Add-on.  If not, see <http://www.gnu.org/licenses/>.
    
    import bpy
    import importlib
    from . import handler, ui, prop, operator, helper
    
    modules = {
        "project": None,
        "search": None,
        "bcf": None,
        "root": None,
        "unit": None,
        "model": None,
        "cad": None,
        "georeference": None,
        "context": None,
        "drawing": None,
        "misc": None,
        "attribute": None,
        "type": None,
        "spatial": None,
        "void": None,
        "aggregate": None,
        "geometry": None,
        "cobie": None,
        "resource": None,
        "cost": None,
        "sequence": None,
        "group": None,
        "system": None,
        "brick": None,
        "structural": None,
        "boundary": None,
        "profile": None,
        "material": None,
        "style": None,
        "layer": None,
        "owner": None,
        "pset": None,
        "qto": None,
        "classification": None,
        "library": None,
        "constraint": None,
        "document": None,
        "pset_template": None,
        "clash": None,
        "lca": None,
        "csv": None,
        "tester": None,
        "bimtester": None,
        "diff": None,
        "patch": None,
        "gis": None,
        "covetool": None,
        "augin": None,
        "debug": None,
        "spreadsheet_writer": None,
        # Uncomment this line to enable loading of the demo module. Happy hacking!
        # The name "demo" must correlate to a folder name in `bim/module/`.
        # "demo": None,
    }
    
    
    for name in modules.keys():
        modules[name] = importlib.import_module(f"blenderbim.bim.module.{name}")
    
    
    classes = [
        operator.AddIfcFile,
        operator.BIM_OT_add_section_plane,
        operator.BIM_OT_remove_section_plane,
        operator.ConfigureVisibility,
        operator.OpenUpstream,
        operator.OpenUri,
        operator.ReloadIfcFile,
        operator.RemoveIfcFile,
        operator.SelectDataDir,
        operator.SelectIfcFile,
        operator.SelectSchemaDir,
        operator.SelectURIAttribute,
        operator.EditBlenderCollection,
        operator.BIM_OT_open_webbrowser,
        operator.BIM_OT_show_description,
        prop.StrProperty,
        operator.BIM_OT_enum_property_search,  # /!\ Register AFTER prop.StrProperty
        prop.ObjProperty,
        prop.Attribute,
        prop.ModuleVisibility,
        prop.BIMProperties,
        prop.IfcParameter,
        prop.PsetQto,
        prop.GlobalId,
        prop.BIMObjectProperties,
        prop.BIMMaterialProperties,
        prop.BIMMeshProperties,
        ui.BIM_PT_section_plane,
        ui.BIM_UL_generic,
        ui.BIM_UL_topics,
        ui.BIM_ADDON_preferences,
        # Scene panel groups
        ui.BIM_PT_project_info,
        ui.BIM_PT_project_setup,
        ui.BIM_PT_collaboration,
        ui.BIM_PT_geometry,
        ui.BIM_PT_services,
        ui.BIM_PT_structural,
        ui.BIM_PT_4D5D,
        ui.BIM_PT_quality_control,
        ui.BIM_PT_integrations,
        # Object panel groups
        ui.BIM_PT_object_metadata,
        ui.BIM_PT_geometry_object,
        ui.BIM_PT_services_object,
        ui.BIM_PT_utilities_object,
        ui.BIM_PT_misc_object,
    
    ]
    
    for mod in modules.values():
        classes.extend(mod.classes)
    
    
    def on_register(scene):
        handler.setDefaultProperties(scene)
        if not bpy.app.background:
            bpy.app.handlers.depsgraph_update_post.remove(on_register)
    
    
    def register():
        for cls in classes:
            bpy.utils.register_class(cls)
        bpy.app.handlers.depsgraph_update_post.append(on_register)
        bpy.app.handlers.undo_pre.append(handler.undo_pre)
        bpy.app.handlers.undo_post.append(handler.undo_post)
        bpy.app.handlers.redo_pre.append(handler.redo_pre)
        bpy.app.handlers.redo_post.append(handler.redo_post)
        bpy.app.handlers.load_post.append(handler.setDefaultProperties)
        bpy.app.handlers.load_post.append(handler.loadIfcStore)
        bpy.app.handlers.save_pre.append(handler.ensureIfcExported)
        bpy.types.Scene.BIMProperties = bpy.props.PointerProperty(type=prop.BIMProperties)
        bpy.types.Object.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
        bpy.types.Material.BIMObjectProperties = bpy.props.PointerProperty(type=prop.BIMObjectProperties)
        bpy.types.Material.BIMMaterialProperties = bpy.props.PointerProperty(type=prop.BIMMaterialProperties)
        bpy.types.Mesh.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
        bpy.types.SCENE_PT_unit.append(ui.ifc_units)
        if hasattr(bpy.types, "UI_MT_button_context_menu"):
            bpy.types.UI_MT_button_context_menu.append(ui.draw_custom_context_menu)
    
        for mod in modules.values():
            mod.register()
    
    
    def unregister():
        for cls in reversed(classes):
            bpy.utils.unregister_class(cls)
        bpy.app.handlers.load_post.remove(handler.setDefaultProperties)
        bpy.app.handlers.load_post.remove(handler.loadIfcStore)
        bpy.app.handlers.save_pre.remove(handler.ensureIfcExported)
        del bpy.types.Scene.BIMProperties
        del bpy.types.Object.BIMObjectProperties
        del bpy.types.Material.BIMObjectProperties
        del bpy.types.Material.BIMMaterialProperties
        del bpy.types.Mesh.BIMMeshProperties
        del bpy.types.Curve.BIMMeshProperties
        del bpy.types.Camera.BIMMeshProperties
        del bpy.types.PointLight.BIMMeshProperties
        bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
        if hasattr(bpy.types, "UI_MT_button_context_menu"):
            bpy.types.UI_MT_button_context_menu.remove(ui.draw_custom_context_menu)
    
        for mod in reversed(list(modules.values())):
            mod.unregister()
    

    But when restarting Blender I see BlenderBIM, but somehow I broke it.
    Can't make a new project

  • If you're on windows you can go to Window > Toggle System Console, there should be an error printed out there. You can copy / paste it here to troubleshoot it.

    Coen
  • @Gorgious

    module changed on disk: 'C:\\Users\\cclaus\\AppData\\Roaming\\Blender Foundation\\Blender\\3.3\\scripts\\addons\\blenderbim\\__init__.py' reloading...
    Exception in module register(): C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\__init__.py
    Traceback (most recent call last):
      File "C:\Program Files\Blender Foundation\Blender 3.3\3.3\scripts\modules\addon_utils.py", line 369, in enable
        mod.register()
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\__init__.py", line 42, in register
        blenderbim.bim.register()
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\bim\__init__.py", line 147, in register
        bpy.utils.register_class(cls)
    RuntimeError: register_class(...):, missing bl_rna attribute from 'type' instance (may not be registered)
    openpyxl 3.0.10 C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\lib\openpyxl\__init__.py
    pandas 1.5.0 C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\lib\pandas\__init__.py
    xlsxwriter 1.2.9 C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\libs\site\packages\xlsxwriter\__init__.py
    Traceback (most recent call last):
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\bim\ui.py", line 260, in poll
        return tool.Ifc.get()
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\tool\ifc.py", line 38, in get
        return IfcStore.get_file()
      File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blenderbim\bim\ifc.py", line 78, in get_file
        IfcStore.path = bpy.context.scene.BIMProperties.ifc_file
    AttributeError: 'Scene' object has no attribute 'BIMProperties'
    Traceback (most recent call last):
    

    It's a cascade of errors, this is just a segment

  • edited November 2022

    I think you're missing registering the prop somewhere. depending on where you stored your props you may want something like

    bpy.types.Scene.bim_spreadsheet_properties = bpy.props.PointerProperty(type=prop.BlenderBIMSpreadSheetProperties)
    

    in register and

    del bpy.types.Scene.bim_spreadsheet_properties
    

    in unregister.

    Coen
  • edited November 2022

    @Gorgious

    Many thanks! I managed to get it integrated locally with the BlenderBIM add-on on the BlenderBIM tab. I need to refactor the code a bit , clean the mess before making a pull request.

    theoryshawtlangArvGorgiousAceDarth_Blender
  • Hehe I'm glad you finally made it happen :) You can ping me on github for help in the process, or review when you manage to upload it.

    Cheers

    Coen
  • @Gorgious

    Hehe I'm glad you finally made it happen :) You can ping me on github for help in the process, or review when you manage to upload it.

    Cheers

    It's available here for review:

    https://github.com/IfcOpenShell/IfcOpenShell/pull/2622

    AcetheoryshawGorgious
  • @Coen said:
    @Gorgious

    Hehe I'm glad you finally made it happen :) You can ping me on github for help in the process, or review when you manage to upload it.

    Cheers

    It's available here for review:

    https://github.com/IfcOpenShell/IfcOpenShell/pull/2622

    Great Job Coen!

    Coen
  • Hey @Coen
    I am busy pulling some areas using your spreadsheet writer, brilliant again, but It's not getting the NetFloorArea, out of the Ifc Space? I tried to add it as a custom value as [Qto_SpaceBaseQuantities.NetFloorArea] but with no success:
    Blender:

    Spreadsheet (no area values except for the windows):

    Anything I'm getting wrong with he syntax here?

  • edited December 2022

    @Ace

    You should remove the brackets and add press the add button once more. Then it will export.

    also, on youtube someone asked me if these PropertySets could be saved as a searchset, but doesn't IFCCSV also does something similar?

    Ace
  • https://github.com/C-Claus/BlenderScripts/blob/master/BlenderBIMSpreadsheet/3.4.1/BlenderBIMSpreadsheet341.zip
    Update of the BlenderBIM Spreadsheet add-on which will work on Blender 3.4.1
    Please let me know if it works.

    AceCadGiruMartin156131
  • edited May 2023

    I was looking for something like this or to make something similair myself, just tested it on an ifc model and it works really good!
    Only thing I noticed is sometimes the values under base quantities are not the correct values, is there any way to extract the quantity from the element and not from a pset?

  • @Pahlawan

    You bumped this old thread, the new release is to be found here:
    https://github.com/C-Claus/blenderbim_spreadsheet
    The idea is this should be integrated with BlenderBIM one day...

    Only thing I noticed is sometimes the values under base quantities are not the correct values, is there any way to extract the quantity from the element and not from a pset?

    Do you have an example? Not the correct value or no value at all? If there is no value at all you could try this:

  • @Coen said:
    @Pahlawan

    You bumped this old thread, the new release is to be found here:
    https://github.com/C-Claus/blenderbim_spreadsheet
    The idea is this should be integrated with BlenderBIM one day...

    Only thing I noticed is sometimes the values under base quantities are not the correct values, is there any way to extract the quantity from the element and not from a pset?

    Do you have an example? Not the correct value or no value at all? If there is no value at all you could try this:

    Nice just tried it and it's working great.

    Here's an example:
    The NetArea value under BaseQuantities is 0,59m2

    The correct value is shown in the quantites tab, an Area of 3,28m2 (Solibri)

  • @Pahlawan

    Is it possible for you to share your IFC? Maybe @Massimo could shed some light on this...? I have no Solibri, so I can't validate.

  • @Coen said:
    @Pahlawan

    Is it possible for you to share your IFC? Maybe @Massimo could shed some light on this...? I have no Solibri, so I can't validate.

    Can't share the entire IFC, but I've extracted the object as an example.

  • @Pahlawan said:

    @Coen said:
    @Pahlawan

    Is it possible for you to share your IFC? Maybe @Massimo could shed some light on this...? I have no Solibri, so I can't validate.

    Can't share the entire IFC, but I've extracted the object as an example.

    Does not open in BlenderBIM for me:

    e 1293, in clean_mesh
        obj.select_set(True)
    RuntimeError: Error: Object 'IfcSlab/BORDES' can't be selected because it is not in View Layer 'ViewLayer'!
    Location: C:\Program Files\Blender Foundation\Blender 3.5\3.5\scripts\modules\bpy\ops.py:113
    

    nor in BIMVision:

  • Hello @Pahlawan i tried to open the ifc file you posted and i get this error

    Could you send me the entire ifc by email so i can check?

  • edited May 2023

    @Pahlawan Btw, if it helps, quantities are just another psets with attributes. The schema says that the pset name should be "Qto_Name BaseQuantities" so for a slab it should be "Qto_SlabBaseQuantites".
    BBim can calculate and assign automatically the quantities.
    So, regarding your example, is NetArea calculated automatically or is it given in another way (like typed or imported from another software)?

  • @Massimo said:
    @Pahlawan Btw, if it helps, quantities are just another psets with attributes. The schema says that the pset name should be "Qto_Name BaseQuantities" so for a slab it should be "Qto_SlabBaseQuantites".
    BBim can calculate and assign automatically the quantities.
    So, regarding your example, is NetArea calculated automatically or is it given in another way (like typed or imported from another software)?

    The basequantities are exported from Tekla.
    What's your e-mail?

Sign In or Register to comment.