프로그램
캐드 분류

줄간격 리습 조언 듣고 싶습니다~

컨텐츠 정보

  • 189 조회
  • 4 댓글
  • 0 추천
  • 0 비추천
  • 목록

본문

안녕하세요? 고캐드에서 도움을 많이 받고 있는 실무자 입니다
여쭤보고싶은 것은 텍스트 줄간격 리습입니다. 리습을 명령어를 입력하고 사용하면 줄간격을 사용
할때마다 입력해야 하는데 입력값이 저장되게 해서 엔터만 치면 가능 하게 하고 싶습니다
여기저기 찾아보았지만 저에겐 힘든 작업이라 조언을 구하고 싶습니다  도와주세요 감사합니다~
;;; 텍스트 줄간격 맞추기 ;;;;
(defun c:tdd ( / sel_txt al_pt1 al_pt2 al_pt3 index n ch_txt1 ch_txt2 ins_pt ref_pt txtline_gap sort sorti m i ins_ypt)
(prompt "n정렬할 문자 선택 : ")
  (setq sel_txt (ssget '((-4 . "    (0 . "TEXT") (0 . "MTEXT")
    (-4 . "or>")
   )
  )
  )
(setq txtline_gap (getint "n텍스트 줄간격 : "  ))
(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)) 
)
  )

관련자료

댓글 4 / 1 페이지

방장이님의 댓글

수야님 퇴근시간이 줄어들었네요 ㅋㅋㅋㅋㅋ 너무 감사합니다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

플강님의 댓글

안녕하세요. 수야님 죄송한데요 이 리습이 정수로만 입력이 가능한데 소수점으로도 기입이 가능하게 변경이 안될까요?

전체 7,232 / 1 페이지
번호
제목
이름

최근글


새댓글


알림 0