It looks like you're new here. If you want to get involved, click one of these buttons!
I wish to get a bounding box of the data in a cell and its
descendants. There's a catch, I want only mask layers to affect
this bounding box and I do not want text/labels to affect the
bounding box. I am given the list of mask layers.
What is the best way to do this?
Thanks
Dave
Comments
Hi Dave,
you mean within a script?
Here is one:
It's not highly efficient since it will iterate over all flat shapes. A more elaborate solution is to cache the bounding boxes of the cells and take the instances' bounding boxes rather than iterating over their shapes.
So it's not the "best way" but maybe a "reasonably simple way".
Matthias
Thank you. You actually helped with two questions. Firstly, I understand how to most efficiently get a bbox, and secondly, (this may come in handy for other forum readers) your code showed me how to make an undefined bbox suitable for starting to accumulate data extents. In other words, a box with left greater than right and bottom greater than top. I had no luck forcing a Box instance to do this with my own default values
and should have guessed the DBox default would work.
I really appreciate the help.
Dave