Archicad C++ API
About Archicad add-on development using the C++ API.

How to turn off all layers except the specified layer

LeeJaeYoung
Virtuoso


I want to learn how to turn off everything except the specified layer.
However, I followed the site below, but not all layers are turned off.

API hide all layers - Graphisoft Community

 

This site asks questions about changing the above code to version 27.
I found out that the index code only works within the number of layers.

Solved: Re: attrib.header.index = i; is error. - Graphisoft Community

 

I know how to know the number, but
I don't know what the first index is and what the next index is.
Where should I study?

 

AC27 on window 11
5 REPLIES 5
DGSketcher
Legend

You know this ability is available in the Quick Layers palette ? 

I can't help you on the API, but thought I would mention it in case you missed the existing tool.

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

thank you This is a question I asked to create an environment while working.
Yes, I am using the quick layer you mentioned well.

I'm asking because there are times when I need to turn on a few disabled layers and turn off all layers while working.
Thank you again for your interest.
Have a nice day.

AC27 on window 11
LeeJaeYoung
Virtuoso

What I want to know is that I can find out the number with getnum. Then how can I get the indices in order?
Is there no way?

AC27 on window 11
LeeJaeYoung
Virtuoso

If you know what the maximum value of the layer index is,
It's okay to search by index from 0 to the maximum value, but is there a function that can find the maximum and minimum values?

AC27 on window 11
Viktor Kovacs
Graphisoft
Graphisoft