¸®½À °­Á - ¹®ÀÚ ¼öÁ¤À» ijµåÈ­¸é¿¡¼­ ¹Ù·Î ¼öÁ¤Çϱ⠸í·É.


º» °­Á´ ¾ÆÅ°¿ÀÇǽº(±èÈñÅÂ)¿¡ ÀÇÇØ ¸¸µé¾î Á³À¸¸ç ¾î¶°ÇÑ À¥À̳ª
ÃâÆǹ°¿¡ ¾ÆÅ°¿ÀÇǽº(±èÈñÅÂ)ÀÇ µ¿ÀǾøÀÌ ¿Ã¸®´Â °ÍÀ» Çã¶ôÇÏÁö ¾Ê½À´Ï´Ù.

 

ÀÌ ¿¹Á¦´Â ddedit ½Ã ¹®ÀÚ¼öÁ¤ÇÒ¶§ ´ÙÀ̾ó·Î±×»ó¿¡¼­ ¹®ÀÚ¸¦ ¼öÁ¤ÇØ¾ß Çߴµ¥
ÀÌ·± °Íº¸´Ù´Â ijµåÈ­¸é¿¡¼­ ¹Ù·Î ¼öÁ¤ÇÏ´Â°Ô ¾î¶² »ç¿ëÀÚ¿¡¼­´Â ´õ ÆíÇÒ¼ö ÀÖ½À´Ï´Ù.

´Ü ±â´ÉÀÇ ´ÜÁ¡Àº ¼öÁ¤¸ðµå¿¡¼­ Ä¿¼­°¡ Ç×»ó ¹®ÀÚ¸Ç µÚ¿¡ °¡ÀÖÀ½.(¸¶Ä¡ text ¸í·É°ú ¶È°°À½)
¿ÀÅäijµå 2000 ¹öÀüÀ̻󿡼­ ÀÛµ¿ÇÏ°í LT ¹öÀüÀº Á¦¿Ü.

vla-sendcommand ÇÔ¼ö¸¦ »ç¿ëÇÑ ÀÌÀ¯´Â command ÇÔ¼ö·Î´Â
¾Æ·¡ ±×¸²Ã³·³ ¼öÁ¤¸ðµå°¡ µÇÁö ¾Ê±â ¶§¹®ÀÔ´Ï´Ù.




Command:tedit (¸í·É½ÇÇà) => ¹®ÀÚ ¼±Åà => ¹®ÀÚ ¼öÁ¤¸ðµå


ÄÚµå

  
  (defun get_text_Align_string (tDxf / t72 t73 restr)
    (setq t72 (cdr (assoc 72 tDxf))
	  t73 (cdr (assoc 73 tDxf))
    )
    (cond
      ((or (and (= t72 0) (= t73 0)) (and (= t72 0) (= t73 nil)))
       (setq restr "")
      )
      ((and (= t72 1) (= t73 0)) (setq restr "j c ") )
      ((and (= t72 2) (= t73 0)) (setq restr "j r ") )
      ((and (= t72 4) (= t73 0)) (setq restr "j m ") )
      ((and (= t72 5) (= t73 0)) (setq restr "j f ") )
      ((and (= t72 3) (= t73 0)) (setq restr "j a ") )
      ((and (= t72 0) (= t73 3)) (setq restr "j tl ") )
      ((and (= t72 1) (= t73 3)) (setq restr "j tc ") )
      ((and (= t72 2) (= t73 3)) (setq restr "j tr ") )
      ((and (= t72 0) (= t73 2)) (setq restr "j ml ") )
      ((and (= t72 1) (= t73 2)) (setq restr "j mc ") )
      ((and (= t72 2) (= t73 2)) (setq restr "j mr ") )
      ((and (= t72 0) (= t73 1)) (setq restr "j bl ") )
      ((and (= t72 1) (= t73 1)) (setq restr "j bc ") )
      ((and (= t72 2) (= t73 1)) (setq restr "j br ") )
    )
    restr
  )

  (defun conv-point->str (pt / )
    (strcat (rtos (car pt) 2 8) "," (rtos (cadr pt) 2 8) )
  )

  (defun rtd (a)(/ (* a 180.0) pi))

  (defun c:tedit ( / tss tDxf tstyle tAlign tPt11 tPt10 tLayer tHeight tAngle tText runstr)
    (vl-load-com)
    (setq tss (ssget ":S" '((0 . "text"))))
    (if tss
      (progn
        (setq tDxf (entget (ssname tss 0))
              tstyle  (strcat "s " (cdr (assoc 7 tDxf)) "\r")
              tAlign  (get_text_Align_string tDxf)
              tHeight (strcat (rtos (cdr (assoc 40 tDxf)) 2 8) "\r")
              tAngle  (strcat (rtos (rtd (cdr (assoc 50 tDxf))) 2 8) "\r")
              tText   (cdr (assoc 1 tDxf))
              tLayer  (cdr (assoc 8 tDxf))
              tPt10   (strcat (conv-point->str (cdr (assoc 10 tDxf))) "\r")
              tPt11   (if (cdr (assoc 11 tDxf)) (strcat (conv-point->str (cdr (assoc 11 tDxf))) "\r"))
        )
        (cond
          ((= tAlign "j a ") (setq runstr (strcat "text " tstyle tAlign tPt10 tPt11 tText)))
          ((= tAlign "j f ") (setq runstr (strcat "text " tstyle tAlign tPt10 tPt11 tHeight tText)))
          ((= tAlign "")     (setq runstr (strcat "text " tstyle tAlign tPt10 tHeight tAngle tText)))
          (t                 (setq runstr (strcat "text " tstyle tAlign tPt11 tHeight tAngle tText)))
        )
        (setvar "clayer" tLayer)
        (command "erase" (ssname tss 0) "")
        (vla-sendcommand
          (vla-get-activedocument (vlax-get-acad-object))
          runstr
        )
      )
    )
  )