;;
;; Revit sheet를 dwg 파일로 추출하고, Acad에서 레이아웃을 모델로 전송 한 다음,
;; 도면을 확대했을 때 보이지 않는 치수 오류를 재조정하기 위한 리습이다.
;; 본 리습은 EXPORTLAYOUT 처리된 1:1 도면을
;; SFD 명령으로 해당 스케일에 맞게 확대하고 치수 폰트와 치수 변수를 조정한다.
;;
;; Revit 2021 -> Acad 2020 기준
;; 변환 후 치수 스타일은 "SAMOO_-_1" 기준
;; SAMOO_-_1 스타일의 치수문자는 삼우템플릿의 Revit dimstyle에 정의되어 있는 "돋움" 지정
;;
;; 작성자 Lee_Sangheon@KM_Lab
;; 2023/05/03 ver. 1.0
;; 문제점: "치수 화살표", "치수선 위 문자 배치"을 지정했음에도 Acad2020에는 적용되지 않음.
;;
;; 주의사항1 : 본 리습을 가져가서 저장할 때는 반드시 ANSI 코드로 저장할 것. "돋움" 폰트처리에 유의
;;
;; 2023/05/04 ver. 1.2
;; "치수화살표" 변수는 DIMBLK에 먼저 정의되어야 함.
;; "치수선 위 문자배치"는 DIMTIH OFF 되어야 함.
;; ver. 1.0 문제점 해결함.
;;
;; 2023/05/04 ver. 1.5
;; 정보추가 (커뮤니티 마루 참조)
;; http://mahru.co.kr/cad_tip/17275
;;
;; init.
(progn
(setq _dimFont "돋움") ;; 치수 폰트 지정
(setq _cadDimstyle "SAMOO_-_1") ; 치수스타일 지정
(setq _scale 1.0)
(princ)
)
;
(defun KM:getscl ( / pt1 sclobj);; find scale factor
(command "zoom" "e")
(setq pt1 '(757.0 36.5)) ;;coordination of the string "A1: 1 : 400" of scale of the drawing
(setq sclobj (entget (ssname (ssget pt1) 0) )) ;get entity zero from prop.
(setq txtstr (assoc 1 sclobj)) ;get list containing string
(cdr txtstr) ;extract string from prop.
)
;
(defun KM:df0 ( dimfont );; set font-height to zero
;
(progn
(vl-load-com)
(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(setq StyList (vla-get-TextStyles ActDoc))
(setq StyObj (vla-Item StyList dimFont))
(vla-put-Height StyObj 0.0)
)
(princ)
)
;
(defun KM:set_SAMOO_DIM ( dimFont cadDimstyle );;modifying dimstyle of the SAMOO_-_1
(progn
(command "-dimstyle" "r" cadDimstyle)
(setvar "DIMEXO" 3.0) ; Lines. Offset from origin 3.0
(setvar "DIMASZ" 1.0) ; Symbols and Arrows. Arrow size 1.0
(setvar "DIMBLK" "_DOTBLANK") ; Symbols and Arrows. Arrowhead
(setvar "DIMTXSTY" dimFont) ; Text. Text style
(setvar "DIMTXT" 2.9) ; Text. Text Height 2.9
(setvar "DIMTAD" 1) ; Text. Text placement Vertical Above(1)
(setvar "DIMGAP" 1.0) ; Text. Offset from dim line 1.0
(setvar "DIMTIH" 0) ; Text. Aligned with dimension line
(setvar "DIMTMOVE" 2) ; Fit. Text placement without leader
(setvar "DIMTIX" 1) ; Fit. Always keep text between ext lines
(setvar "DIMTOFL" 1) ; Fit. Draw dim line between ext lines
(setvar "DIMDEC" 0.0) ; Primary Units. Linear dimensions Precision 0.0
(setvar "DIMLUNIT" 6) ; Primary Units. Windows Desktop(6)
(command "-dimstyle" "s" cadDimstyle)
(command "_dimstyle" "a" "all" "")
)
(princ)
)
;
(defun c:sfd( ) ;; main code set Scale>Font>Dim
;
(progn
(setq _scale (atof (substr (KM:getscl) 9))) ;; get scale
(if (= _scale 0.0)
(setq _sclae 1.0)
;;; (setq _scale (getreal "SCALE = "))
()
)
(command "dimscale" _scale)
(command ".scale" "all" "" '(0 0) _scale) ;; set scale
(command "zoom" "e")
)
;
(KM:df0 _dimfont) ;; set font-height to zero
(KM:set_SAMOO_DIM _dimfont _cadDimstyle) ;; set dimstyle
(princ)
)
;
;
DIM 변수와 DIMSTYLE - 캐드 팁 - MAHRU
@ DIMTAD 치수기입시 치수문자의 위치를 조정한다. 1 : 치수문자가 치수선 사이에 위치한다. 2 : 치수문자가 치수선 좌측 및 윗쪽 위치. 3 : 치수문자가 치수선 바깥쪽 및 윗쪽 위치. @ DIMTIH 치수문자
mahru.co.kr
'autocad' 카테고리의 다른 글
| Automatic ExportLayout (0) | 2023.05.09 |
|---|---|
| Auto Run Script (3) | 2023.05.09 |
| To Turn off the Start Tab in AutoCAD (0) | 2023.02.23 |
| ACAD Open Read-only (0) | 2023.02.15 |
| Overkill > Audit > Purge (0) | 2023.02.15 |