Display full version of the post: Move block, keep it at 0,0

StevieD
18.03.2013, 15:43
I have many blocks in a drawing, each with a different name, and all are positioned at 0,0. I need to move the blocks around, and then rebuild them to position 0,0. Anyone know how to automate the rebuilds?

CarlB
18.03.2013, 17:26

Not sure what you mean by "rebuild to 0,0", sounds like they are already at 0,0.Maybe could be automated, what would ne the method to determine how much to move them? Are you just changing the insert point?

StevieD
18.03.2013, 17:55
CarlB: My blocks start out with a base point at 0,0,0. Then I move these blocks around. So, now I need to explode, and rebuild each block so it's base point is once again back at 0,0,0. There are about 80 individual blocks in my drawing, each with its own name. Doing manually is a killer.

StevieD
18.03.2013, 18:18
I should have said Insertion point, not base point. Sorry.

CarlB
18.03.2013, 18:43

I think I follow what you need to do.  You need to reposition blocks, change their definition so that their insert point is 0,0 but block definition is at the new location.  It sounds kind of bizarre, you must have a good reason for needing to do this? You could do this with a lisp routine, which would have the user select all the blocks; routine would individually explode each block, create a new block with the original name (thus redefine it), select all the exploded elements, and give it a new insert/base point of 0,0.    

StevieD
18.03.2013, 19:16
You got the idea. And the reason is, we have analysis software that requires the 0,0 location. Long story. i will refresh my knowledge of lisp routines and see what i can do. Thanks for your help.

CarlB
18.03.2013, 22:43

Here's my shot at it:[code](defun c:Reblock ()   (setvar "cmdecho" 0)   (setq b_set (ssget '((0 . "INSERT"))))   (setq i 0)   (repeat (sslength b_set)      (setq ename (ssname b_set i))      (setq edata (entget ename))      (setq Bk_Name (cdr (assoc 2 edata)))      (setq Inspt (cdr (assoc 10 edata)))      (setq bkselect (ssget "x" (list (cons 2 Bk_Name))))      (command "explode" Bkselect)      (command "_-block" Bk_Name "Y" "0,0" "_p" "")      (command "_-insert" Bk_Name "0,0" 1.0 1.0 0.0)      (setq i (+ 1 i))   )   (setvar "cmdecho" 1)   (princ) ) (princ "\nStart with Reblock") (princ)         [/code]