How to get the open status of tags in layout?


How to get the status of every tag in layout by C LAYOUT API?
I only find the API “LOSketchUpModelGetLayersModified” below ,which only could return whether the tags have been changed, but can’t tell me whether the tag is open or close…

Not yet exposed to the SketchUp APIs. This was requested over 3 years ago:

thanks, by the way ,in order to get the tag status , I think of another way ,that is to use “LOSketchUpModelGetModel” to get SUModelRef and then use “SUModelGetSceneWithName” to get the scene used in a layout page ,but the numOfLayer return zero when I use the code “SUSceneGetNumLayers(scene,&numOfLayer )”, Isn’t it the way to get the layer open status in the scene By api?

No. A scene page’s layers collection only contains references to tag/layers that do not use the default visibility according to the layer/tag’s page behavior.

The C API’s documentation is overly terse and lacks much needed information. So, it is a good practice to compare that C API’s functions to the Ruby API’s methods.


Also, I think that LayOut allows the tag/layer visibility to be overridden in LayOut. So, LO’s collection of tags is a separate collection that can override what is actually set in the model’s layers collection.

In Ruby API’s methods, how to get the layer’s visibility in the selected scene from a skp file? because one layer can be set different visibility in different scene.

The Ruby API is a “live” application API only. You would need to open the skp file in SketchUp in order to use the Ruby API upon it.

The answer to your question is in the Ruby API documentation at:

thansks,by the way, The C API’s documentation is really overly terse,finally I can’t use sketchup cAPI to get the open status of layer in a scene in a skp file.
I only find three possible API, one is “SULayerGetSceneBehavior”,but it is not related to SUScene


one is “SUSceneGetDrawingElementHidden”, but it is not control by layer,and the last API is “SUSceneGetNumLayers”,I guess whether it will return open layer’s number in the scene,but it is not…

image