Text-aligned leader

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Text-aligned leader

Post by dmitpon » Wed Dec 08, 2021 7:49 pm

Hi

I've a new script written. Text-aligned leader. I'll be glad if it is useful to someone.
text-aligned-leader.gif
text-aligned-leader.gif (90.29 KiB) Viewed 16808 times
TextAlignedLeader.zip
(4.69 KiB) Downloaded 522 times



Thanks to CVH for his helpful advice.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Text-aligned leader

Post by Husky » Wed Dec 08, 2021 9:22 pm

dmitpon wrote:
Wed Dec 08, 2021 7:49 pm
I'll be glad if it is useful to someone.
If it works I'm sure it'll be very useful for many user - so far I can't get it to work in QCAD 3.27.0.0.

Tested:
1. Select Text -> T2L -> behaves like previous version - nothing has changed. :(
2. T2L -> Warning: "Select one text Object", Ok, select Text - nothing happens. :(
3. Searched for tool in Dim Bar - nope, doesn't exist anymore like the previous version ...

May I ask you how 1 can make it work like your video gif?
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Re: Text-aligned leader

Post by dmitpon » Thu Dec 09, 2021 4:21 am

Hi,
Husky

This is not a new version LeaderFromText (T2L), it is a different tool Text-aligned leader (2T).

Try this: type "2T" -> Click on first vertex position -> Click on text

or this: in command promt type "tal" -> Click on first vertex position -> Click on text

Code: Select all

action.setDefaultShortcut(new QKeySequence("2,T"));
action.setDefaultCommands(["TextAlignedLeader", "tal"]);
The tool has been placed in the following menus and toolbars

Code: Select all

action.setWidgetNames(["DimensionMenu", "DimensionToolBar", "DimensionToolsPanel", "DimensionMatrixPanel"]);
PS
I checked the attached files they match with mine in \scripts \Misc\TextAlignedLeader

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Text-aligned leader

Post by Husky » Thu Dec 09, 2021 8:34 am

Hi dmitpon,
dmitpon wrote:
Thu Dec 09, 2021 4:21 am
This is not a new version LeaderFromText (T2L), it is a different tool Text-aligned leader (2T).
Ok, what I learned now is that there is a tool In Menu called "Leader from Selected Text" (T2L) but that tool is not in the Tool Bar ...
... and a tool In the Tool Bar called "Text-aligned Ieader (2T) which does't exist in the Menu, correct?

And the tool in the Menu requires a prior selection - but isn't selection sensitive - what means if I missed that a warning pops up with the message "Select one text object!" (weird - I'm used to "Select a text object"). It doesn't tells me that I have to do it before I launch the tool what means clicking ok, selecting the text leads to nothing ...

What I personal don't understand is this "Term juggle". It is for me very confusing and I assume I'm not alone.
Example: The original QCAD Leader tool is asking for the "Arrow position". Your tool is asking for the same position but as "First vertex position". I'm sure every user understands "Arrow" regarding to the used tool but not every user knows what "Vertex" means. Why not use the same terms?
Yes - I've a hunch why this and the use of the "third-person" in the warning is in your script ... :wink:

Howsoever - this is only my opinion and there is no need to pay too much attentions to it. I think you are already on the right track. Thanks for working on this!
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Re: Text-aligned leader

Post by dmitpon » Thu Dec 09, 2021 9:14 am

I understand about the terms. Then I'll fix it

I did not understand the script works on your system or does not work?
Are icons appearing in menus and toolbars?
2021-12-09_13-07-30.png
2021-12-09_13-07-30.png (253.86 KiB) Viewed 16734 times
2021-12-09_13-03-17.png
2021-12-09_13-03-17.png (263.9 KiB) Viewed 16734 times
2021-12-09_13-02-27.png
2021-12-09_13-02-27.png (226.12 KiB) Viewed 16734 times
2021-12-09_13-01-47.png
2021-12-09_13-01-47.png (242.66 KiB) Viewed 16734 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Text-aligned leader

Post by Husky » Thu Dec 09, 2021 10:54 am

This is what I get out of your script:

Husky-2021.12.09-11.png
Husky-2021.12.09-11.png (7.18 KiB) Viewed 16723 times

Husky-2021.12.09-12.png
Husky-2021.12.09-12.png (22.66 KiB) Viewed 16723 times
Husky-2021.12.09-09.png
Husky-2021.12.09-09.png (43.32 KiB) Viewed 16723 times
Husky-2021.12.09-08.png
Husky-2021.12.09-08.png (56.52 KiB) Viewed 16723 times
Ok, I played around with a fresh QCAD installation. The thing is: T2L is already part of the last QCAD release. Located below misc - not existent in any other menu.

If I put your script below misc the result is what you see in my screenshots and I'm sure you are not less confused by the result!
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Re: Text-aligned leader

Post by dmitpon » Thu Dec 09, 2021 10:56 am

Small script correction
TextAlignedLeader.zip
(4.69 KiB) Downloaded 497 times
Changelog:
  • Command line message "First vertex position:" changed to "Arrow position:"

dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Re: Text-aligned leader

Post by dmitpon » Thu Dec 09, 2021 11:05 am

OK! The icons have been found. Does the script work like in an animated gif?

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: Text-aligned leader

Post by CVH » Thu Dec 09, 2021 12:32 pm

@ dmitpon
Refer to viewtopic.php?f=107&t=8925&start=15#p35554

Only users that have both the scripts sets installed custom will see both buttons like you intended.
The script sets under 'scripts' supersede those that come with a QCAD release.

It requires a round trip to get everything right.
It gets even weirder when we rename or move a script around in the script structure.
And then I refer to 2D Centroids. :wink: :lol: :lol:

Regards,
CVH

PS: Andrew has just adopted 2T as a replacement for T2L ... under "MiscDrawMenu"

dmitpon
Junior Member
Posts: 21
Joined: Sun Mar 14, 2021 10:15 am

Re: Text-aligned leader

Post by dmitpon » Thu Dec 09, 2021 2:02 pm

Thank you CVH for your clarification

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”