Hi Kike,
Thank you very much for looking into this.
I understand the problem with annotation text inside dimensions - they flip based on the active view direction. However, even plain annotation text can behave dependent on a view once you use annotation style with “Horizontal to view” setting. How did you achieve to handle it? Are you somehow skipping this case?
We could theoretically define two cases when it comes to dimension settings/view/bbox relation.
1st case is when you as a user want to have the annotation text in dimension readable and therefore oriented by the view. Or you want view oriented plain annotation text. For this case though I can’t straight away recall a reason for which I would utilize BBox. Maybe some viewport draw foreground witchcraft but we are not doing that.
2nd case is ours, and that is when you need accurate bounding box of annotation because you need to use it eg. for positioning stuff around it, or nesting overlapping dimensions. That in our case implies that your context is a plane in which the dimension exists and that is the information that is known for most annotation objects IRRC. If there is not Plane input directly, then the plane can be at least determined from other inputs. And that object defining plane is exactly the plane in which we search for the element bounding box. I guess it is carried along with each element since it can be also read using the annotation components, and BBox component has it as an input too.
How to deal with the logic around “Horizontal to view” I don’t know. Now I’ll be thinking aloud:
Could default behavior be that bounding box is always considered for the object’s defining plane? If the “Horizontal to view” invalidates such approach in some cases, could annotation element using annotation style with “Horiontal to view” setting ON be skipped?
What I don’t know is, if each annotation object carries information about its bounding box and BBox component just reads it, or if it actually computes it from annotation geometry and objects defined against view are omitted?
All in all I want to say, that even the fix you made will probably be sufficient for my case, because I have all annotation texts in one common plane and NOT “Horizontal to view”. Script is working from the top view and all annotations are in world XY. Also for dimensions the accurate length is better than the wrong value we had previously.
Ideal case remains the same though. If it’s too hard to reach it or it is too difficult and niche to be prioritized, we have to accept it.