Selecting Entities In ModelSpace Through Viewport

Selecting Entities In ModelSpace Through Viewport

Anonymous
Not applicable
1,650 Views
1 Reply
Message 1 of 2

Selecting Entities In ModelSpace Through Viewport

Anonymous
Not applicable

Hello,

 

I want to select entities in modelspace which are visible in a given viewport on a layout. My viewport is a non-rectangle polygon. Please can you help me to found a way to have access to the object used to create the viewport ? After if I know the object used to create the viewport, I can used the function  translatecoordinates and select the visible objects in modelspace.

 

Thanks for your help

 

0 Likes
Accepted solutions (1)
1,651 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor
Accepted solution

Unfortunately, AutoCAD's COM API (used by VBA) does not expose the detail of non-rect viewport boundary (a polyline associated to the viewport in some way).

 

So, you cannot use VBA code to get all the points (vertices of the polyline) needed to project into modelspace as selecting polygon. This gives you one more reason to give up VBA and move to AutoCAD .NET API, where you can easily get the non-rectangular clipping polyline of given viewport on layout.

Norman Yuan

Drive CAD With Code

EESignature