Jump to content

Recommended Posts

Posted

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

Posted

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)

Posted

Thank you very much! It work's like I need!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...