Hi, All!
How can i detect which objects of "Model space" are shown in each AcadPViewport in "Paper space" layout consisting of multiple PViewports?
I am rendering layouts into TIFF-image (from VB OLE Automation controller) and want to store "Paper space" coordinates (bound box) of some objects residing in "Model space" (in order to highlight them on image in my application).
No problems if it is default layout showing "Model space" with VIEWPOINT 0,0,1. In this case i iterate through entire ModelSpace collection, finding my objects and translating bounding boxes WCS-->DCS-->PSDCS.
Problem happens if layout consists of many AcadPViewports and some AcadPViewports are specifically adjusted (has non default VIEWPOINT, excluded objects...). In this case i translating bounding boxes of objects from WCS to PSDCS and clipping invisible objects by means of each AcadPViewport:
a1 = .TranslateCoordinates(a1, acWorld, acDisplayDCS, False)
a1 = .TranslateCoordinates(a1, acDisplayDCS, acPaperSpaceDCS, False)
a2 = .TranslateCoordinates(a2, acWorld, acDisplayDCS, False)
a2 = .TranslateCoordinates(a2, acDisplayDCS, acPaperSpaceDCS, False).
Resulting bounding boxes - are 2D "Paper space" projections of 3D objects from "Model space" and i can clip them by bounding boxes of PViewport object. Projections inside PViewport's bounding box are accepted. Outside projections are rejected and i trying to use the next PViewport for this object (switching ActivePViewport, setting MSpace = true and repeating TranslateCoordinates).
But i do not know which PViewport must been used for projection of each object and which objects are excluded.
Thanks!
How can i detect which objects of "Model space" are shown in each AcadPViewport in "Paper space" layout consisting of multiple PViewports?
I am rendering layouts into TIFF-image (from VB OLE Automation controller) and want to store "Paper space" coordinates (bound box) of some objects residing in "Model space" (in order to highlight them on image in my application).
No problems if it is default layout showing "Model space" with VIEWPOINT 0,0,1. In this case i iterate through entire ModelSpace collection, finding my objects and translating bounding boxes WCS-->DCS-->PSDCS.
Problem happens if layout consists of many AcadPViewports and some AcadPViewports are specifically adjusted (has non default VIEWPOINT, excluded objects...). In this case i translating bounding boxes of objects from WCS to PSDCS and clipping invisible objects by means of each AcadPViewport:
a1 = .TranslateCoordinates(a1, acWorld, acDisplayDCS, False)
a1 = .TranslateCoordinates(a1, acDisplayDCS, acPaperSpaceDCS, False)
a2 = .TranslateCoordinates(a2, acWorld, acDisplayDCS, False)
a2 = .TranslateCoordinates(a2, acDisplayDCS, acPaperSpaceDCS, False).
Resulting bounding boxes - are 2D "Paper space" projections of 3D objects from "Model space" and i can clip them by bounding boxes of PViewport object. Projections inside PViewport's bounding box are accepted. Outside projections are rejected and i trying to use the next PViewport for this object (switching ActivePViewport, setting MSpace = true and repeating TranslateCoordinates).
But i do not know which PViewport must been used for projection of each object and which objects are excluded.
Thanks!