52 lines
1.8 KiB
Common Lisp
52 lines
1.8 KiB
Common Lisp
(defun C:dimmeter (/ allelems goodStyleElem goodStyleList goodStyleType goodStyle ii imax ilength currElem currLength currStyle newStyle newElem)
|
|
|
|
(setq goodStyleElem (entsel "Select dimension with meter based dimstyle: "))
|
|
(setq goodStyleList (entget (car goodStyleElem)))
|
|
(setq goodStyleType (cdr(assoc 0 goodStyleList)))
|
|
(setq goodStyle (cdr(assoc 3 goodStyleList)))
|
|
(princ "\nSelected dimstyle: " )
|
|
(princ goodStyle)
|
|
|
|
(if (wcmatch goodStyleType "DIMENSION")
|
|
(progn
|
|
|
|
(setq imax 1);while variable
|
|
(setq ii 0);counter to zero
|
|
|
|
(setq allelems (ssget "x" '((0 . "DIMENSION"))))
|
|
(setq ilength (sslength allelems))
|
|
;; (print ilength)
|
|
|
|
(while imax
|
|
(print ii)
|
|
(setq currElem (entget (ssname allelems ii)))
|
|
(setq currLength (cdr (assoc 42 currElem)))
|
|
(setq currStyle (cdr (assoc 3 currElem)));; current dimension style
|
|
;; (print currLength)
|
|
|
|
(if (wcmatch currStyle goodStyle)
|
|
(print currStyle)
|
|
|
|
(if (> currLength 100)
|
|
(progn
|
|
(setq newStyle(cons 3 goodStyle))
|
|
(setq newElem(subst newStyle (assoc 3 currElem) currElem))
|
|
(entmod newElem)
|
|
)
|
|
|
|
)
|
|
)
|
|
|
|
;while specific:
|
|
(setq ii (1+ ii));increments i
|
|
(if (= ii ilength) (setq imax nil));finish function if i equals il
|
|
)
|
|
|
|
)
|
|
|
|
(princ "\nThat's not a dimension. Please select a dimension!");;else
|
|
)
|
|
(setq allelems nil)
|
|
(setq goodStyleElem nil)
|
|
)
|