Author Topic: SSGET Text Unformat  (Read 1477 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
SSGET Text Unformat
« on: September 28, 2017, 10:03:32 AM »
Hi,

I want to make selection set of all Texts in Drawing Starting from Keyword kwrd .
I am using :
Code: [Select]
(ssget "_x" (list (cons 0 "*TEXT") (cons 1 (strcat kwrd "*"))))It does not select texts in which formatting codes such as /U /T etc are present in the beginning.
How to remove text formatting codes in ssget ?

ronjonp

  • Needs a day job
  • Posts: 7527
Re: SSGET Text Unformat
« Reply #1 on: September 28, 2017, 10:14:40 AM »
Code - Auto/Visual Lisp: [Select]
  1. (ssget "_x" (list '(0 . "*TEXT") (cons 1 (strcat "*" kwrd "*"))))
« Last Edit: September 28, 2017, 10:50:07 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mailmaverick

  • Bull Frog
  • Posts: 493
Re: SSGET Text Unformat
« Reply #2 on: September 28, 2017, 10:32:23 AM »
Thanks for prompt reply but it will select all texts containing other than formatting codes in the beginning.
For example i want that "{\\fArial Narrow|b1|i0|c0|p34;\\LD12}" must be selected but "dffDdfdf" should not be selected.

I want to select only those texts which either start from kword or start from 'formatting codes' followed directly by kword.
« Last Edit: September 28, 2017, 10:35:53 AM by mailmaverick »

ronjonp

  • Needs a day job
  • Posts: 7527
Re: SSGET Text Unformat
« Reply #3 on: September 28, 2017, 10:50:52 AM »
Maybe:

Code - Auto/Visual Lisp: [Select]
  1. (ssget "_x"
  2.        (list '(0 . "*TEXT") (cons 1 (strcat kwrd "*,{\\*;" kwrd "*," kwrd "*,{\\*;\\*" kwrd "*")))
  3. )
« Last Edit: September 28, 2017, 10:59:57 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC