Author Topic: wondering why text get selected without wildcard characters.....  (Read 1420 times)

0 Members and 1 Guest are viewing this topic.

vincent.r

  • Newt
  • Posts: 101
wondering why text get selected without wildcard characters.....
« on: September 20, 2017, 09:35:51 AM »
(setq stbf (strcat "[1^LOOPDWG]" ))
(setq sublist (list (cons '0 "*text") (cons '1 stbf)))
(setq ed (ssget "X" sublist))
(setq qw (sslength ed))

I am writing above code for my lisp routine. Trying to find whole word in the drawing, but a text i.e. "L" get selected without using any wildcard character. I do not understand why its happening. Do anybody know it ? attached dwg file also.

ronjonp

  • Needs a day job
  • Posts: 7526
Re: wondering why text get selected without wildcard characters.....
« Reply #1 on: September 20, 2017, 09:54:21 AM »

Code - Auto/Visual Lisp: [Select]
  1. (ssget "_X" '((0 . "text") (1 . "`[1^LOOPDWG`]")))
« Last Edit: September 20, 2017, 11:16:38 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

vincent.r

  • Newt
  • Posts: 101
Re: wondering why text get selected without wildcard characters.....
« Reply #2 on: September 20, 2017, 10:04:52 AM »
Thanks for your quick reply ronjonp.

dont want to select two text, want select only one "[1^LOOPDWG]".


ronjonp

  • Needs a day job
  • Posts: 7526
Re: wondering why text get selected without wildcard characters.....
« Reply #3 on: September 20, 2017, 11:16:09 AM »
Thanks for your quick reply ronjonp.

dont want to select two text, want select only one "[1^LOOPDWG]".
Fixed above. You have to escape the brackets. Have a read HERE :) .

[...]   Matches any one of the characters enclosed
« Last Edit: September 20, 2017, 11:23:24 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: wondering why text get selected without wildcard characters.....
« Reply #4 on: September 20, 2017, 12:18:18 PM »
You can use this to be safe.

vincent.r

  • Newt
  • Posts: 101
Re: wondering why text get selected without wildcard characters.....
« Reply #5 on: September 22, 2017, 11:27:37 AM »
Thanks guys,


it works great ronjonp