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

How to get the float viewport collection through a circle?

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
swaywood
854 Views, 4 Replies

How to get the float viewport collection through a circle?

in the modelspace there is a little circle.

in the current paperspace there are several viewports.

now i want to get the viewports which can view the little circle.

the circle point is pt.

4 REPLIES 4
Message 2 of 5
norman.yuan
in reply to: swaywood

The steps of doing what you want would be like:

 

1. Find all viewports on the current layout (you may want to limited to locked viewport only);

2. Get each viewport's boundary (a collection of points, which could be 4 points of a rectangle, or all vertex points of a non-rectangle polyline2d);

3. Transform the viewport boundary points to modelspace points.

4. decide if the entity in interest in modelspace is contained inside the viewport's boundary projected in modelspace.

 

The key computing work here is:

 

1. how to translate a point ini paperspace into modelspace;

 

There are some sample code you can find if searching the Internet. Here is one of the link:

 

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

 

 

2. how to decide if an entity is located fully or partially inside a closed curve;

 

You can use Editor.SelectCrossingWindow/Polygon() to find if an entity is fully/partially inside a window or polygon. Make sure you zoom to the extents of the window or polygon first.

 

Actually, I have just started a draft for my blog article on this topic a couple days ago and have not finished it. Since you asked here, I'll post back when the article is published.

 

Message 3 of 5
swaywood
in reply to: norman.yuan

hi,yuan:
thank you very much.
i have done something like your step. but today, i found another method, that is linq, i want to make this program suing both the two method. and i also expect your post.
ps, r u chinese?
best regards
swaywood
Message 4 of 5
norman.yuan
in reply to: swaywood
Message 5 of 5
swaywood
in reply to: norman.yuan

yuan,thanks a lot.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost