.NET

Reply
Active Contributor
chase.hochstrasser
Posts: 42
Registered: ‎07-17-2013
Message 1 of 2 (798 Views)

VB.NET SelectionFilter Twice

798 Views, 1 Replies
09-10-2013 08:27 AM

I would like to select all layers with a filter then check if the insertion point is the same on anyother layer without a filter. So i do 2 promptselectionResults. The first does great but the second fails with an error, assuming this means 0 items were found. my code snipet is below of my promptselectionresults in VB.NET

 

'' Create a TypedValue array to define the filter criteria
Dim acTypValAr(0) As TypedValue
acTypValAr.SetValue(New TypedValue(DxfCode.LayerName, "PLOH*"), 0)

'' Assign the filter criteria to a SelectionFilter object
Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)

'' Request for objects to be selected in the drawing area
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectAll(acSelFtr)

'' If the prompt status is OK, objects were selected
If acSSPrompt.Status = PromptStatus.OK Then

. . .

 

 . . .


'' Select anything found at the sampe points
Dim acTypValAr2(0) As TypedValue
acTypValAr2.SetValue(New TypedValue(DxfCode.LayerName, "*"), 0)

'' Create a filter from type value
Dim acSelFtr2 As SelectionFilter = New SelectionFilter(acTypValAr2)

'' Get all objects in cross window using filter and select anything at the same point
Dim acSSPrompt2 As PromptSelectionResult
acSSPrompt2 = acDocEd.SelectCrossingWindow(p1, p2, acSelFtr2)

'' Check if prompt is good and items were found
If acSSPrompt2.Status = PromptStatus.OK Then

*Expert Elite*
dgorsman
Posts: 5,698
Registered: ‎10-12-2006
Message 2 of 2 (780 Views)

Re: VB.NET SelectionFilter Twice

09-10-2013 12:18 PM in reply to: chase.hochstrasser

Just so we're clear on this - you want to select *entities* on specific layers, right?

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.