Repository navigation
dwg2qet: DWG/DXF → ready-to-wire QElectroTech elements (terminals on the grid, BOM data, cabinet front views, batch libraries) #1452
Replies: 7 comments 4 replies
|
Hi David, wow, you are welcome! |
|
Thanks David, I want to see more complex element like see SEW MOVIDRIVE, or MOVITRAC by example? |
|
Good job, David. |
|
Im building stuff and i wonder if anybody is even using it or finding it usefull Posts like this feed the devoloper |
|
Interesting project, there are some things you seem to have added that I've been wanting to add to dxf2elmt, but I just haven't had the time to get around to them. |
|
@DP5000 If you could create binaries for Linux, macOS and Windows, we should be able to add a new entry such as ‘dxf2elmt’ in the element editor. |
|
Hi David, I had a closer look at the code (commit 640bca6): it’s clean, readable, standard library only, and the 12 tests pass. Using LibreDWG instead of ODA is a good choice too. A few points I noticed: Random UUIDs in dwg2qet: the element and its terminals get uuid4() (lines 1078 and 1106), while terminals2qet already uses deterministic uuid5. When a collection is regenerated, every UUID changes, which is a problem for elements already used in projects. This is the most important point; could dwg2qet use uuid5 too, built from the source file/block name and the terminal name? Nothing blocking apart from point 1, which I’d like fixed before integrating it. About your question on integration: QElectroTech already ships Python for qet-mcp (misc/qet-mcp, and a bundled Python in the Windows installer). Since dwg2qet only needs the standard library and already has -v mimicking dxf2elmt, we could ship it next to qet_mcp.py (as a git submodule), call it from the element editor’s DXF import with a fallback to dxf2elmt, and expose it as an MCP tool as well. What do you think? Thanks again for this work! Laurent |




Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I made a small open-source converter, dwg2qet (MIT, Python 3.9+, standard library only): https://github.com/DP5000/dwg2qet
It complements dxf2elmt. Besides the geometry, it writes elements you can wire straight away and use in a bill of materials:
dwg2dxf;--check-elementspasses;%{label}/%{comment}fields;thumbnailmode: cabinet front view at a fixed px per mm (default 2);--check-elements.I tested it on a manufacturer CAD library (AutoCAD blocks, not redistributed): 433 single-line and 492 multi-line symbols plus 3,582 front views gave 16,959 article elements.
qelectrotech --check-elementsreports 0 failures (0.200.1 r10833, macOS). Contactors (A1/A2 coil, main and auxiliary contacts), RCDs and breakers come out with the right terminal names.It works well with qet-mcp: an assistant searches the converted collection and places and wires the elements with
qet_edit. Thanks @ispyisail for the quick fix in #1451.Two questions:
Feedback welcome.
David (electrical contractor, Slovenia)
All reactions