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

Post Reply
smf
Premier Member
Posts: 164
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 205 times

smf
Premier Member
Posts: 164
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: 164
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: 164
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: 164
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 236 times
MyToolsExample.dxf
example source
(103.4 KiB) Downloaded 186 times

User avatar
dfriasb
Full Member
Posts: 77
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
dfriasb@gmail.com | davidfriasarquitecto.es

smf
Premier Member
Posts: 164
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! :-)

Post Reply

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