Jump to content

Modify some LeeMac code help?


ILoveMadoka

Recommended Posts

This code by LeeMac works perfectly (modifies the Line Space Factor for MTEXT)
[The distance between Multiple Lines - FYI) 

 

(defun c:mtlsp ( / i s )
   (if (setq s (ssget "_X" '((0 . "MTEXT") (-4 . "<>") (44 . 0.5))))
       (repeat (setq i (sslength s))
           (entmod (append (entget (ssname s (setq i (1- i)))) '((44 . 0.5))))
       )
   )
   (princ)
)

 

Lee Post

 

I modified it a bit to select only what I wanted vs selecting ALL

 


(defun c:mtlsp ( / s )
(setq s (ssget '((0 . "MTEXT"))))
   (if s
       (progn
           (repeat (setq i (sslength s))
               (entmod (append (entget (ssname s (setq i (1- i)))) '((44 . 1.40358))))
           )
           (princ "\nValue changed successfully.")
       )
       (princ "\nNo MTEXT entities selected.")
   )
   (princ)
)

 

I want to add a step to move each selected MTEXT in the Y direction 0.5.


I do not know how to add that into this code...
Help please....

 

Edited by ILoveMadoka
Link to comment
Share on other sites

What about this

;;; By Lee Mac with mods by ILoveMadoka
(defun c:mtlsp ( / s )
(setq s (ssget '((0 . "MTEXT"))))
   (if s
       (progn
           (vl-cmdf "_.move" s "" "_non" '(0. 0. 0.) "_non" '(0. 0.5 0.))
           (repeat (setq i (sslength s))
               (entmod (append (entget (ssname s (setq i (1- i)))) '((44 . 1.40358))))
           )
           (princ "\nValue changed successfully.")
       )
       (princ "\nNo MTEXT entities selected.")
   )
   (princ)
)

 

Link to comment
Share on other sites

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