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

LISP Needed to change objects from one layer to another

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mviscetto
1882 Views, 3 Replies

LISP Needed to change objects from one layer to another

Hello,

I am in need of a Lisp that will convert selected objects from the layer they are on to a different layer.

The following is what I am thinking.

 

1) create the selection set (as was provided to me yesterday by "hmsilva" (THANK YOU))

 

     (defun c:demo ( / ss)
  (if (setq ss (ssget "_:L" '((8 . "E-CAB-BORE-NP,E-CAB-PART-NP,E-CAB-POCKET-NP"))))
    (command "_.move" ss "" "\\" "\\")
    )
  (princ)
  )

 

 

But now that I have moved these objects I need to convert them to the layers that our machines can use.

 

E-CAB-BORE-NP TO BORE

E-CAB-PART-NP TO SHAPE

E-CAB-POCKET-NP TO POCKET_T{14STRT}

 

Thank you again in advance.

Also, I am open to other suggestions on how to complete this task with as few steps as possible.See attached dwg for full process.

 

Have a great day.

Michael

 

3 REPLIES 3
Message 2 of 4
hmsilva
in reply to: mviscetto

If the new layer don't exist at the dwg, try the command -RENAME, if exists take a look at -LAYMRG command.

Henrique

EESignature

Message 3 of 4
mviscetto
in reply to: mviscetto

Thank you for the tip to use LAYMRG.

And after reading some other threads on this I discovered what I needed to compile.

This is what I came up with.

 

Thanks again

Michael

 

;;script to use layer merge for Cabinet layers – LC for Layer Change

 

 

(defun c:lc ()

(Command "_laymrg" "t" "e-cab-bore-np" "" "t" "bore" "y")

(Command "_laymrg" "t" "e-cab-part-np" "" "t" "shape" "y")

(Command "_laymrg" "t" "e-cab-pocket-np" "" "t" "POCKET_T{14STRT}" "y")

(Command "_laymrg" "t" "e-drawer-bore-np" "" "t" "bore" "y")

(Command "_laymrg" "t" "e-drawer-part-np" "" "t" "shape" "y")

(Command "_laymrg" "t" "e-drawer-pocket-np" "" "t" "POCKET_T{14STRT}" "y")

)

 

 

 

 

Message 4 of 4
hmsilva
in reply to: mviscetto

You're welcome, mviscetto
Glad you got it sorted!

Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost