Re: freepascal-code to take a QET- Element and scale the content by a fact

Hi Plc-user,

it only takes me ~3 seconds to compile it and push it to the repository.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: freepascal-code to take a QET- Element and scale the content by a fact

plc-user wrote:

Today I uploaded a new version of "QET_ElementScaler" to github: https://github.com/plc-user/QET_ElementScaler

This version is completely rewritten in C++, where I (like QET) use pugixml for handling the contents of the element files.

I made a few additions/changes that makes working with the software easier: The XML description line no longer needs to be removed afterwards!

As before, x and y scaling factors can be specified, input is via STDIN (-i) or a file (-f FILEINAME) and output is, as before, to a new file or to STDOUT (-o).

In addition, I have added the possibility to remove "terminals" from the element. This can be useful when terminals can be omitted from overloaded front views.

Furthermore, there is now the possibility to flip polygons and lines horizontally and/or vertically. This can be useful during the development of complex front views, as long as these functions are not yet available in the QET element editor.

Special care should be taken with the option "--OverwriteOriginal", because here the original file will be overwritten WITHOUT further request!

The scaled values of the new element are written into the new file with a maximum of 2 decimal places. In my view, this is completely sufficient for the display of schematic symbols and front views (thumbnails). In some elements present in the QET collection I have seen values with up to six decimal places, which in my opinion is excessive.
To "fix" such elements, QET_ElementScaler can of course be used! With the call:

QET_ElementScaler -f FILENAME

the values are rounded to max. 2 decimal places and any font sizes with decimal places are rounded to whole numbers.

I wish all users of the software a lot of fun and success with it and would like to see bugs reported (e.g. here or at github). Of course, I also have an "open ear" for suggestions for improvement!

Best regards
plc-user

It's not possible to integreted it directly on QET like it's C++?

Re: freepascal-code to take a QET- Element and scale the content by a fact

scorpio810 wrote:

Hi Plc-user,

it only takes me ~3 seconds to compile it and push it to the repository.

Thank you very much !

Re: freepascal-code to take a QET- Element and scale the content by a fact

galexis wrote:

It's not possible to integreted it directly on QET like it's C++?

There are several new topics for me at once:
For the beginnings in Pascal I only needed to add a little XML to the Pascal knowledge. The change to C++ was then already bigger. But then to integrate that into an existing, grown QT project, that's quite another matter...
For the moment I have put together a small (and from my point of view) usable package. There is no question that in the foreseeable future it will make sense to integrate scaling and mirroring directly into QET's Element-Editor!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: freepascal-code to take a QET- Element and scale the content by a fact

Ok, compile and work fine on Apple Silicon chip.
https://download.qelectrotech.org/qet/forum_img_2/QET_ElementScaler_Apple_silicon.jpeg

laurent@mini-de-laurent ~ % cd QET_ElementScaler 
laurent@mini-de-laurent QET_ElementScaler % ./QET_ElementScaler  --FlipVertical -f ../.qet/elements/p.elmt 
laurent@mini-de-laurent QET_ElementScaler % 

Post's attachments

Attachment icon QET_ElementScaler_Apple-Silicon.zip 118.7 kb, 104 downloads since 2023-06-06 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: freepascal-code to take a QET- Element and scale the content by a fact

plc-user wrote:
galexis wrote:

It's not possible to integreted it directly on QET like it's C++?

There are several new topics for me at once:
For the beginnings in Pascal I only needed to add a little XML to the Pascal knowledge. The change to C++ was then already bigger. But then to integrate that into an existing, grown QT project, that's quite another matter...
For the moment I have put together a small (and from my point of view) usable package. There is no question that in the foreseeable future it will make sense to integrate scaling and mirroring directly into QET's Element-Editor!


Bravo plc-user! QET becomes more and more appealing by the day - many thanks for your great work!


Hamish

32

Re: freepascal-code to take a QET- Element and scale the content by a fact

Hello everyone, I have many doubts regarding the use of this program, I am not an expert in program issues and their execution at the CMD level, but I need to scale a DXF so that it is the actual size of the design, qelectrotech makes it smaller. Could someone tell me how to use this program properly on Windows, please?

Re: freepascal-code to take a QET- Element and scale the content by a fact

Hello,

in last version 0.100-dev "Import an element to resize" was implanted directly on element editor, no need to use terminal if you want.
See the plc-user's quick-guide  -> https://download.qelectrotech.org/qet/Q … ick-guide/

https://qelectrotech.org/forum/viewtopic.php?id=2795

For installation and can be launched in element editor it's the same way like dxf2elmt install see:
https://qelectrotech.org/forum/viewtopi … 116#p17116

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: freepascal-code to take a QET- Element and scale the content by a fact

8A wrote:

(...) but I need to scale a DXF  (...)

As the name QET_ElementScaler might suggest, only QET-Elements can be scaled by that software!
You need to convert your dxf to a QET-Element before using QET_ElementScaler!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

35

Re: freepascal-code to take a QET- Element and scale the content by a fact

I appreciate the prompt response provided, I was able to install the qelectrotech plugin satisfactorily, now I have another couple of questions, I hope this doesn't sound overwhelming.

1.What is the correct way to create a new element from a DXF?
I am currently importing my DXF to the new elements editor in qelectrotech, to be able to add the necessary connections, but I see that the DXFTOQET tool is suggested in the forum. Does this program perform the same procedure or does it perform any additional processes?

2.What scale does Qelectrotech work on?
Currently, from the element editor I exported a DXF with measurements of 100mm 27mm  (100 X 49.92mm).

36 (edited by plc-user 2024-12-20 19:39:00)

Re: freepascal-code to take a QET- Element and scale the content by a fact

8A wrote:

What is the correct way to create a new element from a DXF?

Did you notice the menu-entry just below "Import scaled element"? (see attachment!)
AND: Use the conversion-tool dxf2elmt! The other tool is VERY outdated!
You find the download-link for win64 in this post: https://qelectrotech.org/forum/viewtopi … 520#p20520

8A wrote:

(...) I exported a DXF (...)

What do you want to do?
QET works with own file-formats for elements and schematics!

I think, many of your questions about scale and dxf-import will be answered, if you read in the other thread and follow the links there:
https://qelectrotech.org/forum/viewtopi … 684#p20684

Post's attachments

Bildschirmfoto_2024-12-20_DXF-Import.png, 20.07 kb, 356 x 372
Bildschirmfoto_2024-12-20_DXF-Import.png 20.07 kb, 1 downloads since 2024-12-20 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !