226

(193 replies, posted in Import DXF)

Salut Laurent !

scorpio810 wrote:

Hallo plc-user: what do you think about this issue? . I'm think that very strange!!!
https://github.com/qelectrotech/qelectr … issues/325

Sounds very similar...

In my opinion we should use a configuration path that can be read from qt-library-functions like "QStandardPaths::AppConfigLocation" or so.
Found the information here: https://doc.qt.io/qt-6/qstandardpaths.html

Than we won't need to set the path hardcoded individually for every system.

Maybe you can test this code-fragment, Laurent?
I know you can compile for different systems... nomicons/wink

#include <QStandardPaths>

QMessageBox msgBox;
QStringList lolo = QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation) ;
msgBox.setInformativeText(lolo.join("\n"));
msgBox.setText("QStringList returned by QStandardPaths::standardLocation");
msgBox.exec();

On my Debian unstable it shows this output:

QStringList returned by QStandardPaths::standardLocation

/home/ich/.config/QElectroTech/QElectroTech
/etc/QElectroTech/QElectroTech
/etc/xdg/QElectroTech/QElectroTech
/usr/share/QElectroTech/QElectroTech

EDIT:
Just found this:

QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation)

It returns this:

/home/ich/.config/QElectroTech/QElectroTech

EDIT 2:
I was a bit confused about the double "QElectroTech" in the path, but reading the docs helps!
It results from the settings in main.cpp:

    QCoreApplication::setOrganizationName("QElectroTech");
    QCoreApplication::setOrganizationDomain("qelectrotech.org");
    QCoreApplication::setApplicationName("QElectroTech");

We have to keep in mind that such a modification would affect more, than just the execution of dxf2elmt and/or QET_ElementScaler!
It would be necessary to look at more parts of QET-sourcecode where the configuration directory is also used: settings, collections, titleblocks, etc.

227

(193 replies, posted in Import DXF)

lanet wrote:

good day. Even though I click on the "installation folder" to convert the dxf file, it does not open. So I created my own folder and added "binary/dxf2elmt" into it. Even though I enter the program and click on the "installation file" again with the mouse, it does not open. Can anyone help?'

In the sources of QET one can find, that the "installation folder" is this one on windows:

(QDir::homePath() + QStringLiteral("/Application Data/qet/binary"))

should resolve to:

c:/users/$YourUserName/Application Data/qet/binary

Maybe a permission-problem?

Mehrere Linien und Polygone sind kaputt und enthalten ungültige Werte! Siehe Screenshot.

$ QET_ElementScaler Metron.elmt 
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
Polygon not konsistent! 
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
 * * * Polygon-Point with invalid value!
Polygon not konsistent! 
Remove line: Value missing at index: 1
Remove line: Value missing at index: 1
Remove line: Value missing at index: 1
Remove line: Value missing at index: 1
$

Verwende QET_ElementScaler, um das zu prüfen / beheben: https://github.com/plc-user/QET_ElementScaler
In den Releases findest Du Binaries für einige Betriebssysteme.

Welche Linien und Polygone dann fehlen, ist für Dich das fröhliche Suchspiel am Morgen!  nomicons/wink


PS:
Die vier "Langlöcher" links und rechts brauchst Du nicht zusammenstückeln:
Ein Rechteck mit entsprechend gesetzten Werten für Rundung erledigen das in eins!

229

(193 replies, posted in Import DXF)

Let's not guess what might be wrong with the fonts, but wait for Vadoola's answer when he has looked at the dxf and the resulting element-file!

andrew wrote:

(...) I wonder if prev document I converted from DWG->DXF->Element was messed up (...)

I'm also not asking why you took the additional conversion route via dwg when there is a dxf available from the supplier that can be converted directly. I achieved the perfect results I described in the post above (https://qelectrotech.org/forum/viewtopi … 822#p20822) - with Vadoolas latest code and without any additional scaling!
In any case, the downloaded dxf is attached to that post, too.

230

(193 replies, posted in Import DXF)

I don't know what you are complaining about: the drawing is perfectly converted and the scale of 1mm = 2px is also correct!
And vadoola's statement is also correct: scaling of texts and their positioning still needs to be worked on.

What texts do you want to use for the front view of the element? You know the name, the part-number and the manufacturer...

231

(193 replies, posted in Import DXF)

vadoola wrote:

With the logic I added to check for circle shaped polygons and converting them to QET ellipses hopefully this will be less of an issue, but I know there is more work to be done here.

