Hello,
I sometimes get schematics with the blocks a little off the gridspacing.
if the groud is 1,1 I can use the following lisp
Code:
(defun c:FixInsBlk (/ i ss ed p)
(initget "Yes No")
(setq All (getkword "Select all blocks? [Yes/No] <N>"))
(cond
((eq All "Yes")
(setq i 0
ss (ssget "_X" (list (cons 0 "INSERT")))
)
)
(T
(setq i 0
ss (ssget (list (cons 0 "INSERT")))
)
)
)
(repeat (SSLength ss)
(setq ed (entget (ssname ss i)))
(setq p (cdr (assoc 10 ed)))
(setq p (list (fix (+ (car p) 0.5))
(fix (+ (cadr p) 0.5))
(fix (+ (caddr p) 0.5))
)
)
(setq ed (subst (cons 10 p) (assoc 10 ed) ed))
(entmod ed)
(setq i (1+ i))
)
(princ)
)
(defun C:FIB ()
(c:FixInsBlk)
)
(princ
"\n\t\t***\tFixInsBlk.lsp loaded. Type FIXINSBLK or FIB to execute.\t***"
)
(princ)
Now I have a set a drawings with the snap spacing 1.25 and I can't see where I need to change the lisp so it will move the blocks to the nearest snap.