BlenderBIM spreadsheet add-on new release.

The last half year I've re-written the BlenderBIM spreadsheet addon from scratch. Using the ifcopenshell.api and experimenting with python to get as fast exports as possible. With the aim it's going to be merged into the BlenderBIM add-on one day.


You can download it here

https://github.com/C-Claus/blenderbim_spreadsheet#readme

New features:

- Every IfcMaterial definition now exports as it should.

- IFC4 support.

- Possiblity to save and set user interface settings with custom properties in a .json file.


Improvements:

- Faster export

- Focus on Libre Office Calc (see Youtube demo)

See more detailed information about the usage in this youtube demo.

tlangbitacovirtheoryshawMartin156131GorgiousAcebruno_perdigaoPavlosDem9GerardThtlcnnand 2 others.

Comments

  • And thanks @Gorgious for all the help :-)

    Gorgious
  • You are amazing @Coen !

    Coen
  • @Coen thanks for your work! In the video you mention a macro for libreoffice, could you elaborate? The spreadsheet add-on looks mature to me, any apparent reason not to merge into BlenderBim today?

    Coen
  • @tlang

    thanks for your work!

    Thanks 😊

    a macro for libreoffice, could you elaborate?

    I tried to create an autofilter and table from python within the spreadsheet add-on, unfortunately I could not find any good python libraries which are able to do this. For .xlsx it seem to be no problem with pandas. But I wanted to focus on Libre Office Calc, because I think it's a good open source alternative to MS Excel. When I was testing the add-on it seems MS excel does not always return valid xml files, while .ods files in Libre Office Calc do. So I even tried to modify the xml file in the .ods file to create an autofilter and table. I abandoned the idea halfway because it became way too complex for me, however I still think it should be possible. I decided to create macro in LibreOffice instead, which runs under my own defined hotkey. It's just a matter of pressing record macro in LibreOffice which creates this script. I also tried if I could run this macro from the blenderbim spreadsheet add-on. Again I could not find good libraries and it also got too complex for me with different operating systems.


    The macro and it's outputted code:

    REM  *****  BASIC  *****
    
    
    sub Main
    rem ----------------------------------------------------------------------
    rem define variables
    dim document   as object
    dim dispatcher as object
    rem ----------------------------------------------------------------------
    rem get access to the document
    document   = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    
    rem ----------------------------------------------------------------------
    dim args1(0) as new com.sun.star.beans.PropertyValue
    args1(0).Name = "By"
    args1(0).Value = 1
    
    dispatcher.executeDispatch(document, ".uno:GoDownToEndOfDataSel", "", 0, args1())
    
    rem ----------------------------------------------------------------------
    dim args2(0) as new com.sun.star.beans.PropertyValue
    args2(0).Name = "By"
    args2(0).Value = 1
    
    dispatcher.executeDispatch(document, ".uno:GoRightToEndOfDataSel", "", 0, args2())
    
    rem ----------------------------------------------------------------------
    dim args3(0) as new com.sun.star.beans.PropertyValue
    args3(0).Name = "aFormatName"
    args3(0).Value = "Box List Blue"
    
    dispatcher.executeDispatch(document, ".uno:AutoFormat", "", 0, args3())
    
    rem ----------------------------------------------------------------------
    dim args4(0) as new com.sun.star.beans.PropertyValue
    args4(0).Name = "VerticalAlignment"
    args4(0).Value = 1
    
    dispatcher.executeDispatch(document, ".uno:VerticalAlignment", "", 0, args4())
    
    rem ----------------------------------------------------------------------
    dim args5(0) as new com.sun.star.beans.PropertyValue
    args5(0).Name = "Sel"
    args5(0).Value = false
    
    dispatcher.executeDispatch(document, ".uno:GoToStartOfRow", "", 0, args5())
    
    rem ----------------------------------------------------------------------
    dispatcher.executeDispatch(document, ".uno:DataFilterAutoFilter", "", 0, Array())
    
    rem ----------------------------------------------------------------------
    dispatcher.executeDispatch(document, ".uno:HideColumn", "", 0, Array())
    
    
    end sub
    


    The spreadsheet add-on looks mature to me, any apparent reason not to merge into BlenderBim today?

    I really would like to, but maybe I'm wrong, but I don't think BlenderBIM comes shipped yet with the pandas and openpyxl module which are heavily used in the spreadsheet scripts? Maybe @moult could enlighten me. :) And it's quite a lot of code to be reviewed in one pull request, I'm not so experienced with collaborating on open source software code yet. I definitely will look into it and with the experienced developers reviewing it I think it could only get better before it's merged into BlenderBIM one day.

    tlang
  • I'm very happy to see your project flourish like that ! I'm sure we can work something to integrate it into Blenderbim, if not natively at least with optional dependencies.

    Coen
  • @Gorgious said:
    I'm very happy to see your project flourish like that ! I'm sure we can work something to integrate it into Blenderbim, if not natively at least with optional dependencies.

    Thanks! I learned so much from you. I already went into the osarch matrix chat to ask some househould things. The ifcopenshell/blenderbim repo can be a bit intimidating for me because there is so much going on.

    One note, for my 'real' job I am learning Microsoft Certification called AZ-400 Desiging and Implementing Microsoft Devops Solutions. It's all for free. In some chapters they are explainig braching strategies, git. source control, Github Actions workflows. For the rest it is obviously Microsoft focused. But some chapters are really useful for understanding on how to collaborate on big open source projects and to understand what's going on in the IfcOpenShell project.

    I think a really cool feature for the Spreadsheet add-on would be stored views with the filtering of IFC elements. As was discussed here:
    https://community.osarch.org/discussion/1402/ But I'm severely limited by my Blender knowledge.

  • There is a new release of the BlenderBIM Spreadsheet add-one with some bugfixes regarding IFC4 BaseQuantities and the possibility to export multiple classifications with IFC2x3 support.

    You can download it here:
    https://github.com/C-Claus/blenderbim_spreadsheet/releases

    See a quick demo with some new BlenderBIM functionality relevant for BlenderBIM spreadsheet add-on

    Looking forward to the IFCCSV demo, I think there's a lot I can learn from.

    Tested this against Blender 3.6.2 on two different machines and with the latest release of the BlenderBIM add-on installed.

    Please let me know if it works.

    MassimoNigelAndrej730Owura_quMoult
  • I like the idea of browsing the data in .ods and synchronizing the visibility of elemends in BBIM, it's like a very cool filter with visual representation for the data you're currently investigating in the table.

    NigelCoen
  • edited August 2023

    @Andrej730 said:
    I like the idea of browsing the data in .ods and synchronizing the visibility of elemends in BBIM, it's like a very cool filter with visual representation for the data you're currently investigating in the table.

    A next cool step would be, l if an Blender add-on could be made inside a docker container or something similar, with a live connection between the IFC and spreadsheet. So if a change is made in either the IFC in Blender or in the table it would update both ways. Some advantages would be you don't have to save the IFC each time after an modification, and don't have to export a new spreadsheet each time after saving the IFC.
    Plus because you're using a container, hopefully preventing conflicting dependencies/modules. And maybe it's possible to already ship/install LibreOffice Calc or something similar inside that container with the Blender add-on. So end users don't have to configure or install it themselves.

    Unfortunately I have no idea if it's possible to run a blender add-on inside a docker container or if it's technically possible. Definitely worth investigating. Someone somewhere must have already attempted this, however I can't find any documentation. I could only find running Blender itself in an container, I would like to run only the Blender add-on in a container.

    Ace
  • Unfortunately I have no idea if it's possible to run a blender add-on inside a docker container or if it's technically possible

    Haven't worked much with Docker but if someone managed to run just Blender then it's definitely possible to run it with some addon - Blender by default is using bunch of addons, for example Cycles Render Engine is just an addon too. So some addon can be enabled by either opening userpref.blend and enabling the addon or from python code (addon_utils.enable / bpy.ops.preferences.addon_enable) or with --addons command line argument starting Blender.
    Plus BlenderBIM has bunch of tests that run in background mode regularly so I guess it will be possible to run it from docker too.

    AcetheoryshawCoen
  • @Andrej730

    Would it be possible to have a "live" connection between IFC and a spreadsheet. Let's say a POST or GET request eacht time after the user modifies the IFC (editing data or geometry) So the spreadsheet is listing and gets updated with a new record.. I don't think it should impact performance in Blender itself? But how would I know whenever the end-user modifies the IFC?

    Ace
  • @Moult
    Or any other knowledgable developer.

    Does the BlenderBIM add-on now comes shipped with pandas module included? If I understand correctly
    As seen in this line of code:

    https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/blenderbim/Makefile#L387

    Same for openpyxl ?
    https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/blenderbim/Makefile#L388

    Does this mean I could fork the ifcopenshell open repo to start the integration of blenderbim spreadsheet to integrate it into BlenderBIM if there's still a demand? IFCCSV is also around which kind of does the same thing.

  • Indeed, we now ship with pandas, openpyxl and odfpy.

    CoenJohn
  • @Moult said:
    Indeed, we now ship with pandas, openpyxl and odfpy.

    From the release notes:

    You can also quickly select similar items by shared properties or attributes using a new "Select Similar" panel.
    
    The same search filtering system can be now used with IfcCSV and is also used in all filtering, include, and exclude systems such as in drawing filters or IfcPatch extract element filters.
    
    The element query syntax also now supports counting, fetching style data, and specific spatial structure elements (e.g. going straight to the storey and bypassing intermediate spaces).
    
    This makes IfcCSV much more flexible. In addition, IfcCSV now supports custom table headers, multi-column sorting, grouping by value, group operations (such as count, sum, average, concatenate, etc), custom values for null and boolean fields, and a summary row for total counts / averages / etc. You can also specify custom formatting functions (e.g. force uppercase, lowercase, imperial formatting, etc). Columns can now be easily reordered. IfcCSV can also now export to three formats: CSV, XLSX, and ODS in the BlenderBIM Add-on interface. There is also now Pandas support when used programmatically.
    

    This makes the BlenderBIM spreadsheet add-on obsolete?

  • There is still quite a bit of work to be done, such as:

    1. Field autocompletion so people don't misspell things.
    2. Preset schedules so people can "one click schedules".
    3. A few more functions like substr.
    4. Attribute / Pset wildcard expansion so you can export "all possible properties in a pset" or "all possible psets", etc.
    5. Smoother integration with drawing schedules so that you can get it updated easily on sheets.

    Until these are done, there is quite a bit of technical knowledge still required to use IfcCSV effectively, so I think a the BBIM spreadsheet add-on is still very much relevant.

    Coen
Sign In or Register to comment.