Soliciting Funds: An inkscape extension to export dxf with layer information from BlenderBIM svg

edited February 4 in General

Collaboration often involves sharing 2D drawings in dxf format, so people can work in their favorite program. Tipically the drawing elements are organized with layers with different colors, lineweight and linetypes. This is important for increased readability and easily change visibility, lock or unlock parts of the drawing and so on.
Currently, dxf files exported with Inkscape from svg generated with BlenderBIM doesn't contain any layer information.
This project is looking to solicit the funds to help develop an Inkscape extension that allows:
1. Create Inkscape layers from svg elements associated with different IFC classes made with BlenderBIM
2. Allow configuration of the layers attributes (name, color, lineweight, linetype) for each IfcClass
3. Export to dxf with layers information



This has been discussed in the following locations:

As you can see in the links above, there has already been some work in the regard. With this project, we hope to build off this initial work and it will be useful when implementing direct dxf export from BlenderBIM

theoryshawMassimobdamayatomkarincaAcetlang

Comments

  • edited February 4
  • edited February 5

    FWIW it should be relatively straightforward for someone familiar with both svg syntax and ezdxf API to write a converter. I'll share a test I worked on some time ago. I eventually elected on directly writing to dxf from the 3D blend file because I personally don't have a use for svg and it doesn't translate 1:1 to the dxf syntax. for example in a svg an object can be part of any number of classes but in dxf an object can be in only one layer.

    I'll drop the link. Do with it what you wish, the current implementation translates polylines, hatches and texts. Hatches are translated to solid, not patterned, same for lines, they're continuous. https://github.com/Gorgious56/svg2dxf/blob/main/convert.py

    Bedsonelschilling
  • Update implementing a new ezdxf based inkscape exporter extension.
    Basic functionality is done thanks to @Gorgious input and adapting from the existing DXF exporter. Still need to add lineweight, linetype and save/load settings options.
    Video:
    https://www.dropbox.com/scl/fi/jsjf2tqq28xk63xp4skz9/2024-02-14_13-40-38.mp4?rlkey=7cu96f0b1rka949kor5zjxapu&dl=0

    theoryshawMassimoNigelAceatomkarincaGorgioussteverugi
  • @elschilling nice work to you all. Will the save/load settings be an external text file that can be edited externally? It is good to have a 'save settings' file for each recipient of the exported drawing so they can be customized to their needs.

    elschilling
  • edited February 18

    @Nigel said:
    Will the save/load settings be an external text file that can be edited externally? It is good to have a 'save settings' file for each recipient of the exported drawing so they can be customized to their needs.

    Yes. It is possible to have multiple export settings saved as json files that can be edited externally or with the inkscape extension GUI.
    Here is an update:

    • Export settings GUI

    • Export settings JSON file

    • Result DXF exported

    The extension is available here
    To install copy the ezdxf_exporter_effect.inx and ezdxf_exporter_effect.py to your inkscape user extensions folder and install ezdxf library with pip install ezdxf
    After that there should be a new option called IfcClass exdxf exporter available at Extensions > Export menu
    Next I will implement text and hatch support.
    Any help testing and feedbacks are appreciated

    NigelMassimocarlopavtheoryshawbitacovirDarth_Blender
  • I've packed all dependencies into a zip file for easy installation. Just extract it to the Inkscape user extension folder.
    Tested it on Windows 10

    theoryshawMassimoNigelcarlopavAce
Sign In or Register to comment.