itacad Posted April 26, 2018 Posted April 26, 2018 Hello...I'm looking for a method or a lisp for "fix the dimension value" in a selected quotes group. With the properties palette, when I select a single dimenion I can copy the value in the label "modifica locale al testo" (text override in the english version?), so if I scale the dimension the value doesn't change. Is it possible to do this operation automatically on all the selected dimension? Regards Quote
Lee Mac Posted April 26, 2018 Posted April 26, 2018 Try the following: (defun c:fixdims ( / ent enx idx sel ) (if (setq sel (ssget "_:L" '((0 . "*DIMENSION") (1 . "~*?*")))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) ent (ssname sel idx) enx (entget ent) ) (entmod (subst (cons 1 (LM:getdimstring ent)) (assoc 1 enx) enx)) ) ) (princ) ) ;; Get Dimension String - Lee Mac ;; Returns the displayed content of a dimension (defun LM:getdimstring ( ent / enx rtn ) (if (and (setq enx (entget ent)) (wcmatch (cdr (assoc 0 enx)) "*DIMENSION") (setq ent (tblobjname "block" (cdr (assoc 2 enx)))) (setq ent (entnext ent) enx (entget ent) ) ) (while (and ent (null rtn)) (if (= "MTEXT" (cdr (assoc 0 enx))) (setq rtn (cdr (assoc 1 enx))) ) (setq ent (entnext ent) enx (entget ent) ) ) ) rtn ) (princ) Quote
itacad Posted April 30, 2018 Author Posted April 30, 2018 Thank you very much! It work's like I need! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.