.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Find the objects which are visible from current viewport using AutoCAD API C#

1 REPLY 1
Reply
Message 1 of 2
kite15
786 Views, 1 Reply

Find the objects which are visible from current viewport using AutoCAD API C#

Hi,

Can any one help to find the objects which are visible from the current viewport?

 

Since, my current layout name is "ABC" viewport id is "123456". Now, can I find the items which are completely in different list and partially in a different list, visible from from "ABC" layout and belongs from the viewport which have the id "123456"

 

Thanks and regards,

1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: kite15

Basically what you need to do is find the Viewport's boundary points (assuming it is regular rectangle, then 4 corner points) and calculate their projected points in ModelSpace with proper transformation (Matrix3d). As long as your get the projected rectangle/polygon in ModelSpace, you can test which entities are inside the rectangle/Polygon.

 

Here is a relevant discussion where you can find good code for getting a Matrix3d to transform coordinates from PaperSpace to ModelSpace, or the other way around:

 

http://www.theswamp.org/index.php?topic=34590.msg398539#msg398539 

 

 

 

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report