Topic: How do i set default prefix for an element I create?
?
You are not logged in. Please login or register.
QElectroTech → EN : Help, suggestions, discussions, ... → How do i set default prefix for an element I create?
?
For the moment you can't !
Program only reading config in elements/10_electric/qet_labels.xml and it is for only for element installed in this directory.
I think we need to add the same config for element prefix for custom collection (home/user elements) and add code to read this xml config user file also.
I think prefix should be set directly in the elment xml - at least for custom elements.
Optimally it should be possible to define different prefixes for different standards and a simple numeric setting in filo preferences select what standard to use: i.e
1) normal electric, relay = K
2) normal electronic, relay = RE
3) RDS 81346 - i think a relay there have three letters...
n) etc, freely defineable
@ Morganol
go to:
/usr/share/qelectrotech/elements/10_electric
copy the file "qet_labels.xml" to:
/home/morganol/.qet/elements/[anything you want]
Edit manualy the file "qet_labels.xml" according to your needs and to your own folder structure.
According to Hilario/Davi (brazilian devs) Qelectrotech should take in account the prefixes defined in qet_labels.xml while you're inserting an element in the drawing area.
i have NOT tested this feature!
it SHOULD work
RDS 81346 - i think a relay there have three letters...
HA! you know it too!
See attached file.
Thanks Nuri, Iĺl try later
And thanks for the list. Tried their free app but it is limited. And my time and money is too limited to get and study their spec.
Yes "I know enough to screw up things"...
In several fields of technology... Muuuahhahaha
@Nuri, need fixing:
I just had a quick look at the file you point out as example
( As i compile locally i have it at /usr/local/share/qelectrotech/elements/10_electric/ )
That file contain the old name of the folder
<category name="100_sheet_referencing"></category>
While you (?) have changed the actual name of folder to "100_folio_referencing"
I will try setting prefixes later... as a starter i understand i can not have mixed prefixes for elements in same folder so I need reorganise my collection a bit.
My 2 cts, I remember which code reading only commonElementsDir no customElementsDir() (user collection)...
Edit :
// Only Electric labels created so far
//if (current_location.fileName() != "10_electric")
QString qet_labels = "10_electric/qet_labels.xml";
QString filepath = QETApp::commonElementsDir().append(qet_labels);
it only read qet_labels.xml file on common element collection in folder 10_electric/ for the moment !
Need little work for adding this for customElementsDir
Possible patch (not time for) :
// Only Electric labels created so far
//if (current_location.fileName() != "10_electric")
QString qet_labels = "10_electric/qet_labels.xml";
QString filepath = QETApp::commonElementsDir().append(qet_labels);
// For custom collection
#if defined(Q_OS_WIN32)
QString custom_labels = (QDir::homePath() + "/Application Data/qet/elements/custom_labels.xml");
#else
QString custom_labels = (QDir::homePath() + "/.qet/elements/custom_labels.xml");
#endif
QString filepath = QETApp::customElementsDir().append(custom_labels);
OK, for later then.
I made the feature request https://qelectrotech.org/bugtracker/view.php?id=114 , pointing to post above
Workaround idea:
If I put a symlink in commonelements, to point to customerelements:
=> I can manage the elements in custom elements as usual
=> they will also show up as a subfolder in common elements and there QET evaluates the qet_labels.xml ; from there i use them in my drawing.
Bug 114 fixed.
Thanks, will try later. Away for a week
Greetings.
I would like to know what has been done in this direction? Now I'm doing a great project, and it's very inconvenient to go through the entire library, to put at least a relay winding. It's easier to copy from the previous page, but then auto-numbering does not work. And of course it would be desirable that each element be tagged as it is set in IEC81346-1_Letters
Greetings,
I'm desperately trying to define custom prefix for my own elements library but I failed until now.
I think I've understood - at least I hope to - what was explained in the previous posts and video.
I've made a lost of tests before following back to a really simple example. But it still doesn't work
I'm using QElectroTech 0.7 on Windows
I've kept the default path for my user library. It contains only one directory named "connecteurs"
Inside of this directory, I've placed some .elmt files and a file named "custom_labels.xml" as follows :
<?xml version="1.0" encoding="UTF-8"?>
<labels>
<category name="connecteurs">
<prefix>XYZ</prefix>
</category>
</labels>
But still, when starting QET and placing one of my custom elements on a new folio, when typing "%prefix" in the label formula, nothing is shown.
Am I still missing something ?
Rename your file to qet_labels.xml and see this litle example.
── coils
│ ├── coils_prefix_FX
│ │ ├── bobine3.elmt
│ │ └── qet_directory
│ ├── coils_prefix_XYA
│ │ ├── qet_directory
│ │ └── relbistable.elmt
│ └── qet_directory
<labels>
<category name="coils">
<category name="coils_prefix_FX">
<prefix>FX</prefix>
</category>
<category name="coils_prefix_XYA">
<prefix>YYA</prefix>
</category>
</category>
</labels>
Hello,
Same result with your example : No prefix shown in QET.
Maybe qet_labels.xml should be placed elsewhere ?
I've tried to put it sequentially in :
.\coils
.\coils_prefix_FX
.\coils_prefix_XYA
With no change in behavior.
Hello,
put qet_labels.xml in the root of your elements folder.
I think I've found the trick (bug?)
Scorpio, now, your example is working on my configuration - and my example also - BUT only if the user collection directory is on its default path.
If I try to change it to a custom location "Settings > Configure > Collections > User collection directory" then the content of the collection is correctly loaded but the qet_labels.xml file seems to be simply ignored.
Interesting, thanks for your feedback.
Please try latest packages.
QElectroTech → EN : Help, suggestions, discussions, ... → How do i set default prefix for an element I create?
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.383 seconds (44% PHP - 56% DB) with 10 queries