1

(154 replies, posted in Code)

I know there has been talk about cutting a new release, and whether it should be done once ported to Qt6 or before.

Considering the number of changes since the last official release, I would be in favor of making a release now before the Qt6 port, and then another once the port to Qt6 is done.

Another random note, last I looked the most recent git version when trying to use the DXF importer links to Antonio's github to download dxf2elmt. It's probably worth updating to mine so people are being pointed at the most up to date version of dxf2elmt. Since my laptop died right before I went on holiday, I'm not in a good spot to try and submit a pull request with the update myself right now, but perhaps I can get to it next week when I'm back unless someone wants to update it in the mean time.

2

(154 replies, posted in Code)

Joshua wrote:

Hello, during my vacation I tested switching to qt6 and kf6 on a new branch based on the master (with a mix of commits from the qt6 cmake branch). It's not quite finished yet, but it's coming along nicely. However, I have no problems with the KF6 libraries. Why remove kautosavefile and kwidgetaddon, only to reimplement them ourselves? I don't see the point. I would much rather keep code from KF6, which has been extensively corrected and tested, than reinvent the wheel. Have I missed something?

Hi Joshua,

As a whole I agreed, the KF6 libraries are pretty well tested and if they can be used instead of re-implementing them it makes sense. Why take on the extra work and possibly introduce bugs, if it's not necessary.

My main question here comes down to Windows. As I understand it KF6 can build on Windows, but I haven't succeeded yet. I was trying to get QET building on my Windows based work machine to see what I could do to help with the Qt 6 progress. The sticking point was KF6, the Windows build instructions that have been mentioned in the forum use vcpkg. Vcpkg only has KF5, and I found some issues and forum posts, it doesn't look like KF6 is coming to vcpkg any time soon. I started looking into getting KDE Craft set up so I could compile KF6 on Windows and maybe getting it working with a Qt6 version of QET, but didn't get it working before I went on vacation (I didn't bring my Windows based work laptop with me, and I won't be back for another few days).

If I recall correctly Laurent said somewhere in the forums that the official Windows release is cross-compiled from Linux. If that is the case, and it's working fine with Qt6 and KF6, than perhaps getting QET and KF6 building directly on Windows isn't that big of a deal, although I think it would be nice to actually be able to build the program on Windows itself.

Have you tested your branch on Windows, or tested cross-compiling it?
Is this branch publicly available if I wanted to try and do some testing on it?

3

(10 replies, posted in Import DXF)

rvamerongen wrote:

Any luck with your progress?

Yeah, I never updated this forum post, but I probably should have. I got this resolved and released 0.5.0 about 2 months after that last comment with support for nested blocks and whole bunch of other changes.

The newest release is 0.5.1 (minor bug fix release), and I actually have some other changes that I've been meaning to finish testing and release. I was hoping to do it over the holidays while I was visiting family, but my laptop died a few days before I left..

if you grab the latest version and you are still having issues, please let me know, I'll try and get it fixed.

plc-user wrote:

Let's test it out and discuss it! However, we should change forums: it's not finished yet, so it's not ‘new’ yet. That's why the ‘Code’ section is probably the most appropriate place for this discussion.

Agree the Code forum is probably the better place, I just saw Laurent's comment about Qt5 support and thought I would chime in, see what I might be able to do getting a Qt6 release completed.


Joshua wrote:

This would be an opportunity to release a new stable version (with some polish, and disabling the terminal strip manager for the release).

I think that's a good idea. I believe getting a proper release with Qt6 should be a high priority considering both the state of Qt5, and since it has been a while since an official release was made.

scorpio810 wrote:

this has only been reported here on the forum and on Github issues; there doesn't seem to be any entry in Mantis.
https://qelectrotech.org/forum/viewtopi … 089#p21089

Thanks this gives me a place to start looking.

scorpio810 wrote:

Emil have writted a new documentation for compile it under Windows with Qt6.9 if some one can try?
https://github.com/EmilOsvoll/qelectrot … d_Guide.md

I'll give it a go. While I'm not a fan of Windows, unfortunately my work laptop is running Windows 11. While I haven't done any in a while, I do have it set up for Qt development, so hopefully it won't be too much trouble to get it compiling.


scorpio810 wrote:

As indicated by plc-user, the master and qt6-cmake branches have diverged significantly. Merging the master branch into the qt6-cmake branch causes many conflicts that must be resolved manually. I tried, but I got confused... my knowledge of GIT is limited.

plc-user wrote:

- I don't know a schedule for the switch to QT6 and am very curious myself to see how the two GitHub branches will come together, given how many changes have been made to both branches in the meantime...

