Jump to content

selected text change into current text style & height


akgbmb

Recommended Posts

Dear

I am looking for suitable lisp for selected text property change as below
(1) text size change into current text height
(2) text style change into current text style

 

select texts are may be single line text or mtext
pls support

Link to comment
Share on other sites

Try this

 

(defun c:t2c (/ ss sty tht cnt obj)
  (setq ss (ssget ":L" '((0 . "*TEXT"))))
  (cond (ss
          (setq sty (getvar 'textstyle) tht (getvar 'textsize))
          (repeat (setq cnt (sslength ss))
            (setq obj (vlax-ename->vla-object (ssname ss (setq cnt (1- cnt)))))
            (mapcar '(lambda (x y) (vlax-put obj x y)) (list 'stylename 'height) (list sty tht))
          );end_repeat
        )
  );end_cond
  (princ)
);end_defun

 

This will not override any formatted mtext and will use the current textstyle and textsize as defined by the system variables of the same name.

  • Like 1
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...