Quantcast
Channel: Autodesk AutoCAD forums
Viewing all articles
Browse latest Browse all 14319

VB.NET SelectionFilter Twice

$
0
0

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


Viewing all articles
Browse latest Browse all 14319

Trending Articles