지시선 정렬 LISP 관련 문의드립니다.

2016.03.11 13:37

asami486 조회 수:115

안녕하세요.

제가 인터넷에서 지시선 정렬 LISP을 받았는데,


내용은 아래와 같습니다.


----------------------------------------------------------------------------------------------------------------------------------------------------------------


;;; aligns the landings of selected 3 point leaders to a picked point or selection of leader
;;; and makes landing horizontal (if not already)
(defun c:dd (/ c# crds doc e ins newpt obj ss txt x y sel)
  (vl-load-com)
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (initget 0 "Leader PickPoint")
  (if (= (cond ((getkword
                  (strcat "\n Align by [Leader/PickPoint] <Leader>: ")
                )
               )
               ("Leader")
         )
         "Leader"
      )
    (and (setq e (car (entsel "\nSelect leader for alignment: ")))
         (setq x (cadr (assoc 10 (reverse (entget e)))))
    )
    (setq x (car (getpoint "\nSelect point for alignment: ")))
  )
  (if (and x (setq ss (ssget '((0 . "leader")))))
    (progn (vla-endundomark doc)
           (vla-startundomark doc)
           (foreach l (vl-remove e
                                 (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
                      )
             (setq obj  (vlax-ename->vla-object l)
                   crds (vlax-get obj 'coordinates)
                   c#   (length crds)
             )
             (if (and (= c# 9) ;if leader has 3 points and /= x coord
                      (not (equal x (nth (- c# 3) crds) 0.0001))
                 )
               (progn (setq y     (nth (- c# 5) crds) ;new y coord to ensure flat landing
                            newpt (list x y (nth (1- c#) crds))
                      )
                      (vlax-put obj
                                'coordinates
                                (append (reverse (cdddr (reverse crds))) newpt)
                      )
                      (vla-update obj)
                      (and (setq txt (vl-catch-all-apply ;has text attached to leader
                                       'vlax-ename->vla-object
                                       (list (cdr (assoc 340 (entget l))))
                                     )
                           )
                           (not (vl-catch-all-error-p txt)) ;check for invalid ename
                           (setq ins (vlax-get txt 'insertionpoint))
                           (vlax-put txt
                                     'insertionpoint
                                     (polar (list x (cadr ins) (caddr ins))
                                            (if (> x (nth (- c# 3) crds))
                                              0.
                                              pi
                                            )
                                            (if (zerop (getvar 'tilemode))
                                              (vla-get-textgap obj)
                                              (* (getvar 'dimscale) (vla-get-textgap obj))
                                            )
                                     )
                           )
                           (vla-update txt)
                      )
               )
             )
           )
           (vla-endundomark doc)
    )
  )
  (princ)
)


------------------------------------------------------------------------------------------------------------------------------------------------------------


이 리습이 3점인 지시선에는 적용이 되는데,

2점인 지시선에서는 적용이 안되더라구요.

어떻게 2점까지 쉽게 추가할 수 있는 방법은 없는 것입니까?!

부탁드립니다!

번호 제목 글쓴이 날짜 조회 수
공지 ★ 드림플러스 질문은 메일 또는 홈페이지에 부탁합니다 ★ 아저씨 2017.05.16 2775
공지 제목이 엉망이면 답변달지 않습니다. [1] 아저씨 2014.04.04 23854
공지 순수 캐드 질문은 고캐드로 아저씨 2013.05.28 68641
공지 질문 답변 게시판을 만들었습니다. 아저씨 2013.02.09 74943
2056 VBA/LISP 면적 구하기에 대해서 질문 드립니다. [2] 태상노군 2013.02.15 154620
2055 XREF 절대경로를 상대경로로 편집할때 외부참조관리자(AdRefMan) 말고 다른방법은 없나요? [1] papersdream 2013.02.18 54056
2054 &H8007007E (-2147024770) 시스템 오류가 발생하였습니다. 지정된 모듈을 찾을 수 없습니다. [1] 계장쟁이 2013.03.11 38223
2053 드림을 만나 요즘 정말 살맛나게 일하고 있는 1인입니다. [1] livehero 2013.02.12 36701
2052 다중플롯시 폼등록을 했는데.. [1] ㅁㄴㅇ 2014.03.21 35552
2051 오토캐드 도면 JPG파일로 내보내기하는 방법 문의 [1] 김세직 2014.10.19 34051
2050 윈도우7 32비트 설치 오류! [1] 삐삐누 2014.03.22 33823
2049 civil 3d 2012에서 드림을 설치 할수 있나요. [1] 배고픈곰 2013.02.16 33246
2048 다중플롯 시 POSTSCRIPT 문제 관련.. [1] 규규규 2013.05.15 28902
2047 autocad 2013 오류 문구 [1] 강걍겅경 2013.02.28 26067
2046 CAD 2014 버전 [1] 띵호야 2013.05.22 24049
2045 dreamsub.dll 을 로드하는중 에러발생 [1] ted 2013.05.16 22529