Author Topic: Text Dynamic  (Read 1235 times)

0 Members and 1 Guest are viewing this topic.

amc.dicsac

  • Newt
  • Posts: 109
  • Autocad 2008
Text Dynamic
« on: December 06, 2016, 10:09:55 AM »
Hi.

I have this code that inserts a text using grread function to which I want to add the option to rotate and resize but I have no idea how to do it would appreciate the help.

Thanks

Code - Auto/Visual Lisp: [Select]
  1. (defun c:xaa (/ potencia prefijo pt)
  2. (setvar "cmdecho" 0)
  3. (setq potencia (strcase (getstring T "\nIngresa potencia monofásica: ")))
  4. (setq prefijo (*AX_mtext* (strcat potencia "\\P" "1Ø/220V")))
  5.   (eq (car (setq pt (grread t 15 0))) 5)
  6.   (redraw)
  7. (entmod (subst (cons 10 (cadr pt)) (assoc 10 (entget prefijo)) (entget prefijo))))
  8. (setvar "cmdecho" 1)
  9.  
  10. (defun *AX_mtext* (s)
  11.    (entmakex
  12.       (list (cons 0   "MTEXT")        
  13.             (cons 100 "AcDbEntity")        
  14.             (cons 100 "AcDbMText")  
  15.             (list 10 0. 0. 0.)
  16.             (list 11 0. 0. 0.)
  17.             (cons 71 1)
  18.             (cons 40 0.2)
  19.             (cons  1 s)
  20.             (cons  7 "0-DEU-ROMANS")
  21.  
  22.       )
  23.    )
  24. )
  25.  
<a href="http:/http://axprogramlisp.blogspot.pe" class="bbc_link" target="_blank">By Alexander Castro</a>

danallen

  • Guest
Re: Text Dynamic
« Reply #1 on: December 06, 2016, 12:06:25 PM »
in the mode of teaching to fish:
  • run your code to create sample text
  • copy text 1 or 10 units to right, modify with rotation you want
  • run code below QED to list entity data on both texts, compare the value than changed other than position (group 10)
  • see if you can add to your code to modify rotation
  • do again with scale

Code - Auto/Visual Lisp: [Select]
  1. (defun c:QED () (foreach x (entget (car (entsel)))(print x))(princ))