Page 1 of 2

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

Posted: Wed Feb 25, 2015 3:51 pm
by smf
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. :)

Re: script collection for layer config, multiprint, reconcil

Posted: Wed Feb 25, 2015 3:55 pm
by smf
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.

Re: script collection for layer config, multiprint, reconcil

Posted: Wed Feb 25, 2015 3:57 pm
by smf
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.

Re: script collection for layer config, multiprint, reconcil

Posted: Wed Feb 25, 2015 4:03 pm
by smf
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.

Re: script collection for layer config, multiprint, reconcil

Posted: Wed Feb 25, 2015 4:13 pm
by smf
Attached is a simple example demonstrating ActivateLayer, ActivateLayerConfig and MultiPrintToPDF.

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

Posted: Mon Mar 26, 2018 2:17 pm
by dfriasb
Very interesting! Thanks a lot smf!

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

Posted: Mon Mar 26, 2018 2:26 pm
by smf
Thanks for the feedback, dfriasb! :-) It's the first one after more than three years but very welcome! :-)

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

Posted: Mon Feb 11, 2019 5:39 pm
by marieke
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?

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

Posted: Mon Feb 11, 2019 8:36 pm
by smf
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

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

Posted: Sat Apr 27, 2019 2:41 pm
by smf
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

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

Posted: Thu May 02, 2019 2:15 pm
by smf
Hi there,

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

Sorry - smf

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

Posted: Wed Jul 10, 2019 4:47 am
by olly
if I put the select widget in the script folder qCad did not start

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

Posted: Wed Jul 10, 2019 6:48 am
by smf
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

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

Posted: Wed Jul 10, 2019 7:19 am
by olly
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

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

Posted: Wed Jul 10, 2019 7:20 am
by olly
thank you for looking into it - it´s very useful for my working ;-)