Duplication of layout blocks
Moderator: andrew
-
- Active Member
- Posts: 39
- Joined: Sun Feb 21, 2021 2:43 pm
Duplication of layout blocks
Would it be possible to give the possibility to duplicate layout blocks with the BY command? Currently, this command returns an error when applied to layout blocks. In French the error is “Impossible de copier le bloc d'espace modèle ou les blocs de mise en page.”
Re: Duplication of layout blocks
Hi,
But there might be a workaround if it suits you, see:
https://qcad.org/rsforum/viewtopic.php?t=9031
I only can not say if it is fully developed.
It was not adopted by Andrew.
Regards,
CVH
Indeed, Layouts are excluded for some reason ...ouilogique wrote: ↑Thu Aug 25, 2022 9:54 amCurrently, this command returns an error when applied to layout blocks.
But there might be a workaround if it suits you, see:
https://qcad.org/rsforum/viewtopic.php?t=9031
I only can not say if it is fully developed.
It was not adopted by Andrew.
Regards,
CVH
-
- Active Member
- Posts: 39
- Joined: Sun Feb 21, 2021 2:43 pm
Re: Duplication of layout blocks
Thank you for your answer CVH.
The script doesn't work for me. Here is what I tried.
I downloaded and unzipped the script
https://qcad.org/rsforum/download/file.php?id=11282
Then I added the path to the script directory in
Edit - Application Preferences - Widgets - Library Browser - Library Sources
I restarted QCAD, selected Layout1 and executed the BY command.
But the error persists.
The script doesn't work for me. Here is what I tried.
I downloaded and unzipped the script
https://qcad.org/rsforum/download/file.php?id=11282
Then I added the path to the script directory in
Edit - Application Preferences - Widgets - Library Browser - Library Sources
I restarted QCAD, selected Layout1 and executed the BY command.
But the error persists.
Re: Duplication of layout blocks
ouilogique,
It is not a library item but an addon script.
There are some ways to implement it dependig your OS.
Or you can put a copy in its folder under your QCAD installation folder:
...QCAD\scripts\DuplicateLayoutBlock\ ... (4 files)
The complete path to the scriptfile should then read:
...QCAD\scripts\DuplicateLayoutBlock\DuplicateLayoutBlock.js
This folder structure is mandatory so that QCAD may locate your addon on startup.
However, on a Windows system this can be a protected area.
Or you can do the same but then in the local data location:
◦Windows: C:/Users/[Username]/AppData/Local/QCAD/QCAD ...
◦macOS: ~/Library/Application Support/QCAD/QCAD ...
◦Linux: ~/.local/share/QCAD/QCAD ...
In my case the full path then reads as:
C:\Users\[Username]\AppData\Local\QCAD\QCAD\scripts\DuplicateLayoutBlock\DuplicateLayoutBlock.js
All 4 files should be in the 'DuplicateLayoutBlock' folder.
Start or restart QCAD.
Regards,
CVH
It is not a library item but an addon script.
There are some ways to implement it dependig your OS.
Or you can put a copy in its folder under your QCAD installation folder:
...QCAD\scripts\DuplicateLayoutBlock\ ... (4 files)
The complete path to the scriptfile should then read:
...QCAD\scripts\DuplicateLayoutBlock\DuplicateLayoutBlock.js
This folder structure is mandatory so that QCAD may locate your addon on startup.
However, on a Windows system this can be a protected area.
Or you can do the same but then in the local data location:
◦Windows: C:/Users/[Username]/AppData/Local/QCAD/QCAD ...
◦macOS: ~/Library/Application Support/QCAD/QCAD ...
◦Linux: ~/.local/share/QCAD/QCAD ...
In my case the full path then reads as:
C:\Users\[Username]\AppData\Local\QCAD\QCAD\scripts\DuplicateLayoutBlock\DuplicateLayoutBlock.js
All 4 files should be in the 'DuplicateLayoutBlock' folder.
Start or restart QCAD.
Regards,
CVH
Re: Duplication of layout blocks
BTW, the shortcut of this tool is '22'.ouilogique wrote: ↑Sat Sep 03, 2022 10:55 amI restarted QCAD, selected Layout1 and executed the BY command.
But the error persists.
Regards,
CVH
-
- Active Member
- Posts: 39
- Joined: Sun Feb 21, 2021 2:43 pm
Re: Duplication of layout blocks
I am on macOS Monterey 12.5.1
I tried both solutions:
Copied the directory with 4 files to
~/Library/Application\ Support/QCAD/QCAD/DuplicateLayoutBlock
Copied the directory with 4 files to
/Applications/QCAD-Pro.app/Contents/Resources/scripts/DuplicateLayoutBlock
Restarted QCAD, but the result is still the same.
Regards,
ouilogique
I tried both solutions:
Copied the directory with 4 files to
~/Library/Application\ Support/QCAD/QCAD/DuplicateLayoutBlock
Copied the directory with 4 files to
/Applications/QCAD-Pro.app/Contents/Resources/scripts/DuplicateLayoutBlock
Restarted QCAD, but the result is still the same.
Regards,
ouilogique
Re: Duplication of layout blocks
Not a mac guy, should that not be:
~/Library/Application Support/QCAD/QCAD/scripts/DuplicateLayoutBlock/...
('scripts' with a lower 's')
Don't forget to remove the misplaced items and folders and also remove it as a Library Sources.
Regards,
CVH
~/Library/Application Support/QCAD/QCAD/scripts/DuplicateLayoutBlock/...
('scripts' with a lower 's')
Don't forget to remove the misplaced items and folders and also remove it as a Library Sources.
Regards,
CVH
-
- Active Member
- Posts: 39
- Joined: Sun Feb 21, 2021 2:43 pm
Re: Duplication of layout blocks
Now it works and in fact the path in /Applications/QCAD-Pro.app that I mentioned previously was already working, but for this to work, you must not call the function with the BY command, but with the 22 command.
So both these folders work:
~/Library/Application\ Support/QCAD/QCAD/scripts/DuplicateLayoutBlock
/Applications/QCAD-Pro.app/Contents/Resources/scripts/DuplicateLayoutBlock
If you copy the script in both folders, the function appears twice.
But anyway, I don’t think it is wise to use the /Applications/QCAD-Pro.app folder as it will be overwritten each time the application is updated.
Thank you for your help.
Regards,
ouilogique
So both these folders work:
~/Library/Application\ Support/QCAD/QCAD/scripts/DuplicateLayoutBlock
/Applications/QCAD-Pro.app/Contents/Resources/scripts/DuplicateLayoutBlock
If you copy the script in both folders, the function appears twice.
But anyway, I don’t think it is wise to use the /Applications/QCAD-Pro.app folder as it will be overwritten each time the application is updated.
Thank you for your help.
Regards,
ouilogique
Re: Duplication of layout blocks
Indeed, like mentioned above, if any then each tool needs a non conflicting shortcut.ouilogique wrote: ↑Sat Sep 03, 2022 12:37 pmbut for this to work, you must not call the function with the BY command, but with the 22 command.
I think that the two key stroke shortcut options starting with a 'B' are almost exhausted.
One can customize this in the App.Prefs. under General .. Tool Settings but it can not be 'BY'.
Or one could edit the DuplicateLayoutBlockInit.js file. Scripts are textual.
That would be true when Andrew includes this tool in future releases.ouilogique wrote: ↑Sat Sep 03, 2022 12:37 pmBut anyway, I don’t think it is wise to use the /Applications/QCAD-Pro.app folder as it will be overwritten each time the application is updated.
However, there is the folder based system and I think he would implement it under the Block class:
https://github.com/qcad/qcad/tree/master/scripts/Block
If so, it would be another kind of collision.
But for some reason it is not adopted so far.
It also depends on how QCAD is installed.
I use a Win msi and my custom scripts under the App path remain untouched.
And I also use the local data location in some cases.
Regards,
CVH