Yes Coen,
In the filters I tested, BlenderBIMSpreadsheet worker well with this model and libreoffice.
Good job, and thanks for your work.
Yes Coen,
In the filters I tested, BlenderBIMSpreadsheet worker well with this model and libreoffice.
Good job, and thanks for your work.
This is a bit outside of the scope of BlenderBIM so I will keep it short. I looked at several ways on how to apply an autofilter in LibreOffice. I asked the question on Stack Overflow. But no response. I am really stuck here.
On the other hand, I really would like to start integrating this add-on in the BlenderBIM add-on. I would like to do the communication about this out in the open, in this thread.
What I think I need to do first,
rewrite the add-on so it consists of an ui.py
and operator.py
?
git clone the ifcopenshell repo which contains blenderbim add-on?
start writing my code in there and do a pull request?
refactor the script
From now on I only will be able to work on the weekends on this project. No more lockdown, yay!
I have little to no expierence with collaboration on a software project. So I will ask a lot of noob questions.
Also, I barely got any feedback from people who use it. But I can see from my insights repo on github ithe following:
So, I think integrating it in the BlenderBIM add-on will expose way more users to this feature.
Last funny fact, from my Youtube Analytics I can see most viewers from the demo video are located in France, which I did not expect.
Well you can count me in these 2.1% ^^
From my very limited experience in software development, I'd say not having feedback is not always a bad thing, it may just mean that there is no bugs and people find it easy enough to use that they don't need any other information.
I think the integration into Blenderbim should be pretty straightforward, but you'd need to do some basic refactoring, mainly separating the UI code from the logic code, and also the operator code. You can snoop around in the existing blenderbim codebase and try to mimick a simple enough module and see where that gets you. Don't hesitate to post questions, open issues or discussions, it can benefit anyone ! It can be done iteratively. You can clone the github repo, create a new branch, make your changes on your local fork and create a PR even if it's not yet totally ready for merging, it can be helpful for other people to review your code by just cloning your branch then.
You'd also want to write some unit tests, but that can be arranged later I think.
@Gorgious said:
Well you can count me in these 2.1% ^^
From my very limited experience in software development, I'd say not having feedback is not always a bad thing, it may just mean that there is no bugs and people find it easy enough to use that they don't need any other information.
I think the integration into Blenderbim should be pretty straightforward, but you'd need to do some basic refactoring, mainly separating the UI code from the logic code, and also the operator code. You can snoop around in the existing blenderbim codebase and try to mimick a simple enough module and see where that gets you. Don't hesitate to post questions, open issues or discussions, it can benefit anyone ! It can be done iteratively. You can clone the github repo, create a new branch, make your changes on your local fork and create a PR even if it's not yet totally ready for merging, it can be helpful for other people to review your code by just cloning your branch then.
You'd also want to write some unit tests, but that can be arranged later I think.
Correct, it works and is discoverable?? no problem
Could it be useful as a standalone desktop app? Maybe it first finds all the ifc classes in a file and the user tick boxes the required output and press Go, the spreadsheet opens magic!
From the AotearoaNZ representation on your graph
I downloaded Blender 3.1.0 and the latest developer build of BlenderBIM blenderbim-220330-py310-win.zip
When trying to Install BlenderBIM spreadsheet.
I get the following error:
Read prefs: C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\config\userpref.blend
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 3.1\3.1\scripts\modules\addon_utils.py", line 351, in enable
mod = __import__(module_name)
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\BlenderBIMSpreadsheet.py", line 32, in <module>
import pandas as pd
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\__init__.py", line 22, in <module>
from pandas.compat import (
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\compat\__init__.py", line 15, in <module>
from pandas.compat.numpy import (
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\compat\numpy\__init__.py", line 7, in <module>
from pandas.util.version import Version
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\util\__init__.py", line 1, in <module>
from pandas.util._decorators import ( # noqa
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\util\_decorators.py", line 14, in <module>
from pandas._libs.properties import cache_readonly # noqa
File "C:\Users\cclaus\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\libs\site\packages\pandas\_libs\__init__.py", line 13, in <module>
from pandas._libs.interval import Interval
ModuleNotFoundError: No module named 'pandas._libs.interval'
I wonder if that only happens on my system, I have windows 10 with Python 3.9 installed. Does it default to my standard python installation?
Anyone else tried to install the BlenderBIM spreadsheet add-on on Blender 3.1.0?
I get the same error with the same setup > @Coen said:
Anyone else tried to install the BlenderBIM spreadsheet add-on on Blender 3.1.0?
@Ace
Thanks for the feedback, I needed to install the third party modules from Blender 3.1.0 again, because it's a different Python version (obviously).
I zipped the add-on for 3.1.0 and pushed it to Github, new version to be found here:
https://github.com/C-Claus/BlenderScripts/tree/master/BlenderBIMSpreadsheet/3.1.0
Works for me, and also on another machine with Windows 10 installed. :-)
I'd encourage you to start your installer with a check for the needed dependencies and come with a warning for users. We've had this problem with a few addins to blender which needed something as simple as numpy - it just happened that I didn't have it installed but knew how to.
Hi!!
Congrats and a huge thank you for all your work!!!
I've just started using the spreadshets addon, and have some issues with it not exporting custom parameters to excel.
I'm using the syntax Psetname.PropertyName, and it doesn't give any errors, but only exports general properties.
Any clues on what's happening? I'm in blender 3.1.
Thanks in advance!!!!
I'm using the syntax Psetname.PropertyName, and it doesn't give any errors, but only exports general properties.
Is it possible for you to share your IFC file and explictily state which properties you would like to export? ?
Hi, I'm using blender 3.1.2 and when I install it it sends me this message:
@Javier_Gutierrez it seems it's the exact same error as a few comments up the chain. Have you downloaded the updated version by @Coen ?
yes but I don't know if I'm missing something, I'm working on debian 11, and I downloaded this file
@Javier_Gutierrez
I see, I'm not too familiar with Linux distributions. You could try to install python pandas by opening the scripting console in Blender and run this script
import sys
import subprocess
py_exec = str(sys.executable)
# ensure pip is installed
subprocess.call([py_exec, "-m", "pip uninstall pip", "--user" ])
subprocess.call([py_exec, "-m", "ensurepip", "--user" ])
subprocess.call([py_exec, "-m", "pip install -U pip", "--user" ])
# update pip (not mandatory but highly recommended)
subprocess.call([py_exec, "-m", "pip", "install", "--upgrade", "pip" ])
# install packages
subprocess.call([py_exec,"-m", "pip", "install", f"--target={py_exec[:-14]}" + "lib", "pandas"])
I hope it will install pandas on linux and hopefully the add-on works.
I just tried to make an export from the Schependomlaan in Blender 3.1.2 with this version of BlenderBIM spreadsheet installed.
The IfcBuildingStorey does not export anymore to Excel, which is odd,
I have no other IFC files to test, if anyone could do, please :)
I am planning to refactor the BIM spreadsheet script anyway, seperate the script into an operator, ui and prop.
Then I would also like to integrate it with the BlenderBIM add-on. And write good documentation. Because I just looked at the script and get confused about what I wrote a few months ago...
Can I git clone and make a folder here which says spreadsheet?:
https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.7.0/src/blenderbim/blenderbim/bim/module
I never really collaborated on an open source project, I need to get familiar with git and the blenderbim architecture.
The BlenderBIM spreadsheet uses quite a lot of 'heavy' modules like xlsxwriter, pandas, ods. Where does BlenderBIM store all these third party dependencies if it's ever going to be integrated?
Plus I have no means and knowledge to test it on mac/linux.
@Coen in BBim there is a module called "demo" that explains how a module works.
You can find more details here:
https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/blenderbim/docs/devs/hello_world.rst
I think this it is very helpful to understand modules behind the scenes and it helped me a lot :-)
The dependencies of the BlenderBim addon are located in libs/site/packages
I'm just curious if this .zip works for Blender 3.3.3
@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
I've created a feature here for maybe a future pull request to add to the BlenderBIM add-on:
I want to test it locally on my system, but where do I add it the menu/UI to BlenderBIM?
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
@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
@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
operator.DemonstrateHelloWorld,
operator.DemonstrateRenameProject,
prop.BIMDemoProperties,
ui.BIM_PT_demo,
)
@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?
Login or Register to reply.