DXF Export
I successfully exported the floor plan and elevations to DXF, but I couldn't export the sections.
Python: Traceback (most recent call last):
File "C:\Users\Sahru\AppData\Roaming\Blender Foundation\Blender\4.4\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 3573, in invoke
return self.execute(context)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Sahru\AppData\Roaming\Blender Foundation\Blender\4.4\extensions.local\lib\python3.11\site-packages\bonsai\bim\module\drawing\operator.py", line 3602, in execute
tool.Drawing.convert_svg_to_dxf(drawing_uri, drawing_uri.with_suffix(".dxf"))
File "C:\Users\Sahru\AppData\Roaming\Blender Foundation\Blender\4.4\extensions.local\lib\python3.11\site-packages\bonsai\tool\drawing.py", line 2321, in convert_svg_to_dxf
path = path.attrib["d"]
~~~^^^^^
KeyError: 'd'
Comments
@theoryshaw
@sahrul That looks like a bug. Maybe report it at https://github.com/IfcOpenShell/IfcOpenShell/issues ideally including your file. If your file cannot be publicly shared, there is a explanation in the bug template on how to share the file just with the core developers.
Hard for me to say, without the file.
It might be a bug. I suggest posting a github issue, and then sharing the file via this link, if it's private.
...
It appears you are saving both the blend file and ifc file together. Do you get this same issue, if you open the .ifc anew?
From briefly looking at the code, the dxf converter expects every svg path element to have a "d" attribute, so it doesn't do any checks. For some reason your svg file has at least one path element that does not contain a "d" attribute, so instead you get the above exception.
From https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorials/SVG_from_scratch/Paths a path only has the "d" attribute, so how you got an svg with an empty path is a bit strange.
I have tried to open IFC but it still gives error
I'm using a recent nightly build, and I can create the NORTH SECTION svg drawing, and convert to dxf no problem.
Hmmm. Can't attach a dxf here. Boooo.
Here's the dxf loaded into freecad:

Worked for me.
Attached dxf. Just remove
.txt
suffix....
BTW, you might want to try this approach, as it translates the IfcClasses into CAD layers.
BTW here's 2 ways to install daily releases...
from: https://hub.openingdesign.com/OpeningDesign/Bonsai_Tutorials
online docs: https://docs.bonsaibim.org/quickstart/installation.html
NORTH SECTION, exported dxt successfully, but NORTH SECTION-X error

OK, so I dug a bit into the svg produced, and for reasons I do not know some "path" tags are entirely empty, i.e.
<path/>
This is valid xml, but I don't think it is valid svg as a path should have a d attribute. The dxf exporter assumes a path has a d attribute. I can "fix" it using a simple exception catch, but that is not the real problem. The real problem is why is Bonsai writing empty path tags to the svg?
@sahrul You really need to raise a bug, as the svg serializer that produces the source svg output is a bit beyond me. You can point to this discussion for background in the bug.
Specifically you have a bunch of IfcMembers that have two path components, one of which is empty. Other IfcMembers in the file only have a single path component, so it is not all IfcMembers that are wrong.
Hmmmm... every IfcMember with an extra empty

<path/>
is a RENG BARU:Even more info: The Bisect cutting mode when generating the section is what causes the issue. Try changing it to OpenCASCADE, recreate the drawing, then convert to dxf.
For future browsers, this was raised as https://github.com/IfcOpenShell/IfcOpenShell/issues/6871
i tried and it worked, thank you @sjb007