Jump to content

Recommended Posts

Posted

Hello everyone...

I was wondering if there was a lisp or routine that worked with changing mutable layers to corresponding layers. I sometimes I have different scale viewports on the same sheet, so I need to have my text at different heights and on different layers like h-text4_duct(1/4 scale) and h-text8_duct(1/2 scale), and I would like to be able to create one scale and have a routine that could create the other.

For example, I could pick my text and the lisp would change it the corresponding layer and resize it.

H-text4_duct_new to H-text8_duct_new

H-text4_pipe_new to H-text8_pipe_new and so on….

Any help with this would be greatly appropriated.

Randall

Posted

Look at the AutoCAD commands: LayTrans and LayMrg

Posted

alanjt, thank you for the help, but they dont do want I need.

 

I need to keep both layers and resize the new layer.

 

Laymgr and Laytrans only get me half of the way there.

 

but thank you.

 

Randall

Posted

Sorry about that.

 

For what you are doing, just use Annotative text. Then you can keep one text object and one layer.

Posted
alanjt, thank you for the help, but they dont do want I need.

 

I need to keep both layers and resize the new layer.

 

Laymgr and Laytrans only get me half of the way there.

 

but thank you.

 

Randall

 

Not sure about if this will satisfy your needs

anyway you can try it

 

(defun C:demo (/ elist en la new_la ss)
(if (setq ss (ssget "_X" (list
     (cons 0 "TEXT")
     (cons 8 "H-text4_@@@@_new")
     )
     )
  )
 (while (setq en (ssname ss 0))
   (setq elist (entget en))
   (setq la (dxf 8 elist)
  new_la (vl-string-subst "8" "4"  la))
   (setq elist (entmod (subst (cons 8 new_la)(assoc 8 elist) elist)))
   (entmod (subst (cons 40 (* (cdr (assoc 40 elist)) 2))(assoc 40 elist) elist))
   (ssdel en ss)))
 (princ)
 )

 

~'J'~

Posted

Thank you Fixo, I got a error running the file.

 

"; error: no function definition: DXF"

 

Any idea what may be wrong?

 

Randall

Posted
Thank you Fixo, I got a error running the file.

 

"; error: no function definition: DXF"

 

Any idea what may be wrong?

 

Randall

 

Sorry, forgot ot add it, try this one instead

(defun dxf (key alist)
 (cdr (assoc key alist))
 )

(defun C:demo (/ elist en la new_la ss)
(if (setq ss (ssget "_X" (list
     (cons 0 "TEXT")
     (cons 8 "H-text4_@@@@_new")
     )
     )
  )
 (while (setq en (ssname ss 0))
   (setq elist (entget en))
   (setq la (dxf 8 elist)
  new_la (vl-string-subst "8" "4"  la))
   (setq elist (entmod (subst (cons 8 new_la)(assoc 8 elist) elist)))
   (entmod (subst (cons 40 (* (cdr (assoc 40 elist)) 2))(assoc 40 elist) elist))
   (ssdel en ss)))
 (princ)
 )

 

~'J'~

Posted
Sorry about that.

 

For what you are doing, just use Annotative text. Then you can keep one text object and one layer.

 

I have played with Annotative text and it just doesn't allow me to do everything I need to do with the text.

 

Thank you for your help..

 

Randall

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...