1

(210 replies, posted in Import DXF)

Hi Everyone,

I've been spending some time recently working on getting style information out of the dxf files so it can be applied to objects within the element file, thing like line width, dashed lines etc.

As most people using dxf2elmt are probably doing it through the QET Element Editor which just uses the default command line flags, I want to make sure the defaults are as sensible as possible.

One of the things style information also has is line color, considering that most dxf files are assuming a black background which is the opposite of QET, and most QET Elements don't use color, my thought was to have the default NOT apply any colors from the DXF file to the created element. Then if they want to convert the dxf file with color they can do it with a command line flag from the CLI.

I wanted to get people's opinions before I did this, maybe you guys have other ideas on the best way to handle it.

2

(5 replies, posted in Elements)

plc-user wrote:

Just a remark:
Keep in mind that the QET-collection holds elements by manufacturer.
When I see it correctly, Automation Direct is a distributor...

They are kind of both. They do distribute some third party components if I recall, but they actually work with ODMs to make PLCs and then they do firmware and programming software etc for them, and sell them as their own branded PLCs, and such.

I've never used anything by them, but from what I understand they are actually pretty decent products, especially for the price.

AndyS wrote:

seems to be dxftoqet: DXF to QET ELMT converter V3.0 use SQlite.

Unfortunately I don't really know anything about dxftoqet, as far as I'm aware it hasn't been updated in years, and I was never involved with it.

If you have or can easily install Rust on your Mac you can probably build dxf2elmt pretty easily, it has only Rust dependencies, so you should be able to clone the repo, or download the source from the last release and run

cargo build --release

to create an executable you can use.

I know Laurent (scorpio810) created some Mac binaries for ARM and x86 of dxf2elmt at one point, and posted them in the forums. You can find the AARCH64 executable you need here https://qelectrotech.org/forum/viewtopi … 911#p21911, but it is an older version of dxf2elmt (I don't recall exactly which version off the top of my head). I think it's missing some features like nested blocks and stuff, but depending on your dxf it might work for you.

I will also see if I can spend some time looking into getting Github actions working again, so we get pre-compiled executable for each release and for various OS's and architectures, but not promises on if I will get that working any time soon.

4

(5 replies, posted in Elements)


Hi Tomasz,

I'm familiar with the AD website, that's where I found the DWG drawing for the C2-03CPU that I converted into an Element and attached to my last message (Although taking another look at there website, I'm seeing DXF drawings available where I though I only saw DWG before). But that doesn't really explain what it is you are looking for.

Are you looking for a representation of the physical PLC for use in a Panel Layout, like the sample I created, or are you looking for a wiring diagram for some I/O or power connections?

Either way, I haven't seen any Automation Direct Elements for QET. You would probably need to create them yourself. The QET Project does accept user created elements if you wanted to give them back to the community.

Hi I'm the current maintainer of dxf2elmt, although I haven't had as much time to work on it as I would like recently.

A couple of notes, dxf2elmt should be preferred over dxftoelmt, it's much more up to date, and handles dxf features that dxftoelmt doesn't.

In regards to the message "cannot find cfg" I'm can't think of anything at the moment that would give that error. dxf2elmt doesn't even have a config file, it has a set of defaults options that can be changed using command line parameters. When launched from QElectrotech it pretty much just uses the defaults.

Do you know what version of dxf2elmt you are using? You should be able to run

dxf2elmt --version

to find out.

The latest release is v0.6.1 and can be found at https://github.com/Vadoola/dxf2elmt/releases, although I only have precompiled version of x86-64 Windows for that release. I guess the other question is where did you get dxf2elmt from? Are you compiling it yourself? Since I don't have an ARM compatible Mac version up in the releases?

I also don't have a Mac of any sort, let alone with an M chip to really test against.  I've been wanting to try and get the Github Actions working properly so it will compile the correct version for different OSs.

If you can let me know what version you are running, and if there are any logs that are being created I can see if I can dig a bit deeper.

6

(5 replies, posted in Elements)

I haven't seen any AD PLC Elements.

Depending on what you are looking for you might be able to just create some quickly.

If you are looking for something like an IO wiring diagram, you could probably take an similar element, make a copy and modify it to create something you could use.

If you are looking to use a more realistic representation of the PLC, like in a Panel Layout or something, you could probably grab the 2D cad drawing off Automation Directs Website, use something like https://github.com/tomer7X/DWG_TO_DXF to convert the DWG to DXF, and then use https://github.com/Vadoola/dxf2elmt to convert that DXF to an Element, clean it up a bit and add some terminals.

Here is a super quick example I just made:

7

(3 replies, posted in Code)

Salut Laurent,

scorpio810 wrote:

Hallo Vadoola,

see https://github.com/search?q=repo%3Aqele … ;type=code

Like :

{"HTMLWhiteFloralWhite",
869                             {Qt::SolidPattern, QColor(255, 250, 240)}},

Sorry for the misunderstanding, I had already found that section of code, and added in appropriate conversions in dxf2elmt, I was more curious if there was some particular reason it was done that way.


plc-user wrote:

I guess it is just because to have colors with names and Qt has defined some:
Look here: https://doc.qt.io/archives/qt-5.15/qml-color.html

It's certainly possible I guess, but as far as I understand QET doesn't use any QML, and it looks like QColor only defines a handful of basic colors like red, blue, etc. All these colors used by QET are defined in QET, and have different names to the QML ones.

It's certainly not a big deal, what is there functions, and adding in these conversions into dxf2elmt wasn't difficult, it just seemed like a bit of extra work/code that using RGB values, and I was mostly just curious why it was done this way.

8

(3 replies, posted in Code)

Hi Everyone,

I was recently doing some work to improve the styling support in dxf2elmt, and while looking at the element files and the QET code, I noticed that the Line and fill colors are stored in the XML as a string with a name such as "red", and "HTMLWhiteFloralWhite", etc.

I was wondering if there was a specific reason this was stored this way, and the colors in the element editor are just a drop down of options, instead of a color picker, and storing the RGB values in the element file?

9

(160 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.

10

(160 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?

11

(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?

15

(210 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.

16

(210 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.

18

(210 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

19

(210 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.

20

(210 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.

21

(210 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.

22

(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.

23

(210 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.

24

(210 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.

25

(210 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.