TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: vincent.r on September 20, 2017, 09:35:51 AM

Title: wondering why text get selected without wildcard characters.....
Post by: vincent.r 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.
Title: Re: wondering why text get selected without wildcard characters.....
Post by: ronjonp on September 20, 2017, 09:54:21 AM

Code - Auto/Visual Lisp: [Select]
  1. (ssget "_X" '((0 . "text") (1 . "`[1^LOOPDWG`]")))
Title: Re: wondering why text get selected without wildcard characters.....
Post by: vincent.r 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]".

Title: Re: wondering why text get selected without wildcard characters.....
Post by: ronjonp 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 (http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-E9CDCF5E-0E9F-4072-8A1D-099764B0A19E) :) .

[...]   Matches any one of the characters enclosed
Title: Re: wondering why text get selected without wildcard characters.....
Post by: Lee Mac on September 20, 2017, 12:18:18 PM
You can use this (http://lee-mac.com/escapewildcards.html) to be safe.
Title: Re: wondering why text get selected without wildcard characters.....
Post by: vincent.r on September 22, 2017, 11:27:37 AM
Thanks guys,


it works great ronjonp