Jump to content

Recommended Posts

Posted

just quickly does any one know of a lisp to filter text - i have recieved a massive survey and have to change all point numbers to a different layer - the point numbers are on the same layer as point heights.

 

The only difference between the 2 is that every height has a decimal point - anyone know how to filter out the decimal point text??:D

Posted

I ended up using the properties quick select and used the

TEXT - CONTENTS

operator = * Wildcard match

Value **.*

 

Thanks anyways

Posted

if someone needs a lisp

without decimal point

(ssget "_X"
      (list (cons 0 "TEXT") (cons 410 (getvar "CTAB")) (cons 1 "~*`.*"))
)

with decimal point

(ssget "_X"
      (list (cons 0 "TEXT") (cons 410 (getvar "CTAB")) (cons 1 "*`.*"))
)

Posted

i'll definately be grabing that - very handy to know - thanks heaps:D

  • 3 months later...
Posted
if someone needs a lisp

without decimal point

(ssget "_X"
      (list (cons 0 "TEXT") (cons 410 (getvar "CTAB")) (cons 1 "~*`.*"))
)

with decimal point

(ssget "_X"
      (list (cons 0 "TEXT") (cons 410 (getvar "CTAB")) (cons 1 "*`.*"))
)

 

 

How about this filter?

Say the filter above will select also the following string

"A.PTR-900-322-BLD"

As you see there are no decimals in this string

 

(ssget "_X"
      (list (cons 0 "TEXT")
     (cons 410 (getvar "CTAB"))
     (cons -4 "<and")
     (cons 1 "#*")
     (cons 1 "*.#*")
     (cons -4 "and>"))
)

 

Maybe I'm wrohg though

 

~'J'~

Posted

Must start with a number AND have a decimal AND number following the decimal.

 

(ssget "_X"
      (list (cons 0 "TEXT")
     (cons 410 (getvar "CTAB"))
     (cons 1 "#*`.#*"))
)

Posted

Match any string except those with a decimal followed by a number.

"~*`.#*"

Posted

Hey guys thats great has helped me heaps.

 

But still i have a problem

 

i want to select all text and mtext objects that are underlined.

 

I can select the text objects but am having problems with the mtext objects.

 

This is what i've got - please tell me what im doing wrong

 

(DEFUN C:TEST2 ()
(SETQ SS5 (SSGET 

'(
(-4 . "<OR")
(-4 . "<AND") 
 (0 . "TEXT");select text objects
 (1 . "%%U*");that are underlined
(-4 . "AND>")
(-4 . "<AND")
 (0 . "MTEXT");select mtext objects 
 (1 . "\L*");that are underlined
(-4 . "AND>")
(-4 . "OR>")
   )
 )
)
(PRINC)
)

Posted

Thanks Fixo.:)

 

 

Russell

(1 . "*\L*");that are underlined

 

You may also need this:

(1 . "*%%U*");that are underlined

if the underline is not at the beginning of the text string.

Posted

Thanks cab but that code for the underlined mtext works for objects that aren't underlined.

 

eg

 

(1 . N16 GALVANISED x 300 LONG\P@ 1200 CTS EMBEDED 200mm INTO\PEXISTING 
PAVEMENT.)

it also slects the above text.

 

i only want to select text thats in the format

(1 . {\LPLAN})

 

know what i mean??

Posted

ok got it

 

(1 . "{*\L*}")

 

thanks

Posted

You may want to give this a test drive.:)

(SETQ SS5 (SSGET '((0 . "TEXT,MTEXT")(1 . "*%%U**%%u*,{*\L*}"))))

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...