window selection set with vb.net

window selection set with vb.net

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

window selection set with vb.net

Anonymous
Not applicable
Does anyone have a code sample that shows how to select drawing entities with a window? I found the .SelectWindow method of the Editor class but I'm stuck after that. If I could add filtering to the selection set that would be great too.

Thanks,
Josh

Civil 3D 2009 SP1
Win XP Pro SP2
VS 2005 SP1 - vb.net
0 Likes
1,290 Views
1 Reply
Reply (1)
Message 2 of 2

chiefbraincloud
Collaborator
Collaborator
The attached file has a little more than you asked for, but I didn't see any put in cutting it up any further. It will do a selection by rectangular window, polygon window, rectangle crossing or polygon crossing, with or without a filter.



To use the filter you create an array of the typed values you want to filter on, and pass the array to this function. For the window/crossing rectangle/polygon, you create a point3dcollection containing the points which define your polygon/rectangle. Note that with a rectangle you only pass the two points for the opposite corners, just like when you pick it on screen, but for a polygon you pass a point for each vertex.



The code chooses wether to do a Rectangle or Polygon based on the number of coordinates passed in the point collection, and there is a boolean argument for wether to do a window or a crossing. Also a couple of booleans to give you access to the RejectLockedLayer, RejectNonCurrentSpace, and Force/AllowSubSelections properties.
Dave O.                                                                  Sig-Logos32.png
0 Likes