script collection for layer config, multiprint, reconcile...

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

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

script collection for layer config, multiprint, reconcile...

Post by smf » Wed Feb 25, 2015 3:51 pm

Hi there,

some time ago I wrote some scripts that might be useful to others, so I want to share them here. All scripts are within a "MyTools"-folder and result in a new QCad menu called "MyTools". I admit the name is not really expressive, but I couldn't resist to call it mine. e_ugeek

The following scripts are available here:
- ActivateLayerConfig: change color, lineweight and linetype of one or more layers to a predefined set. The definition must reside on a "_DEFS" called layer inside the document. Idea behind: if you have different output formats or different "background layers", you can adjust contrast and visibility.
- ActivatePredef: set all layers to a predefined visible/not-visible (aka. not-frozen/frozen) state. The definition must reside on a "_DEFS" called layer inside the codument. Idea behind: if you have (too) many layers and need the same visible sets of layers multiple times, you can define them once and just reset to a defined set.
- DupRemover: remove all lines that have same start and end points.
- ListActiveLayers: list currently visible (not-frozen) layers. This can be used as basis for ActivatePredef.
- ListActiveLayerConfigs: list configuration of visible (not-frozen) layers. This can be used as basis for ActivateLayerConfig.
- MultiPrintToPdf: print multiple configurations into a single PDF. The definition must reside on a "_DEFS" called layer inside the document. Idea behing: if you have multiple layer configurations, you can print them each after each into one single PDF.
- QuickPrintToPdf: one single PDF with output that would be produced identically in one configuration of MultiPrintToPDF.
- Reconcile: move+scale+rotate in one step. Idea behind: if you have some "real" drawing and some "similar" one and want to match them with just two reference points, just reconcile them.
- Select-Widget: already published, see viewtopic.php?f=107&t=2142 in another thread. I only updated the position of "Select Widget" visibility menu item.

Any feedback is appreciated. :)
Attachments
MyTools_V21_SelectWidgetPosFix.zip
MyTools version 21
(30.85 KiB) Downloaded 1444 times

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcil

Post by smf » Wed Feb 25, 2015 3:55 pm

Example text on _DEFS layer for ActivatePredef:

Code: Select all

Luftbild pur
EG_WAND
EG_WAND_FILL
LUFTBILD

This results in a layer predef called "Luftbild pur". Activating this predef, only the layers "EG_WAND", "EG_WAND_FILL" and "LUFTBILD" will be visible.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcil

Post by smf » Wed Feb 25, 2015 3:57 pm

Example text on _DEFS layer for ActivateLayerConfig:

Code: Select all

layer
LargeScale
NORD_VERSION/Black/0.50mm (ISO)/CONTINUOUS
UMGEB_GEBAEUDE/Cyan/0.70mm (ISO)/CONTINUOUS
UMGEB_GRENZE/Black/0.70mm (ISO)/CONTINUOUS

This results in a layer config predef (mind the "layer" keyword in the first line!) called "LargeScale". Activating this predef, the NORD_VERSION layer will become black having 0.5mm continuous lines, UMGEB_GEBAEUDE become cyan and so on.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcil

Post by smf » Wed Feb 25, 2015 4:03 pm

Example text on _DEFS layer for MultiPrintToPDF:

Code: Select all

print
Luftbilder
297
210

@Default
@Luftbild

0.0025
DINA4_1_400
Luftbild pur

0.005
DINA4_1_200
Luftbild Gelände

@Default

This results in a print configuration (mind the "print" keyword in the first line!) called "Luftbilder" with page size is 297x210 mm. The remaining lines are either (1) beginning with @ which activates a layer configuration or (2) are three lines in a block with scale, the name of the layer that should be centered on the page and the name of the layer predef.

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcil

Post by smf » Wed Feb 25, 2015 4:13 pm

Attached is a simple example demonstrating ActivateLayer, ActivateLayerConfig and MultiPrintToPDF.
Attachments
MyToolsExample.pdf
printed output
(2.95 KiB) Downloaded 2146 times
MyToolsExample.dxf
example source
(103.4 KiB) Downloaded 1307 times

