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

window selection set with vb.net

1 REPLY 1
Reply
Message 1 of 2
joshlund
1119 Views, 1 Reply

window selection set with vb.net

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
1 REPLY 1
Message 2 of 2
chiefbraincloud
in reply to: joshlund

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

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