The circle was just one example: it is also about other graphic elements, such as arcs. In many cases, text and the manufacturer's logo are composed of many individual polygons, too.

vadoola wrote:

I doubt people will be importing dxf's of tiny simple drawings like a ladder diagram coil or contact. This would probably be mostly used for importing drawings of real life objects.

I agree: drawings converted from dxf are more likely to be used in the professional sector for front views (thumbnails). In my opinion, circuit diagram symbols represent the function schematically and do not look like the real part.
I would therefore refer to front views rather than schematic symbols for the conversion. And here we are not talking about small components with which an electronic circuit is built: That's what you make circuit boards for with KiCad!
We are talking about parts that are used in a domestic installation or in a control cabinet. I consider a size of 20x20mm (results in 40x40px) to be “small”: So we could also assume, for example, 50px as the minimum size, for which there would then be no need for extra scaling.

vadoola wrote:

From my testing so far there are some issues with the placement of the text due to a bigger boundary box in QET (...)

As predicted nomicons/wink :

plc-user wrote:

You will have "a lot of fun” with the text position, (...)

This is the message, when the file is broken!

QET saves it's data in XML-files and (like many others!) does not show where the problem might be, when loading fails.
Try to open a copy of that file (renamed to *.xml) with firefox: It shows the first problematic part, that you have to fix. This might have to be repeated several times, before the XML is valid.

In a CMD-Window you can also use the most recent version of QET_ElementScaler, where the first problematic part of the file will be shown:
usage:

QET_ElementScaler SchematicFile.qet

It might show something like this:

$ QET_ElementScaler filtre-à-bande.qet 
File "filtre-à-bande.qet" could not be loaded: Error parsing element attribute
Check file up to byte-offset: 1196545 -- content partly shown here:
(...)rmula="" y="-130" numsize="7" condsize="1" conductor_colo" condsize="1" freezeLabel="false" bus="" dash-size="2" y="(...)
$

You mean something like a Bus or a cable like in the attachment?

As far as I know a bus cannot be defined but sometimes I read something like "define a cable" in the forum what might be similar...
Try forum search.

234

(193 replies, posted in Import DXF)

This part really does a lot of work...

Thanks for the link to the data sheet! At least now we have specific values to discuss.

But perhaps we should move away from this specific part to find something generally valid.

The primary aim is to obtain a “respectable” QET element that we can scale in a second step if necessary. The prerequisite for an element that requires little reworking is, of course, that circles from the dxf also look like circles in the element. To achieve this, the element size must be appropriate.

Do we have the chance to determine during import whether the numerical values in the unitless dxf are so small that scaling would be necessary? Something similar to: “Values are all smaller than xx, so will be enlarged by a factor of 10 or 100!

235

(193 replies, posted in Import DXF)

Maybe it is necessary also to take the tag $MEASUREMENT into account?
In the file “05DI-AD16DIX-10.dxf” one can find this:

$MEASUREMENT
 70
     0
  0

When imported in current FreeCAD dev-version you can measure the terminal-width: 18,19 mm (see screenshot)

@scorpio810:
Do you know the manufacturer and name of that part to get the real dimensions, Laurent?

236

(193 replies, posted in Import DXF)

