프로그램
캐드 분류

지름 리습 수정 부탁드리겠습니다ㅠ

컨텐츠 정보

  • 25 조회
  • 2 댓글
  • 0 추천
  • 0 비추천
  • 목록

본문

안녕하십니까.

리습을 수정을 도움요청 드립니다.

현재 이 리습은 원센터에 지름을 텍스트로 표기해 주는 리습인데…

생성되는 텍스트를 리습 내에서 레이어와 색상을 미리 지정 출력할 수 있는 구문과 앞에 파이가 함께 출력되도록 수정하고 싶습니다.

아래 리습은 오토데스크 포럼 출처입니다….

도움 부탁드립니다..

(defun C:ooo (/ i d ce pop ssSelections objSelection)

(if (setq ssSelections (ssget “X” ‘((0 . “CIRCLE”))))

(repeat (setq i (sslength ssSelections))

(setq i (1- i)

objSelection (vlax-ename->vla-object (ssname ssSelections i)))

(setq d (vla-get-diameter objSelection))

(setq ce (vlax-safearray->list (vlax-variant-value (vla-get-center objSelection))))

(entmake (list (cons 0 “TEXT”)

(cons 10 ce)

(cons 11 ce)

(cons 40 5)

(cons 72 1)

(cons 73 2)

(cons 1 (rtos d))))))

(princ)

)

관련자료

댓글 2 / 1 페이지

주왕님의 댓글

(defun C:TEST (/ i d ce pop ssSelections objSelection colorIndex)

(defun scaleTextSize (diameter)

(cond

((< diameter ) 1.0)))

(defun setTextColor (textObj colorIndex)

(vl-catch-all-apply

‘(lambda ()

(vla-put-color textObj colorIndex)

(vla-update textObj)

(vla-regen textObj))))

(setq ss (ssget (list (cons 0 “circle”))))

(if (setq ssSelections (ssget “_P” ‘((0 . “CIRCLE”))))

(progn

(setq pop (getint “Select text color (1 = Red, 2 = Yellow, 3 = Green, 4 = Azure, 5 = Blue,6 = Magenta ): “))

(setq colorIndex

(cond

((= pop 1) 1)

((= pop 2) 2)

((= pop 3) 3)

((= pop 4) 4)

((= pop 5) 5)

((= pop 6) 6)

(t 1)))

(repeat (setq i (sslength ssSelections))

(setq i (1- i)

objSelection (vlax-ename->vla-object

(ssname ssSelections i))

d (vla-get-diameter objSelection)

ce (vlax-safearray->list (vlax-variant-value (vla-get-center objSelection)))

scaleFactor (scaleTextSize d)

scaledDiameter (* d scaleFactor)

formattedDiameter (rtos scaledDiameter 2 1)

textString (strcat “%%c” formattedDiameter)

textScaleFactor (if (= pop 6) scaleFactor 1.5))

(entmake (list

(cons 0 “TEXT”)

(cons 10 ce)

(cons 11 ce)

(cons 40 3.5)

(cons 72 1)

(cons 73 2)

(cons 7 “PLUS”);;폰트이름변경

(cons 1 textString)

(cons 62 colorIndex)))

;;; (setTextColor objSelection colorIndex);;;;;;;;;;;;;객체도 색깔 변경 할라믄 앞에 ” ;;; ” 없애면 됩니다.

)

)

)

(princ)

)

;;;;;;;두서 없이 만듬 …글 복사가 잘 안되네요 애러 날수도 있음………

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

최근글


새댓글


알림 0