I'm certainly not a git expert either, but I'll start by trying to get the existing qt6-cmake branch compiling, and then see what I can do from there.


Appreciate the help, hopefully I can get something useful going.

Hi Laurent,

I have wanted to try and spend some time contributing to the main QET program, in addition to dxf2elmt (which I need to get back and do some work on).

Are there a specific set of Issues in the Mantis tracker related to getting things working in Qt 6 I could look at or start working on? I'm not real familiar with Mantis, but doing a quick search for Qt 6 I didn't find anything.

Would I just be better off attempting to compile it with Qt6, see what breaks and go from there?

7

(209 replies, posted in Import DXF)

Hi joao.silveira

joao.silveira wrote:

I’m a beginner when it comes to programming, and I’m not managing to use the software. Do you have any tutorial on how to use this software on Windows? If you could help me, I’d be very grateful.

I don't have a tutorial specifically but I can try and walk you through some steps quickly
- Launch QElectrotech
- Under Collections->User Collection (typically on the right hand side of the QET Window) right click on User Collection
- Click "New Element" in the pop up menu
- Select the folder you wan to put it in and click "Next"
- give it a file name, and click "Next"
- give it an element name, and click "Finish"

This will launch the Element Editor. From the Element Editor Window follow the below steps
- File->Import a dxf
- If you don't have the dxf2elmt software placed in the correct folder, it will open a popup window saying it can't find it. There will be a download button, which you should probably ignore, and a button to open the installation folder. Click that and drop a copy of dxf2elmt in that folder (there are Windows and Debian versions you can download from https://github.com/Vadoola/dxf2elmt/releases, and scorpio810 has attached some MacOS versions up a few comments in this thread).

Once you have the dxf2elmt program installed in the correct folder:
- go to File->Import a dxf
- In the popup select the dxf file and click ok.

That should pretty much be it, but you will need to add terminals and such yourself to connect wires to them in QElectrotech.




joao.silveira wrote:

For this type of application, can I use the program that converts DWG into ELMT? And how do I use this program?

The dxf2elmt program specifically converts DXF files, NOT DWG files. If you only have a DWG file you would need to convert it to a DXF first, there are some various programs available to do this, LibreCAD and QCad should be able to, I believe FreeCAD as well, but have less experience with it.

Hopefully this helps.

8

(209 replies, posted in Import DXF)

Salut Christophe,

totofe64 wrote:

I need to use recent KNX MDT modules and theses modules are not in default QT library.
So I would like to convert dxf files provided by MDT to elmt files.

I use the last version binary dxf2elmt.exe downloaded from this topic link. Not sure this is the last binary version regarding github speaking about 5.0.1. Unfortunately, except error, I dont found the 5.0.1 Windows X64 bnary.

C:\Users\christophe\Downloads\dxf2elmt>dxf2elmt.exe --version
dxf2elmt 0.4.0

I obtain an elmt file only with polygon object from the attached dxf file.

Any help would be very appreciated.
Best regards
Christophe

Version 0.4.0 is not the latest version. The latest version is what Laurent linked above and is version 0.5.1.

I actually just noticed that I forgot to bump the version in the cargo.toml file, so even though it is version 0.5.1, if you run dxf2elmt --version it will say it's version 0.5.0. There were some large changes and new features between 0.4.0 and 0.5.0 so it's possible the file that is failing in 0.4.0 will work in 0.5.0.

I'm not seeing any linked dxf files, and a quick glance shows several versions of KNX MDT modules. If it still fails to convert correctly once you download 0.5.1 can you link to the dxf files so I can find out where it's failing and try to fix it?

Thanks

sstteeff wrote:

Bonjour,

J'ai été chez Harting, mais il n'ont pas de fichiers .elmt   juste du DXF, mais impossible à charger dans qElectroTech malgré l'ajout du logiciel dédié.

English

As the maintainer of dxf2elmt, I would also ask what issue did you find getting the dxf to load? Was it installing the dxf2elmt plugin? Was the plugin failing to convert anything?

If the problem is with dxf2elmt itself, and you can link me to the dxf files you were using, I'll take a look and see what might have been going wrong.


Machine Translated - Traduction automatique
En tant que mainteneur de dxf2elmt, je voudrais également savoir quel problème avez-vous rencontré lors du chargement du fichier DXF ? Était-ce l'installation du plugin dxf2elmt ? Le plugin n'a-t-il pas réussi à convertir quoi que ce soit ?

Si le problème vient de dxf2elmt lui-même, et que vous pouvez me donner le lien vers les fichiers DXF que vous utilisiez, je vérifierai ce qui a pu poser problème.

10

(209 replies, posted in Import DXF)

Salut Laurent,

I don't have the binaries up on the release page yet, but I've fixed the bug that was causing you issues running it from QElectrotech on your Mac.

If it can it creates the log file, but if it fails, it just skips it and logs to stderr.

https://github.com/Vadoola/dxf2elmt/releases/tag/v0.5.1

11

(209 replies, posted in Import DXF)

scorpio810 wrote:

macOS arm64 binary

Btw, it's run well only CLI on terminal, on GUI import DXF segfault...

thread 'main' panicked at src/main.rs:65:58:
called `Result::unwrap()` on an `Err` value: Os { code: 30, kind: ReadOnlyFilesystem, message: "Read-only file system" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Are you only getting that on the Mac? Or on other machines too? It's interesting that it's only happening when being called from QET and not from the CLI.

Either way I see what the issue was. I finally added a bit of logging trying to troubleshoot some issues with the nested blocks. A bit of poor error handling on setting up the logging slipped through to the release....ah actually I think it makes sense now depending on exactly how you are running it. By default it just creates a dxf2elmt.log file in the same folder as the exe. If you have write permissions on the folder when running it from the CLI, no problem. If it doesn't have write permissions for the folder where the plugin is run from it will probably get that ReadOnlyFilesystem error, and then the poor error handling for the logging file is causing it to panic and halt execution. I'll see if I can get a bug fix release out shortly.

Do you know what the typical logging system on MacOS is? On Linux of course you have syslog, or the systemd journal. Windows you could use the Event System....The last Mac I used consistently was PowerPC based, so I don't really know the system well now. Trying to figure out what options I have for logging other than just creating a log file.

12

(209 replies, posted in Import DXF)

plc-user wrote:

Hi vadoola!

Can you please create win- and/or Linux-Binaries for dxf2elmt and put them also into the release at github?
So everyone gets the Software from "first hand"!

Yeah, I have no experience or familiarity with Github CI. I've been trying to hobble something together by copying how some others have done it, and have been completely unsuccessful. I probably need to set aside some time to sit down and learn it properly. The hope of course is that I can get it set up, and when a release is made CI will generate the binaries and attach them to the release.

For this release it will probably be faster and easier to just manually create them myself and get them uploaded.

13

(209 replies, posted in Import DXF)

Salut Laurent, Hallo plc-user,

I know it's been a while since I've been around. I hope everyone is doing well. I've had a lot going on, as well as a few injuries unfortunately that slowed down development for a bit.

There could be some other issues with it still, but I'm pretty happy with the nested block support as it stands currently. As there were a fair number of changes for this support, plus other things that have changes since the last release was cut, I decided it was worth marking as a new release. So version 0.5.0 was released about an hour ago.

Let me know if you find any specific issues with it.

14

(10 replies, posted in Import DXF)

NolanCarthy wrote:

Try checking DXF version compatibility or exporting with different settings.

The problem was that dxf2elmt didn't yet support nested blocks. I have a separate branch where I'm working on this. I actually had it working for this specific drawing, but I have another drawing with more deeply nested blocks and different scaling as they are nested. So far my attempts to get this working either correctly import one drawing or the other. I need to spend a bit more time to get it all working more consistently.

15

(209 replies, posted in Import DXF)

Wow...2.8MB that's a big dxf, Looks like it has a whole lot of blocks. Should be a good test drawing to find some deficiencies in dxf2elmt hopefully.

16

(209 replies, posted in Import DXF)

plc-user wrote:

Hello vadoola,

the file pxc_2700975_11_00_ILC-171-ETH-2TX_2D.dxf from Phoenix Contact seems to be a real challenge!
When converting exploded drawing from LibreCAD, the controller is found outside the drawing-area of the A3-sheet.
It is (of course) copyrighted, so no re-distribution here: --> Downloads --> Technische Zeichnung

Thanks I'll take a look at it.

17

(209 replies, posted in Import DXF)

Salut Laurent, Hallo plc-user,

And to anyone else willing to help out.

I created a branch to try and finish up on the issues with nested blocks: https://github.com/Vadoola/dxf2elmt/tree/nested_blocks, as originally brought up at https://qelectrotech.org/forum/viewtopic.php?id=2890

While there are still some minor issues (like text positioning but that's not exclusive to blocks), so far in my testing with a few files it seems to be pretty good.

If anyone has some good dxf files with nested blocks they want to test against let me know. I'll try and wrap up some of those minor issues, and merge it back into the main branch soon.

18

(209 replies, posted in Import DXF)

plc-user wrote:

@vadoola:

As also discussed in the other thread:
We are about to ship a few free fonts with QET. Among them is “osifont” which is often used as a font for CAD applications.
What do you think about specifying “osifont” as a font in converted elements for which no font is specified in the DXF?

When I look at the title block of the well-known “Wet Location Grip” file in LibreCAD and compare the font with “osifont” in QET, the font fits much better than a sans serif font.


Would like to have attached a screenshot, but something's still wrong with forum-settings: I cannot attach a file!

I've never heard of IS0 3O98, it looks like it's mostly a European thing, but it looks similar to other fonts I've seen used by AutoCad even outside of the Europe. I agree based on that screenshot you sent it does look a lot closer to what is being used by CAD that the Sans Serif font. Setting the default to "osifont" should be pretty straight forward. I'll see if I can do it tonight.

19

(8 replies, posted in Import DXF)

Salut Laurent, Hallo plc-user

Since it's unlikely that Antonioaja will be working on dxf2elmt going forward and and my fork has diverged quite a bit at this point, I was considering on disconnecting my fork from his. I still plan on giving him full credit for the work he did, and will update the Readme to link back to his repo, I just wanted to separate the fork.

There are some things I need to consider, I thought I saw somewhere that it might ruin any issues you have, but I'm not sure. Either way in order to separate it from Antonio's fork my repo can't have any fork's itself. Would you two be willing to delete the forks you have made from my repo so I can separate it from Antonio's? Then you can refork it if you need to.

20

(154 replies, posted in Code)

plc-user wrote:

The font-info-string is documented in Qt-docs: https://doc.qt.io/qt-5/qfont.html#toString (same for Qt6)
There it says, that it's a string of 16 entries.
But as we see in our element-files, the font-info-string is build with only 10 comma-separated entries.

Maybe that's what I was remembering that it was documented but wasn't quite right because the number of comma-seperated entries didn't match.

I looked into the Qt5 code to make sure the font string in dxf2elmt was being generated the same. I never looked at the Qt6 code since it wasn't relevant at the time. Looking at the doc for QFont::toString() in Qt5 and Qt6, it's identical, so I'm not really sure what the difference is or why it would have changed in the code. I'm just assuming the Wireshark issue is correct and there was a change however, and it might effect a future Qt6 version of QET, so it's good to be aware of it.

21

(154 replies, posted in Code)

Hello everyone,

A few months ago when I was looking to improve the font handling in dxf2elmt, I was trying to figure out what the font info string in the XML file is. I noticed it was using a built in method on QFontInfo that writes it out to a string, and I had to go dig into the Qt Source code to figure it out, as it appears to be undocumented.

I bring this up because back when I was researching this I came across this bug in Wireshark, that says the FontInfo string is not backwards compatible between Qt5 and Qt6: https://gitlab.com/wireshark/wireshark/-/issues/18553.

I forgot about it until just now when discussing a pull request plc-user made for dxf2elmt about text positioning. I just wanted to bring this to your attention since you guys are working on compiling it with Qt6, it's possible something will need to be done to make sure the font info from elemt files created with a Qt5 version works correctly with a version compiled with Qt6.

22

(7 replies, posted in Elements)

plc-user wrote:

Another reason to try to sort arrtibutes in element-file.
That's why valoola and I should use the same order for attributes in output of dxf2elmt and QET_ElementScaler. Seems that we do...


Good to know that we do, it was completely accidental, I mostly just stuck with the same general ordering of attributes Antonio was using in the original version. I'll try to make sure it stay's in sync with what QET_ElementScaler does.

23

(10 replies, posted in Import DXF)

So I did a quick look, I never quite finished the logic for nested blocks, so that is the problem here. I'll add it to the to do list. Thank you.

24

(10 replies, posted in Import DXF)

plc-user wrote:

The dxf contains Blocks in Blocks in Blocks in.....
That's currently not supported by dxf2elmt, but developer is working on it!

Blocks are currently supported. The way I wrote it I would have thought nested blocks would be supported, but I have not actually tested that yet.

I'll have to do some testing with your file and see why it's not working.

If it is due to nested blocks, what plc-user suggested: opening it in some CAD software and doing an explode on the blocks should work as a temporary solution until I can update the software.

I would agree with limiting it to 2 decimal places. I don't see any real benefit to that level of resolution in the element placement, and it bloats the XML file. Since you can't edit any more than 2 digits inside the element editor anyway, what need is there to store it in the XML.