I have noticed that there are differences in the unitless dxf files.
The test file for 1-point polygons does not contain “INSUNITS” and the file “05DI-AD16DIX-10.dxf” (see here https://qelectrotech.org/forum/viewtopi … 379#p20379) contains the tag “INSUNITS”, but no entry “70” for the unit, but this:

INSUNITS
350
99E
  3

and so the resulting element is very small. I tried a few factors and found a suitable value, I think. An “educational guess” results in a factor of 99.0508158778 for this file - then the individual terminals have a distance of 5.08mm = 10.4px. This is a commonly used dimension for terminals.
I couldn't find out what the values in the tag stand for.

For the tests I used the current source code from January 10 2025

Neben der Frage, ob ich Dir helfen kann...
Das habe ich in einem anderen Thread so geschrieben:

Many unanswered questions before you can be helped:
Which system are you using?
Which QElectroTech version are you using? (Help -> About QElectroTech -> ‘Version’ tab)
Are there any helpful entries in the log file? (Help -> About QElectroTech -> ‘log’ tab)

... und der angesprochene Anhang fehlt auch!

You mean the overlapping texts?
Try forum-search with keyword "overlap" or read here:
https://qelectrotech.org/forum/viewtopic.php?id=2418

It's the combobox under the one for user-collection in QET-Settings.
I use Debian GNU/Linux and most recent dev-version, so the paths look different from those, you use!

Maybe the path to user-titleblocks is not writable?
Did you try to set another path to user-titleblocks?

Kurze Antwort: Nö!

Etwas längere Antwort:
Gerade bei Relais hast Du doch den Kontaktspiegel, der Dir anzeigt, welche Kontakte wo verbunden sind.

Mir sind nur zwei Möglichkeiten bekannt, wie man Kontakte miteinander verbindet:
Entweder man verbindet sie mit einer mechanischen Verbindung (gestrichelte Linie) oder man verknüpft sie als "Master-Slave".
Dein Vorgehen ist aus meiner Sicht also völlig o.k.!

Tip: Move the mouse pointer slowly over the icons in the toolbar and read the hint texts!

jns wrote:

Was ich erreichen möchte ist, ein Drucktaster mit einem Öffner und einem Schliesser, welche ich individuell platzieren kann. Gibt es da eine elegante/standart Lösung?

Wer oder was hindert Dich daran, den zweiten Kontakt frei auf einem beliebigen Folio zu plazieren und die beiden dann zu verknüpfen?

Die Einstellungen wirken natürlich nur für die Elemente, die man auch passend eingestellt hat:
Man kann das in den Einstellungen für Spule, Schutzeinrichtung, Schalter unterschiedlich machen.
Dann klappt's auch mit den Schaltern und Hilfskontakten...

Hallo Foriever,

Deine Beobachtung stimmt!

Da ich das Verhalten auch nicht toll finde, habe ich mich im Quellcode auf die Suche nach der passenden Stelle gemacht und glaube, das Verhalten auch so geändert zu haben, sodass nur gescrollt wird, wenn der Text den sichtbaren Folio-Ausschnitt verlässt.
Werde bei GitHub einen PR erstellen.

online-translator:

Salut Foriever !

Ton observation est juste !

Comme je n'aime pas non plus ce comportement, j'ai cherché l'endroit approprié dans le code source et je pense avoir modifié le comportement de sorte que le texte ne défile que lorsqu'il quitte la partie visible du folio.
Je vais créer un PR sur GitHub.

Kellermorph wrote:

Jetzt fehlt mir nur noch die Variable für die höchste selbst eingetragene Seitenzahl.

Ich kann noch nicht so ganz nachvollziehen, welchen Nutzen Dir diese Angabe bringen soll!
Im Inhaltsverzeichnis stehen doch alle Folios mit den neu benannten "Seitenzahlen" in der richtigen Reihenfolge drin!

Wenn ich einen Schaltplan bekomme und sehe auf der letzten Seite eine Angabe wie "Seite 57 von 57", dann erwarte ich einen Stapel von 57 Blättern. Und wenn ich die Blätter dann durchzähle und finde nur 38 Blätter, dann gebe ich den sofort zurück und fordere einen kompletten Plan!
Wenn zwischendurch einige Seitenzahlen übersprungen werden für Reserve oder so, dann erwarte ich dort leere Folios. Oder entsprechende erklärende Trennblätter. Dann will ich aber irgendwo nachsehen können, wieviele Blätter ich in diesem Schaltplan zu erwarten habe. Deswegen wäre eine Angabe

Seite 57 (gesamt: 38 Blatt)

meiner Meinung nach vielleicht sogar richtiger bzw. praktischer!

Your file contains garbage!

At the end there are many lines behind the last closing tag "</project>" (see screenshot) and at line 12315 there are additional (fragments) of tags!

It seems that you once had some problems with your system? Did you switch off your system without closing all programs? Just guessing...

alexandra wrote:

la version utilisé est :
QElectroTech V 0.80c+87c957a06d79751d3
(...)

With which version was the QET-file created?

Do you have a special reason why you use such an old version?
Please try more recent version 0.9 or even the current dev-version from QET Download-page:
https://qelectrotech.org/download.php

The log file was not as informative as hoped:
Apart from two warnings, I don't see anything unusual.

alexandra wrote:
(...)
11:43:28.526 Warning: QString::split: invalid QRegularExpression object (:0, )
11:43:33.920 Warning: QString::split: invalid QRegularExpression object (:0, )
(...)
alexandra wrote:

comment puis je vous envoyer mon fichier ? Sur quelle adresse mail ?

Please attach the qet-file to a post here in the forum. Unless there are any legal concerns regarding patents or company secrets!