Author Topic: GetSelection Error  (Read 2280 times)

0 Members and 1 Guest are viewing this topic.

tfieker

  • Mosquito
  • Posts: 6
GetSelection Error
« on: June 22, 2023, 10:32:50 AM »
Hello,
Where is the error in the GetSelection below using filters?
The "acSSPrompt.Status" returns error using ==>>  acTypValAr.SetValue(New TypedValue(DxfCode.ExtendedDataAsciiString, "P"), 2)

The entity XData in the blockReference is:
       Registered Application Name: DEVICE
       Code 1000, ASCII string: P
       Code 1000, ASCII string: UPD2


The code:
                Dim acTypValAr(2) As TypedValue
                acTypValAr.SetValue(New TypedValue(DxfCode.Start, "INSERT"), 0)
                acTypValAr.SetValue(New TypedValue(DxfCode.ExtendedDataRegAppName, "DEVICE"), 1)
                acTypValAr.SetValue(New TypedValue(DxfCode.ExtendedDataAsciiString, "P"), 2)

                Dim acSelFtr As SelectionFilter = New SelectionFilter(acTypValAr)
                Dim pso As New PromptSelectionOptions
                pso.MessageForAdding = "SELECT THE DEVICES"
                Dim acSSPrompt As PromptSelectionResult
                acSSPrompt = ed.GetSelection(pso, acSelFtr)

Thanks,
Tácito Fieker
CADGRAPH

n.yuan

  • Bull Frog
  • Posts: 350
Re: GetSelection Error
« Reply #1 on: June 22, 2023, 11:48:56 AM »
You can only use XData's application name as filter.

tfieker

  • Mosquito
  • Posts: 6
Re: GetSelection Error
« Reply #2 on: June 22, 2023, 12:14:47 PM »
I understand, however for a Polyline the code below works correctly:

                    acTypValAr.SetValue(New TypedValue(DxfCode.Start, "LWPOLYLINE"), 0)
                    acTypValAr.SetValue(New TypedValue(DxfCode.ExtendedDataRegAppName, "ARANHA"), 1)
                    acTypValAr.SetValue(New TypedValue(DxfCode.ExtendedDataAsciiString, "JUMPER"), 2)

The throttling is only happening for BlockReference.

Tácito Fieker
Cadgraph

Hanauer

  • Mosquito
  • Posts: 11
Re: GetSelection Error
« Reply #3 on: June 22, 2023, 02:09:18 PM »
Same situation here.
According to the documentation, you can filter XData only by the application name (DxfCode.ExtendedDataRegAppName).
But for some situations it works to filter in addition to the name (DxfCode.ExtendedDataRegAppName) also by value (DxfCode.ExtendedDataAsciiString).
From what I've tested, filtering by value works for MText, Table, Polyline and Ellipses. Does not work for Insert, Line, Arc, Circle.

tfieker

  • Mosquito
  • Posts: 6
Re: GetSelection Error
« Reply #4 on: June 22, 2023, 02:21:29 PM »
Yes, the same for me.
Thank you all!