.NET

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

VB.NET SelectionFilter Twice

710 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,102
Registered: ‎10-12-2006
Message 2 of 2 (692 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.


You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community