Page 1 of 1

script to Enable/Disable Layers

Posted: Thu Mar 27, 2008 6:39 pm
by lorenzen
Hi,

I have a made a houseplan with a multitude of layers, which will
be the source for a number of drawings, with different layers shown.

I cannot find any reference to the Show/Hide layer script functions.
I would like to implement something like this:

Code: Select all

function main() {
    var doc = new Document;
    var view = new View;

    var layers = [ "roof", "foundation", "wall1", "wall2" ];

    doc.HideAllLayers();
    for (var i = 0; i < layers.length; i++) {
        doc.ShowLayer(layers[i]);
    }
// doc.ShowAllLayers and doc.HideLayer would be nice to have too.

    view.zoomAuto();
}
Best Regards

Peter

I am using 2.1.6.4

Posted: Thu Mar 27, 2008 6:50 pm
by andrew
This is indeed not possible at this point. You can only set the active layer and add new layers.