Maybe anyone has an idea on the following issue:
We have several AutoCAD drawings with hundreds of block references inserted with imprecise coordinates. Now we need to dimension all elements and need to correct these positions.
I am searching for a routine to round these positions up or down towards a 5mm precision so I don't have to manually move every single block element.
Is there any way to automate the task or do you know any workaround (like inserting the elements into a drawing with poorer unit precision settings)?
Thank you very much for your support!
Solved! Go to Solution.
Try the following simple program:
(defun c:roundins ( / e i m p s x ) (if (null *tol*) (setq *tol* 5.0) ) (initget 6) (if (setq m (getreal (strcat "\nSpecify rounding tolerance <" (rtos *tol*) ">: "))) (setq *tol* m) (setq m *tol*) ) (if (setq s (ssget "_:L" '((0 . "INSERT")))) (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i)))) p (assoc 10 e) ) (entmod (subst (cons 10 (mapcar '(lambda ( x ) (round x m)) (cdr p))) p e)) ) ) (princ) ) ;; Doug Broad (defun round ( value to ) (setq to (abs to)) (* to (fix (/ ((if (minusp value) - +) value (* to 0.5)) to))) ) (princ)
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register