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

VB.NET SelectionFilter Twice

1 REPLY 1
Reply
Message 1 of 2
chase.hochstrasser
1343 Views, 1 Reply

VB.NET SelectionFilter Twice

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

1 REPLY 1
Message 2 of 2

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.
"I don't know" is the beginning of knowledge, not the end.


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