“Move / Copy” dialog improvement

Please use this forum to post feedback and suggestions related to QCAD.

Moderator: andrew

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

Re: “Move / Copy” dialog improvement

Post by CVH » Sat Jul 17, 2021 11:19 am

zroo3d wrote:
Sat Jul 17, 2021 10:38 am
True. What I meant is add it here:
It is a question of OR by dialog widget OR by Options Bar widget.
Rather counter active to include that choise on any of the two ... :wink:
That is why it is included under Application Preferences.
zroo3d wrote:
Sat Jul 17, 2021 10:38 am
I don`t know what do you mean.
Customized the Move/Copy script.
CVH wrote:
Sat May 15, 2021 3:10 am
I said: '.. have/had ..'
Knowing a little about scripting ... I made 'Move' persistent and I use MV without dialog.
Now MV is always 'Move' unless I choose to 'Copy' or 'Copy multiple'.
When interested then PM me ... :wink:

Regards,
CVH

foresterr
Newbie Member
Posts: 4
Joined: Mon Jan 23, 2023 7:11 pm

Re: “Move / Copy” dialog improvement

Post by foresterr » Mon Jan 23, 2023 7:41 pm

Bit of a necro here, but I did not find anything newer on the subject. I also was a tad miffed when forgetting whether Move/Copy had copy selected or not when using it last, especially as I don't use the dialog, so it's pretty easy to miss. In addition, another annoyance was having to click in the input box for number of copies.

I created 3 custom scripts that add 3 new commands (in the Modify menu, toolbox and available from the command line): Move (commands "mv0", "m0"), Copy 1 (commands "mv1", "m1"), and Copy N (commands "mvn", "mn"). The scripts just run the Move/Copy command and preset the options in the way you'd expect; Copy N in addition asks for number of copies to be inputted on the command line (if you input 0, it disables copy mode); should probably also react to inputting new value in the usual place, but I haven't figured this out yet (EDIT: now it works as it should). Standard Move/Copy is left alone, as it has to be, because those scripts piggyback off it as much as I could make them. Key sequences are not implemented because they would be totally redundant - see CVH's reply to this post.

If anyone finds the idea useful, the scripts can be found at https://github.com/foresterr/qcad_custom_scripts (sorry if posting links is frowned upon, especially from a new account... I promise I'm not a spam bot :) ). If you are not familiar with adding custom QCAD scripts, basic instructions are in the readme file.
Last edited by foresterr on Mon Jan 23, 2023 11:23 pm, edited 1 time in total.

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

Re: “Move / Copy” dialog improvement

Post by CVH » Mon Jan 23, 2023 9:22 pm

foresterr wrote:
Mon Jan 23, 2023 7:41 pm
I also was a tad miffed when forgetting whether Move/Copy had copy selected or not when using it last, especially as I don't use the dialog, so it's pretty easy to miss.
It should not be so certain that you miss it.
Most tools under QCAD will list their options in the Option Toolbar, some use a dialog and some a dialog or the toolbar.
So you should always keep an eye on that rather important toolbar. :wink:
foresterr wrote:
Mon Jan 23, 2023 7:41 pm
another annoyance was having to click in the input box for number of copies.
See: https://www.ribbonsoft.com/archives/sho ... uts_en.pdf
Ctrl+Space sets the focus on the Option Toolbar, the first value field will get the focus.
Even better, after MV you can start typing the amount of copies right away. :wink:
To start typing in the Command Line we need to click there or hit Space too, right?
foresterr wrote:
Mon Jan 23, 2023 7:41 pm
should probably also react to inputting new value in the usual place, but I haven't figured this out yet.
TranslateWithCopy is based on Translate and that is based on Transform.
At the end of Transform.js we find functions that react on slot changes.
See: https://github.com/qcad/qcad/blob/maste ... ansform.js
Not sure if you want to override those ...

BTW: Key sequence "mc" conflicts with Order Connected :!:

Useful? Maybe. Finished? No, and please also provide details on how to implement them.
... 7 minutes ago you added dark mode icons ...

Regards,
CVH

foresterr
Newbie Member
Posts: 4
Joined: Mon Jan 23, 2023 7:11 pm

Re: “Move / Copy” dialog improvement

Post by foresterr » Mon Jan 23, 2023 10:29 pm

Thanks for taking a look, I appreciate it!
CVH wrote:
Mon Jan 23, 2023 9:22 pm
It should not be so certain that you miss it.
I meant it in the sense that the checkbox and number of copies input box are maybe 10 by 20 pixels together and I forget to always peek at that corner of the screen... I never said I'm miffed at QCAD and not myself :P
CVH wrote:
Mon Jan 23, 2023 9:22 pm
Even better, after MV you can start typing the amount of copies right away. :wink:
Neat, if I knew that I might not have bothered (at least I learned something :wink: ) - in that case just typing m,v,0 is equivalent to Move, and m,v,1 is equivalent to Copy. Looks like it's universal behavior for any command that has input fields in the toolbar. Is that feature documented anywhere?
CVH wrote:
Mon Jan 23, 2023 9:22 pm
To start typing in the Command Line we need to click there or hit Space too, right?
Certainly, but there is an inverse problem - after you type "mv" or "move" in the command line, you need to press Ctrl+Space to change the number of copies, then somehow go back to command line (Esc, then Space seems the fastest way).
CVH wrote:
Mon Jan 23, 2023 9:22 pm
TranslateWithCopy is based on Translate and that is based on Transform.
At the end of Transform.js we find functions that react on slot changes.
See: https://github.com/qcad/qcad/blob/maste ... ansform.js
Not sure if you want to override those ...
Thanks for the hint, I figured this out - I did override the function you pointed out, and all I do there is to change the state and call the original function from Transform.
CVH wrote:
Mon Jan 23, 2023 9:22 pm
BTW: Key sequence "mc" conflicts with Order Connected :!:
D'oh. Fixed. I changed the key sequence to "m,n" which seems to be free (EDIT: I actually removed key sequences altogether after realizing how redundant they are). I also added a version to make exactly one copy, with command "mv1" - I think it's nice that it has the same result as key sequences "m,v,1" (and likewise for "m,v,0"). I'm not sure if there's anything else left to do.
CVH wrote:
Mon Jan 23, 2023 9:22 pm
Useful? Maybe.
In light of what you mentioned in your reply, maybe only for people who really hate to leave the command line, or absolutely must have those options directly in the menu/toolbox :D
CVH wrote:
Mon Jan 23, 2023 9:22 pm
please also provide details on how to implement them.
Not sure what you mean by "implement" - how to add the scripts to your installation? That should be in the readme already, I also updated it to mention that QCAD should be restarted to notice the new scripts.
CVH wrote:
Mon Jan 23, 2023 9:22 pm
... 7 minutes ago you added dark mode icons ...
In my defense, I haven't even known it was possible when I first thought to be finished :oops:

EDIT: I updated my first post to reflect the current state. Once again thanks for taking a look and sharing your knowledge.

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

Re: “Move / Copy” dialog improvement

Post by CVH » Tue Jan 24, 2023 9:56 am

foresterr wrote:
Mon Jan 23, 2023 10:29 pm
Looks like it's universal behavior for any command that has input fields in the toolbar. Is that feature documented anywhere?
Indeed and yes, as a reply of Andrew somewhere on the forum.
foresterr wrote:
Mon Jan 23, 2023 10:29 pm
Certainly, but there is an inverse problem - after you type "mv" or "move" in the command line, you need to press Ctrl+Space to change the number of copies, then somehow go back to command line (Esc, then Space seems the fastest way).
Odd, why not just type MV or activate it from the Modify menu, toolbar or toolpanel or from the matrix ...
... I see no reason to enter 'mv' in the Command Line.
Shortcut key sequences are typed without a specific focus.
And afterwards there is no reason to 'always' go back to the Command Line.
But yes, terminating a tool and setting the focus on the Command Line is possible with Esc and then Space.
foresterr wrote:
Mon Jan 23, 2023 10:29 pm
EDIT: I actually removed key sequences altogether after realizing how redundant they are
Here we differ in opinion, I hardly use the Command Line ... Except for entering coordinates.
I don't see me entering 'lineorthogonaltangent' in the Command Line, I prefer a simple click on the icon or just typing LN.
Entering 'ln' in the Command Line will start 'Line from 2 Points' :lol:
Ok I know, it is one of the few exceptions where the Shortcut key sequence is not a command. :wink:
foresterr wrote:
Mon Jan 23, 2023 10:29 pm
I'm not sure if there's anything else left to do.
mv2, mv3, ... :lol: Sorry, just joking.
foresterr wrote:
Mon Jan 23, 2023 10:29 pm
Not sure what you mean by "implement"
Well, just to keep the standardized folder layout:
TranslateNoCopy >> .../scripts/Modify/Translate/TranslateNoCopy/*.*
TranslateOneCopy >> .../scripts/Modify/Translate/TranslateOneCopy/*.*
TranslateWithCopy >> .../scripts/Modify/Translate/TranslateWithCopy/*.*
Where ... is the installation path or the user custom path.
Then you could also detach the initialization scripts: TranslateNoCopyInit.js and so on.


In the end I got used to my solution:
No dialog by preference.
TranslateNoCopy = MV because I made the Copy flag persistent off.
TranslateOneCopy = DP MV
Translate with multiple copies = MV set the Copy flag and adjust copies. Rarely used.
On top: MV and then ENTER will display the dialog by tweaking the QCAD.ini/config:

Code: Select all

[Transform]
EnterShowsDialog=true
See: Default implementation enterEvent for EAction

All aside RT or RC + PS ... and many other routes :wink:

Regards,
CVH

foresterr
Newbie Member
Posts: 4
Joined: Mon Jan 23, 2023 7:11 pm

Re: “Move / Copy” dialog improvement

Post by foresterr » Tue Jan 24, 2023 12:10 pm

CVH wrote:
Tue Jan 24, 2023 9:56 am
Odd, why not just type MV or activate it from the Modify menu, toolbar or toolpanel or from the matrix ...
I just like to know I'm in command entry mode... sometimes. Maybe it's a habit from other tools (VSCode comes to mind) which don't have a concept of global key sequences, and you need to bring up command palette before entering any commands?
CVH wrote:
Tue Jan 24, 2023 9:56 am
Here we differ in opinion, I hardly use the Command Line ... Except for entering coordinates.
Don't get me wrong, key sequences are awesome. I just meant I see no point to add any to my scripts, seeing how existing key sequences "m,v,0", "m,v,1", "m,v,..." already do the exact same thing (OK, the number technically isn't a part of the key sequence, but that hardly matters from UX perspective)
CVH wrote:
Tue Jan 24, 2023 9:56 am
mv2, mv3, ... :lol: Sorry, just joking.
Laugh all you want :wink: but I actually started thinking if it's possible to implement a catch-all command in a custom script (there is a nice implementation of something similar in Line2P where for example "u", "un", "und" an "undo" all match the same command). But I don't see a way to do it when calling the custom command, not when already inside of it.
CVH wrote:
Tue Jan 24, 2023 9:56 am
Well, just to keep the standardized folder layout
Hmm, I'll consider this - at the moment I kind of like keeping all my custom scripts (there aren't too many yet) at the top level in a separate subfolder.

On this subject, is there a setting somewhere to tell QCAD where to look for scripts, other than under "scripts" in installation directory? Generally, I always like to keep my customizations out of the install dir, and point to them in config, or if there is no option for that, symlink to them. For QCAD I'm using symlinks at the moment, but maybe there is no need.

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

Re: “Move / Copy” dialog improvement

Post by CVH » Tue Jan 24, 2023 12:24 pm

foresterr wrote:
Tue Jan 24, 2023 12:10 pm
On this subject, is there a setting somewhere to tell QCAD where to look for scripts, other than under "scripts" in installation directory? Generally, I always like to keep my customizations out of the install dir, and point to them in config, or if there is no option for that, symlink to them. For QCAD I'm using symlinks at the moment, but maybe there is no need.
See: https://www.ribbonsoft.com/en/documentation/changelog
3.26.2 (2021/04/15)
  • Add local data location to search path for resources files (patterns, linetypes, fonts, postprocessors, etc.)
    Windows: C:/Users/[Username]/AppData/Local/QCAD/QCAD
    macOS: ~/Library/Application Support/QCAD/QCAD
    Linux: ~/.local/share/QCAD/QCAD
Scripts too and these will even supersede standard scripts or compiled ones ... If the structure and the naming match.

Regards,
CVH

RobertM
Registered Member
Posts: 2
Joined: Sun Sep 22, 2024 7:20 pm

Re: “Move / Copy” dialog improvement

Post by RobertM » Sun Sep 22, 2024 7:41 pm

I use QCAD quite often for tinkering around the house and my workshop, and I really like it.

But I agree with the OP's comment that the MV dialogue requiring extra keystrokes/clicks just... bugs me. It's not the end of the world, but for a command that gets such heavy use (at least by me) it's frustrating to have it want to do the wrong thing and require me to confirm it each time.

I had thought that it would be nice if it was just a 'copy' command by default. When it completes the copy I would tap the 'd' key to 'delete' the original. Or I could tap the 'r' key to have it repeat the previous copy for every time I tap the 'r' key. For a job where I have a specific number of copies that I want (which is a much less common use case) there could be a box and the top of the screen where I could declare the number of repeats.

Or perhaps it could be a 'move' command by default, and I would tap the 'k' key to 'keep' the original, toggling it on/off with each 'k' press.

I just find that I often forget to noitice what mode the command is in, and find that it copied when I thought it was moving, or moved when I thought it was copying, and have to undo the operation and start all over again.

All that being said,... love the app. :)

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

Re: “Move / Copy” dialog improvement

Post by CVH » Mon Sep 23, 2024 4:20 am

RobertM, hi and welcome to the QCAD forum.

As mentioned above:
I rather move things to the required location.
When I really want a copy of things, I duplicate them and move the selected duplicates to the required location.
Not that often I need a number of evenly spaced copies.

For my usage the dialog was annoying, the most common case was 'Move' or NOT keep original and NO copies.
I then opted for the Options Toolbar variant:
Application Preferences .. Modify .. Move/Copy and uncheck 'Use Dialog for tool options'

Further I tweaked the MV script to be persistently 'Move' when I initiate it.
I can still check 'Copy' and enter the number of copies if I want that.

As mentioned above ... Contact me per PM if you are interested in this behavior.

Regards,
CVH

User avatar
andrew
Site Admin
Posts: 8782
Joined: Fri Mar 30, 2007 6:07 am

Re: “Move / Copy” dialog improvement

Post by andrew » Mon Sep 23, 2024 8:08 am

RobertM wrote:
Sun Sep 22, 2024 7:41 pm
But I agree with the OP's comment that the MV dialogue requiring extra keystrokes/clicks just... bugs me. It's not the end of the world, but for a command that gets such heavy use (at least by me) it's frustrating to have it want to do the wrong thing and require me to confirm it each time.
As outlined above, the move command is really mainly useful to create multiple copies at an evenly spaced distance. It contains the move and copy options for completeness (zero copies is move and one copy is a single copy).

To quickly move a selection, you might want to use Edit > Cut with Reference and Edit > Paste instead which is both quicker and more versatile (as you can scale, rotate and mirror while pasting and you can paste multiple times if needed).

To quickly copy a selection use Edit > Copy with Reference instead.

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

Re: “Move / Copy” dialog improvement

Post by CVH » Mon Sep 23, 2024 11:28 am

andrew wrote:
Mon Sep 23, 2024 8:08 am
To quickly move a selection ...
The difference I see is that Cut/Paste creates a new entities while MV moves the existent entities.
Luckily the drawing order is preserved. :wink:

Regards,
CVH

RobertM
Registered Member
Posts: 2
Joined: Sun Sep 22, 2024 7:20 pm

Re: “Move / Copy” dialog improvement

Post by RobertM » Mon Sep 23, 2024 12:25 pm

Thanks for those responses, guys. A few years ago a Windows update bricked my trusty AutoCAD 2000 Light version. It was old, to be sure, but it did what I needed, and I was comfortable with it. Finding that upgrading to a current AC version had become crazy expensive, I happened upon QCAD and have been using it happily ever since (with just a little grumbling to myself). To be honest, I haven't really explored many of the available commands, and just used those that seemed familiar to me (familiar by name, anyway).
andrew wrote:
Mon Sep 23, 2024 8:08 am
To quickly move a selection,
Now that you've spurred me to try the 'cut with reference' and 'copy with reference' commands, I can see a whole new way of doing things. And I see that they are pinned to the top ribbon bar - so must be important, no? I should have asked this question a long time ago ;) Thanks, Andrew.
CVH wrote:
Mon Sep 23, 2024 4:20 am
Contact me per PM if you are interested in this behavior.
I might take you up on that if I still need to tweak things. Thx.

ikua
Full Member
Posts: 50
Joined: Tue Apr 25, 2023 4:07 pm

Re: “Move / Copy” dialog improvement

Post by ikua » Thu Sep 26, 2024 8:37 pm

i wanted to add, that i was working now for more than a year with qcad. that dialogue box drove me crazy. Not i found the solution about the dialogue box option in the preferneces by accident. I am reaaaaaally happy about that, but i do not understand why this dialogue is the standard option when you install qcad. I find it would make sense for the future to have the toolbar for this tool from the beginning.

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

Re: “Move / Copy” dialog improvement

Post by CVH » Fri Sep 27, 2024 1:05 am

ikua wrote:
Thu Sep 26, 2024 8:37 pm
Now I found the solution about the dialogue box option in the preferences by accident.
It should not have been 'By accident' ... :lol:
CVH wrote:
Mon Sep 23, 2024 4:20 am
I then opted for the Options Toolbar variant:
Application Preferences .. Modify .. Move/Copy and uncheck 'Use Dialog for tool options'

ikua wrote:
Thu Sep 26, 2024 8:37 pm
I find it would make sense for the future to have the toolbar for this tool from the beginning.
That is a developer choice. A dialog is most likely harder to miss for novel users.
Once they get more acquainted with the application then users can start to tweak some default preferences.

For the record: Many tickets are related with tool options listed on the Options Toolbar.

Regards,
CVH

ikua
Full Member
Posts: 50
Joined: Tue Apr 25, 2023 4:07 pm

Re: “Move / Copy” dialog improvement

Post by ikua » Mon Sep 30, 2024 6:49 am

hey!

I only wanted to give a feedback from a user. I discovered it by accident, cause in my personal logic I did not expect, that there is another possibility. So maybe that would be for other usesers the same. I have found now the solution, yeeeaaahh. Maybe a small hint in the menu, that there is an other possibility can shorten the way for others. But that is clearly a developer solution.

Greets
ikua

Post Reply

Return to “QCAD Suggestions and Feedback”