프로그램
캐드 분류

cad text 줄간격 맞추는 LISP 여러줄 한번에 되게 가능할까요?

컨텐츠 정보

본문

안녕하세요~
한줄씩 줄을 맞추는 LISP입니다.
여러줄을 한번에 하고 싶어서요..ㅠ
세로로 정리하다보니 지금도 편하지만 한번에 하고싶더라고요..ㅠ
예를들어
1 2 3 4 이렇게 있으면 지금은 1234를 잡으면

1
2
3
4

이렇게 정리가 됩니다.
이렇게 말고 1 2 3 4 이 상태를 유지하면서
밑에 하위 TEXT들이 열에 맞춰서 간격 정리하고 싶습니다.
도움주실분 없을까요?
좋은 하루되세요~


;;; 텍스트 줄간격 맞추기 ;;;;
(defun c:tdd ( / sel_txt al_pt1 al_pt2 al_pt3 index n ch_txt1 ch_txt2 ins_pt ref_pt  sort sorti m i ins_ypt)
(prompt "n정렬할 문자 선택 : ")
  (setq sel_txt (ssget '((-4 . "    (0 . "TEXT") (0 . "MTEXT")
    (-4 . "or>")
   )
  )
  )


 (or  ##txtline_gap (setq ##txtline_gap 3.6))


 (setq ##txtline_gap
  (cond
   ((getreal (strcat "nSpecify Text offset  <" (vl-princ-to-string ##txtline_gap) ">: ")))
   (##txtline_gap)
  )
 )
(setq index 0)
(setq n (sslength sel_txt))
(repeat n
    (setq ent (ssname sel_txt index))
    (setq prop_ent (entget ent))
    (setq in_point (cdr (assoc 10 prop_ent)))
    (setq sort (append sort (list in_point)))
  (setq index (1+ index))
  )
  (vl-load-com)
  (setq sorti
  (vl-sort-i sort
      (function (lambda (e1 e2) (> (cadr e1) (cadr e2))))
  )
  )
 (setq m 0)
  (repeat n
    (setq i (nth m sorti))
    (setq ch_txt1 (ssname sel_txt i))
    (setq ch_txt2 (entget ch_txt1))
 
    (setq al_pt1 (cdr (assoc 72 ch_txt2)))
    (setq al_pt2 (cdr (assoc 73 ch_txt2)))
   
    (if (and (= al_pt1 0) (= al_pt2 0))
    (setq ins_pt (cdr (assoc 10 ch_txt2)))
    (setq ins_pt (cdr (assoc 11 ch_txt2)))
    )
  (if (= m 0)
    (progn
    (setq ins_xpt(car ins_pt))
    (setq ins_ypt(cadr ins_pt))
    ) 
    (princ)
)
    (setq ins_pt (- ins_ypt (* ##txtline_gap m)))
    (setq ins_pt (list ins_xpt ins_pt ))
   
    (if (and (= al_pt1 0) (= al_pt2 0))
      (progn
    (setq ch_txt2 (subst (cons 10 ins_pt) (assoc 10 ch_txt2) ch_txt2)) ;;; 이게 중요함 10코드를 뽑아서 11번 코드로 넣어줘야 됨 ;;;
    (entmod ch_txt2)
    )
     
        (progn
    (setq ch_txt2 (subst (cons 11 ins_pt) (assoc 11 ch_txt2) ch_txt2)) ;;; 이게 중요함 10코드를 뽑아서 11번 코드로 넣어줘야 됨 ;;;
    (entmod ch_txt2)
    )
   )
        (setq m (1+ m)) 
)
  )


 

관련자료

댓글 0
등록된 댓글이 없습니다.
여분필드1 여분필드2 여분필드3
캐드 77 / 1 페이지
번호
제목
이름
알림 0