Show/Hide blocks by name

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

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
Post Reply
User avatar
dfriasb
Full Member
Posts: 77
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
dfriasb@gmail.com | davidfriasarquitecto.es

Post Reply

Return to “QCAD 'How Do I' Questions”