User avatar
dfriasb
Senior Member
Posts: 119
Joined: Thu Mar 10, 2016 1:08 pm
Location: Calafell, Tarragona, Spain

Re: script collection for layer config, multiprint, reconcile...

Post by dfriasb » Mon Mar 26, 2018 2:17 pm

Very interesting! Thanks a lot smf!
David Frías Barranco | architect
[email protected] | davidfriasarquitecto.es

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcile...

Post by smf » Mon Mar 26, 2018 2:26 pm

Thanks for the feedback, dfriasb! :-) It's the first one after more than three years but very welcome! :-)

marieke
Registered Member
Posts: 2
Joined: Mon Feb 11, 2019 5:26 pm

Re: script collection for layer config, multiprint, reconcile...

Post by marieke » Mon Feb 11, 2019 5:39 pm

Hi smf, with the newest version (3.21.3) the script MyTools doesn't seem to work anymore. QCAD fails to launch after installing the script... Would you be able to provide a solution?

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcile...

Post by smf » Mon Feb 11, 2019 8:36 pm

Hi marieke,

thanks for the hint. I'm happy that someone is using it! :) Before 3.21 there were some changes that I missed completely. For the next QCad version I will upload new versions of MyTools and QCTrack as soon as possible.

Best regards - smf

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcile...

Post by smf » Sat Apr 27, 2019 2:41 pm

Hi there,

sorry for the long offline-time (read: family-time). Attached is the new MyTools version 23 which is tested with QCad 3.22.0 and seems :wink: to work. If you have any problems, please report them here.

Best regards
smf
Attachments
MyTools_V23_QCad3220.zip
(33.8 KiB) Downloaded 1141 times

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcile...

Post by smf » Thu May 02, 2019 2:15 pm

Hi there,

unfortunately, the Select Widget still not work with V23. Attached is the updated V24.

Sorry - smf
Attachments
MyTools_V24.zip
(35.14 KiB) Downloaded 1140 times

olly
Full Member
Posts: 71
Joined: Wed Jan 25, 2012 1:28 pm

Re: script collection for layer config, multiprint, reconcile...

Post by olly » Wed Jul 10, 2019 4:47 am

if I put the select widget in the script folder qCad did not start

smf
Premier Member
Posts: 177
Joined: Tue Feb 28, 2012 1:05 pm

Re: script collection for layer config, multiprint, reconcile...

Post by smf » Wed Jul 10, 2019 6:48 am

Hi Olly,

sorry for any inconvenience and thank you for sharing. Which version of QCad do you use and where did you place the SelectWidget exactly? My tools depend on some shared libraries in MyTools, so you can not use Select Widget standalone. Please put the complete MyTools in the script folder resulting in a directory structure like
.../scripts
.../scripts/MyTools
.../scripts/MyTools/MyTools.js
.../scripts/MyTools/MyTools.pro
.../scripts/MyTools/...
.../scripts/MyTools/SelectWidget
.../scripts/MyTools/SelectWidget/SelectWidget.js
.../scripts/MyTools/SelectWidget/...

Regards
smf

olly
Full Member
Posts: 71
Joined: Wed Jan 25, 2012 1:28 pm

Re: script collection for layer config, multiprint, reconcile...

Post by olly » Wed Jul 10, 2019 7:19 am

did not work for me no Quad Windows did not appear application quits immediately

the previous select widget version offers a black window from 3.22 on

on OSX 10.12 und 10.14

QCAD/CAM
Version:
3.22.0.0 (3.22.0)
Internet:
QCAD.org
Erstellungsdatum:
Mar 1 2019
Revision:
2ba5a26
Qt Version:
5.10.1
Architektur:
x86_64
Compiler:
Clang 10.0.0
Attachments
Bildschirmfoto 2019-07-10 um 08.12.37.pdf
(280.42 KiB) Downloaded 1806 times

olly
Full Member
Posts: 71
Joined: Wed Jan 25, 2012 1:28 pm

Re: script collection for layer config, multiprint, reconcile...

Post by olly » Wed Jul 10, 2019 7:20 am

thank you for looking into it - it´s very useful for my working ;-)

Post Reply

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