;; 계단 단수, 단 높이 계산하기 c:STC
;; p1, p2를 지정하여 층고 h 저장
;; 기준 계단 높이 167을 기준으로 계단 단수, 높이 계산
;; return: "35RISERs, Height is 168.63mm."
;; offset 명령 실행
;;
(defun KM:STAIR_CAL ( R / p1 p2 h cnt_riser )
(setq riser R)
(setq p1 (getpoint "\Specify first point: "))
(setq p2 (getpoint "\Next point:" p1))
(setq h (distance p1 p2))
(setq cnt_riser (/ (- h (rem h riser)) riser))
(setq h_riser (/ h cnt_riser))
(prompt (strcat "\n" (rtos cnt_riser 2 0) "RISERs, Each height is " (rtos h_riser) "mm."))
(princ)
)
(defun c:stc ()
(KM:STAIR_CAL 167.0)
(command "offset" h_riser)
(princ)
)
(defun c:stcr (/ ri)
(setq ri (getreal "\n Specify height of riser: "))
(KM:STAIR_CAL ri)
(command "offset" h_riser)
(princ)
)
반응형
'autocad' 카테고리의 다른 글
| Set the 'Windows Desktop' Unit format on all dimstyles (0) | 2023.01.05 |
|---|---|
| Change Fonts of All Styles to "simplex.shx,whgtxt.shx" (0) | 2022.12.01 |
| Date and Time Stamping (0) | 2022.07.14 |
| TEXT MOVE TO MID POINT, ROTATE 0, JUSTIFY MIDDLE (0) | 2022.07.08 |
| VPORTS SCRIPT (0) | 2022.07.05 |