How can I do crossing line selectionset

How can I do crossing line selectionset

Anonymous
Not applicable
731 Views
2 Replies
Message 1 of 3

How can I do crossing line selectionset

Anonymous
Not applicable

Hi Guys,

 

I am using VB.net to do a selectionset for any object crossing a line. I can pass 2 points fo the line(start and end )

 

In vb6I use.

Select acSelectionSetCrossing, vStartWithin, vEndWithin, varDataType, varDataFilter

 

What I should use in .Net?

 

I tried using objEd.SelectCrossingWindow(StartPoint, EndPoint, objFilter)

it returns wrong result.

 

Any ideas?

 

Thanks

 

0 Likes
732 Views
2 Replies
Replies (2)
Message 2 of 3

chiefbraincloud
Collaborator
Collaborator

Put the two points in a Point3dCollection and use Editor.SelectFence

Dave O.                                                                  Sig-Logos32.png
0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor

Editor.SelectCrossingWindow() IS equivalent to VBA's AcadSelectSet.Select acSelectionSetCrossing. That is, the 2 points define a rectangle, anything inside the rectangle and anything crossed by the rectangle border is selected.

 

BTW, when you call this method (and other Editor.SelectXXXXXX() methods, for this matter), the rectangle/polygon MUST be inside the current view. That is, if the rectangle is larger than the visible area of the current view, the returned selectionSet will not be correct as you expected. You may want to zoom the view to make it a bit larger than the selecting rectangle (e.g. make sure the selecting rectangle within visible area of the current view).

 

If you only want entities that are crossed by the line, not inside the rectangle/polygon (as you described), then you need to use Editor.SelectFence().

Norman Yuan

Drive CAD With Code

EESignature