Help with Prompt Selection Options with Custom Message

Help with Prompt Selection Options with Custom Message

David_Prontnicki
Collaborator Collaborator
1,444 Views
2 Replies
Message 1 of 3

Help with Prompt Selection Options with Custom Message

David_Prontnicki
Collaborator
Collaborator

Hi all,

I am hoping someone can help me with this. I am trying to allow for the selection of multiple cogo point but also filter so only cogo points can be selected. I have been playing with the code below but it does not show my custom message; it seems to bypass it completely. I am sure it is something simple but I just cant get it. Any help would be greatly appreciated. 

 

Try

            'Create a typedvalue array to define the filter criteria
            Dim acTypValAr(0) As TypedValue
            acTypValAr.SetValue(New TypedValue(DxfCode.Start, "AECC_COGO_POINT"), 0)

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

            Dim promptSelectionOptions = New PromptSelectionOptions
            promptSelectionOptions.MessageForAdding = (vbLf & "Select COGO Points to move labels:")

            Dim selectedCogoPointsResult = SelectionPromptResults(acSelFtr)

            'If selection is a cogo point
            If selectedCogoPointsResult.Status = PromptStatus.OK Then

                Dim acSSet As SelectionSet = selectedCogoPointsResult.Value

In conjunction with this function:

Private Function SelectionPromptResults(options As SelectionFilter) As PromptSelectionResult

        Dim acDocEd As Editor = Active.Editor

        Return acDocEd.GetSelection(options)

    End Function
0 Likes
Accepted solutions (1)
1,445 Views
2 Replies
Replies (2)
Message 2 of 3

hippe013
Advisor
Advisor
Accepted solution

You need to pass both the options and the filter to the function GetSelection.


Dim tv(0) As TypedValue tv.SetValue(New TypedValue(DxfCode.Start, "AECC_COGO_POINT"), 0) Dim filter As New SelectionFilter(tv) Dim pso As New PromptSelectionOptions() pso.MessageForAdding = vbCrLf + "Select Cogo Points Move Labels" Dim res As PromptSelectionResult = ed.GetSelection(pso, filter)
Message 3 of 3

David_Prontnicki
Collaborator
Collaborator

Thank you, I knew it would be something simple. I appreciate the help!

0 Likes