Show/Hide blocks by name

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

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

Show/Hide blocks by name

Post by dfriasb » Mon Jan 01, 2018 12:36 pm

Hello all and happy New Year!

I'm trying to write a script to show/hide specific blocks depending on their name. For example, I would like to control visibility of all the blocks that contain "_old" string in their name.

In order to "filter" these names I'm trying this piece of script:

Code: Select all

// ...
var BlockNamePart1 >= "A";
// I'm not really sure this variable definition is working in js...
if (block.getName() >= BlockNamePart1 + "_old") {
Block.showHide(false);
// I'm not sure this is possible neither...
op.addObject(layer);
//...
Any help about this?

Best regards!
David
David Frías Barranco | architect
[email protected] | davidfriasarquitecto.es

Post Reply

Return to “QCAD 'How Do I' Questions”