;; init.
(progn (setq _dimFont "돋움") ;; 치수 폰트 지정
(setq _cadDimstyle "DIMSTYLE_NAME") ; 치수스타일 지정
(setq _scale 1.0)
(princ)
)
;
(defun KM:getscl ( / pt1 sclobj);; find scale factor
(command "zoom" "e")
;; (setq pt1 '(757.0 36.5)) ;;coordination(SAMOO titleblock) of the string "A1: 1 : 400" of scale of the drawing
(setq pt1 '(770.0 64.0)) ;;coordination(SK titleblock) of the string "A1: 1 : 400" of scale of the drawing
(command "explode" (ssget pt1))
(setq sclobj (entget (ssname (ssget pt1) 0) )) ;get entity zero from prop.
(command "undo" 1)
(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_DIMSTYLE ( dimFont cadDimstyle );;modifying dimstyle of the STANDARD_DIMSTYLE
(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" "")
(command "regen")
)
(princ)
)
;
(defun c:sdf( ) ;; main code set Scale>Dim>Fix
;
(progn
(setq _scale (atof (KM:getscl))) ;; get scale
(if (= _scale 0.0)
(setq _sclae 1.0)
()
)
(command "dimscale" _scale)
(command ".scale" "all" "" '(0 0) _scale) ;; set scale
(command "zoom" "e")
)
;
(command "CMDECHO" 0)
(KM:df0 _dimfont) ;; set font-height to zero
(KM:set_DIMSTYLE _dimfont _cadDimstyle) ;; set dimstyle
(command "CMDECHO" 1)
(princ)
)
;
;
'revit' 카테고리의 다른 글
Revit 2010 KeyboardShortcuts.txt (3) | 2024.08.29 |
---|---|
레빗 단축키 한글 적용하기 (0) | 2024.08.26 |
Create Sloped Glazing by the Boundary of the Ceiling (0) | 2023.11.30 |
Using NOT Statement in Formula with The Visibility (0) | 2023.11.09 |
Unhide All Elements in Active View (0) | 2023.10.24 |