Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Find text and change layer

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
tailgame
1301 Views, 3 Replies

Find text and change layer

Hi all,

I need to make a very simple lisp to

     1.Find sets of 4 unique texts from a drawing, move them to correspond layers

     2.Select all texts from 2 different layers, and change text to another layer.

 

For example, 

 

    Select 4 texts, such as “AB “ ;(AB and a space), “CD “, “EF “, “GH “

    Then change “AB “to “layer 1”, “CD “ to “layer 2”,  “EF “ to “layer 3”, and “GH “ to “layer 4”

    And

    Select all text from “layer 5”, change to “layer 6”

    Select all text from “layer 7”, change to “layer 8”

 

As you can see, all the arguments are already given so all I need to do is run the lisp.

As a newbie, I used

                (ssget "_X" '((0 . "TEXT")(1 . "AB "))) 

                (ssget "X" (List '(0 . "TEXT")'(8 . "layer5"))))

But it seems whatever I do, I get nothing. Could you somebody help me?

Thank you.

 

                 

 

 

3 REPLIES 3
Message 2 of 4
Ajilal.Vijayan
in reply to: tailgame

Hi,

The code which you mentioned should return a selection set.

try using the below code by changing "TEXT" to "*TEXT", so that the MTEXT will also include in the selection.

 

(setq sel (ssget "_X" '((0 . "*TEXT")(1 . "AB "))))
(command "change" sel "" "p" "la" "layer 1" "")

 Also do you know that FIND and QSELECT commands can aslo return a selection set based on the given criteria ?

 

Message 3 of 4
tailgame
in reply to: Ajilal.Vijayan

Originally, i wanted to use comand "filter" using preset list, but i could not figure out how to call the preset list.

This is good enogh for me at my level.

Thank you.

Message 4 of 4
radson99
in reply to: tailgame

hi

 

I'm completly new with lisps.

This one looks like something I'm after, has anyone got final version and could share please.

 

Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost