Author Topic: Entmakex Failed create all TEXT/s near poins0,0,0?  (Read 165 times)

0 Members and 1 Guest are viewing this topic.

d2010

  • Bull Frog
  • Posts: 210
Entmakex Failed create all TEXT/s near poins0,0,0?
« on: October 06, 2021, 09:49:06 AM »
I try this lisp,
I want create TEXT with entmakex, but all TEXT/s near at points.zero (list 0.0 0.0 0.0)
The main problem is
  (dfn_enamk_textddi (getstring) (getpoint) 2.0 0.0 "C" 11)

Code: [Select]
(defun dfn_enamk_textddi(ctextlsh pnt put_ScaleHeight rotation justification epscolor / $rr ldc jna rst jnc cec hei inal ppt)
 (setq;|a000|;
rst (read "STR")
hei (getvar "TEXTSIZE")
ina put_ScaleHeight
inal (if (=  inal nil) hei (if (numberp inal) (abs (* hei inal)) hei))
ldc (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 10 pnt) (cons 1 ctextlsh) (cons 40 inal) (cons 7 (getvar "TEXTSTYLE")))) (setq;|a000|;
cec (if (=  (type epscolor) (read "INT")) (abs epscolor) cec)
cec (boole 1  cec 511)
cec (if (>  cec 256) 256 cec)
jna (if (=  (type justification) rst) (substr justification 1 1) nil)) (setq;|a000|;
jnc (if (=  jna "C") 1 (if (=  jna "R") 2 (if (=  jna "A") 3 (if (=  jna "M") 4 (if (=  jna "F") 5 (if (=  jna nil) nil (if (>  jna "A") 0 nil)))))))) (setq;|a000|;
ldc (if jnc (append ldc (list (cons 72 jnc))) ldc)) (setq;|a000|;
ldc (append ldc (list (cons 62 cec) (cons 50 rotation)))) (setq;|a000|;
$rr (entmakex ldc))
$rr)
« Last Edit: October 06, 2021, 10:27:03 AM by d2010 »

Lee Mac

  • Seagull
  • Posts: 12526
  • London, England
Re: Entmakex Failed create all TEXT/s near poins0,0,0?
« Reply #1 on: October 06, 2021, 11:44:36 AM »
You'll need to provide DXF group 11 (the text alignment point) when creating single-line text with justification set to something other than Left.

mhupp

  • Newt
  • Posts: 40
Re: Entmakex Failed create all TEXT/s near poins0,0,0?
« Reply #2 on: October 07, 2021, 11:48:48 AM »
DXF group 10 if you want to use left