Hi @KGV
Directly navigate through or restore specific versions via Lucidchart's API is not possible.
You have to try other possibilities as well as here is the help article related to API methods - https://developer.lucid.co/
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards
Hello @Humas1985 ,
I think you meant to address another question with the answer. Can you support with this question scope about block containers?
Hi @KGV - Regret for the inconvenience caused, yes it was prepared for a different use case - let me look into your use case and will get back to you in a bit.
Hi @KGV
Per your finding on the getContainers() method in Lucid have limitations with nested blocks.
We should try other possibilities like - Iterative Traversal with Bounding Boxes or Custom Logic based on Parent-Child Relationships
We will also take some right direction from the team here.
CC: @Addie - Could you please take this use case for @KGV .
Regards
Thank you for your question @KGV! Also, thank you for your contributions @Humas1985, Addie and I always appreciate your work in the Lucid Community.
@KGV we are happy to take a closer look at your use case and see why you could be getting an empty array. Can you please share a screenshot of your document (showing the nested blocks) along with your code snippet using the getContainers() method?
Hey @KVG!
After looking into this in depth, it looks like the getContainers() method will only return containers (swim lanes, frames, etc.) that surround the block, instead of nested blocks. To circumvent this, I would recommend using the getBoundingBox() method as well as the isBoxWithin() helper method to determine if a block resides within another.
Happy to answer any other questions that come up!
Hello @Connor B101 , I used the suggested workaround, and it works fine as a replacement to what I am trying to do with method getContainers() But I will need to add extra logic/structures that might be a bit expensive if the diagram contains big number of blocks/elements, which might consume longer time to process, and it would be ideal if the getContainers() method is extended to the documentation scope. I will use the isBoxWithin() for now.
Thank you