¸®½À °­Á - Æú¸®¶óÀÎÀ» µû¶ó ÀÏÁ¤ÇÑ °£°ÝÀ¸·Î ¹øÈ£ ¸Å±â´Â ¿¹Á¦.


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

 

Æú¸®¶óÀμ±À§¿¡ ÀÏÁ¤ÇÑ °£°ÝÀ¸·Î Æú¸®¶óÀΰú ÆòÇàÇÏ°Ô ¹øÈ£¸¦ ¸Å±â´Â ¿¹Á¦ÀÔ´Ï´Ù.



½ÇÇà¸í:p-divide-t


ÄÚµå



(defun c:p-divide-t ( / pn le first x el n ssp th rtd)
  (defun rtd (a)(/ (* a 180.0) pi))
  (setq pn (car (entsel "\nÆú¸®¶óÀÎÀ» ¼±ÅÃÇϼ¼¿ä.")))
  (setq le (getreal "\n°Å¸®°ªÀ» ÀÔ·ÂÇϼ¼¿ä :"))
  (setq th (getreal "\n¹®ÀÚÀÇ Å©±â¸¦ ÀÔ·ÂÇϼ¼¿ä :"))
  (setq first (car (mapcar 'cdr (GetPolyVtx (entget pn)))))
  (setq el (entlast)  n 0)
  (command "measure" (list pn first) le)
  (if (not (equal el (entlast)))
    (progn
      (while (setq ex (entnext el))
        (setq ssp (append ssp (list (cdr (assoc 10 (entget ex))))) el ex)
      )
      (mapcar '(lambda (x)
                 (command "text" "j" "c" x th (rtd (angle first x)) (itoa n))
                 (setq n (1+ n) first x)
               )
              ssp
      )
    )
  )
  (princ)
)  

¼³¸í


(defun c:p-divide-t ( / pn le first x el n ssp th rtd)
  ;; ¶óµð¾È °¢µµ °ªÀ» µð±×¸® °¢µµ·Î º¯È¯ÇÔ¼ö
  (defun rtd (a)(/ (* a 180.0) pi))
  ;; Æú¸®¶óÀÎ,°Å¸®°ª,¹®ÀÚ Å©±â¸¦ ÀÔ·Â ¹Þ´Â´Ù.
  (setq pn (car (entsel "\nÆú¸®¶óÀÎÀ» ¼±ÅÃÇϼ¼¿ä.")))
  (setq le (getreal "\n°Å¸®°ªÀ» ÀÔ·ÂÇϼ¼¿ä :"))
  (setq th (getreal "\n¹®ÀÚÀÇ Å©±â¸¦ ÀÔ·ÂÇϼ¼¿ä :"))
  ;; Æú¸®¶óÀÎÀÇ Ã¹Á¡À» getpolyvtx ÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¿© ¾Ë¾Æ³½´Ù.
  (setq first (car (mapcar 'cdr (GetPolyVtx (entget pn)))))
  (setq el (entlast)  n 0)
  ;; measure ¸í·ÉÀ¸·Î Æú¸®¶óÀÎ»ó¿¡ ÀÏÁ¤ÇÑ °£°ÝÀ¸·Î Æ÷ÀÎÆ®¸¦ »ý¼ºÇÑ´Ù.
  (command "measure" (list pn first) le)
  (if (not (equal el (entlast)))
    (progn
      ;; Æ÷ÀÎÆ®µéÀÇ À§Ä¡Á¡À» ÀúÀåÇÑ´Ù.
      (while (setq ex (entnext el))
        (setq ssp (append ssp (list (cdr (assoc 10 (entget ex))))) el ex)
      )
      ;; À§Ä¡Á¡¿¡ °¢°¢ÀÇ ¹®ÀÚ¸¦ mapcar ÇÔ¼ö¸¦ ÀÌ¿ëÇÏ¿© »ý¼ºÇÑ´Ù. 
      ;; ¹®ÀÚÀÇ °¢µµ´Â ÀÌÀüÀÇ À§Ä¡Á¡°ú ÇöÀçÀÇ À§Ä¡Á¡À¸·Î °¢µµ¸¦ °è»êÇÑ´Ù. 
      (mapcar '(lambda (x)
                 (command "text" "j" "c" x th (rtd (angle first x)) (itoa n))
                 (setq n (1+ n) first x)
               )
              ssp
      )
    )
  )
  (princ)
)