TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dubb on December 21, 2016, 02:13:06 PM

Title: MTEXT Editor to display current text
Post by: dubb on December 21, 2016, 02:13:06 PM
When I input this into the command line, I don't see a LIVE output of what I am typing. Is there a setting for that?

Code: [Select]
(COMMAND "MTEXT" PAUSE "r" pause "c" "n" "w" "0")
Title: Re: MTEXT Editor to display current text
Post by: Lee Mac on December 22, 2016, 08:00:24 AM
As an alternative:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:mtx ( / a e p z )
  2.     (if (and (setq p (getpoint "\nSpecify insertion point: "))
  3.              (setq a (getangle "\nSpecify rotation: " p))
  4.         )
  5.         (progn
  6.             (setq z (trans '(0 0 1) 1 0 t)
  7.                   a (+ a (angle '(0 0) (trans (getvar 'ucsxdir) 0 z t)))
  8.                   e
  9.                 (entmakex
  10.                     (list
  11.                        '(000 . "MTEXT")
  12.                        '(100 . "AcDbEntity")
  13.                        '(100 . "AcDbMText")
  14.                        '(001 . "")
  15.                         (cons 010 (trans p 1 0))
  16.                         (cons 011 (trans (list (cos a) (sin a)) z 0 t))
  17.                         (cons 210 z)
  18.                     )
  19.                 )
  20.             )
  21.             (command "_.mtedit" e)
  22.         )
  23.     )
  24.     (princ)
  25. )
Title: Re: MTEXT Editor to display current text
Post by: dubb on December 22, 2016, 01:41:49 PM
Thanks! Will try this.
Title: Re: MTEXT Editor to display current text
Post by: alanjt on January 04, 2017, 11:21:01 AM
Code: [Select]
(defun c:test (/ p r)
  (if (setq p (getpoint "\nSpecify first corner: "))
    (progn
      (setq r (cond ((getangle p "\nSpecify rotation angle <0d0'0\">: "))
                    (0.)
              )
      )
      (initdia)
      (command "_.mtext" "_non" p "_rotation" (* (/ r pi) 180.) "_columns" "_no" "_width" 0.)
    )
  )
  (princ)
)