Having trouble with Layout API methods:
LOEntityMoveToLayer
LOEntityListMoveToLayer
Do not appear to work?
So I’m trying the equivalent Ruby method:
Layout::Entity.move_to_layer
Also appears to not work?
Not sure what I might be missing or bugs within the methods?
Please see the attached ruby code I’m running and a simple layout file with 1 page, couple of objects, and some non-shared layers move_to_layer test code.txt (224 Bytes) Untitled.layout (16.8 KB)
Yes, it is complex for sure! The objects on the page are on a non-shared layer ‘Layer 1’. I’m grabbing the first layer from doc.layers which should be layer ‘Default’ (based on what I was getting for index’s that should be the first one). So I’m expecting the objects to end up on ‘Default’ layer. Code execution runs fine with no errors. I open the layout file to inspect the changes but the objects remain on layer ‘Layer 1’.
I was hoping the Ruby API method would clue me into something I might be missing with the Layout API method calls.
Before creating the topic I did run through the code and verify ‘Default’ layer is the first layer.
The objects are currently on layer ‘Layer 1’. Using Entity.move_to_layer does not result in changing the layer of the objects to layer ‘Default’.
I looked into this quickly. It does look like we have an issue with both LOEntityMoveToLayer and LOEntityListMoveToLayer when attempting to move an entity from a non-shared layer to another layer.
I verified this by running the following code, which makes the layer in your sample file that contains the entities shared first (and leaves the entities on the page):