Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Move by Block Name

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Volk359
605 Views, 6 Replies

Move by Block Name

Greetings All,

I'm writing a script to move all objects in a drawing and would like to use the insert point of the title block as a base then move it to 0,0. Since the title block is in random areas in different drawings I can't always move from the same point A to point B. The ideal script line would be:

move all ins <blockname> 0,0

however when using an osnap AutoCAD is expecting a user input. The handle appears to be the same in all the drawings so that could be used instead of the block name but AutoCAD won't accept either. Any suggestions?

6 REPLIES 6
Message 2 of 7
M_Hensley
in reply to: Volk359

You need a lisp file that uses filters to select your block by name then gets its insertion point. Then its a simple matter to move everything from that point to 0,0.

If you tell us what your titleblock's name is some kind soul might even give you a starter lisp.

Message 3 of 7
doben
in reply to: Volk359

How about moving the block using the change command? After selecting the block (while you're in the change command) hit enter twice ACAD will ask for the insert point. 

Message 4 of 7
Volk359
in reply to: doben

@doben, That works individually but not when trying to move everything.

Message 5 of 7
Volk359
in reply to: M_Hensley

@m_hensley, for lisp(script) this is what I'd come up with so far:

 

move all  
(setq ss (ssget "X" '((0 . "INSERT")
;FILTER FOR BLOCK NAME
(2 . "bsize")
(66 . 1))))
(setq i (sslength ss))
ss
0,0

 I think I may have butchered it since I started but it's the jist of the thing.

Message 6 of 7
pendean
in reply to: Volk359

LISP forum for help upgrading your script is here:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/bd-p/130

Help them out a little by posting a generic CAD file with the problem present.
Message 7 of 7
Volk359
in reply to: pendean

will do, thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost