Jump to content

Routine to move objects to absolute 0,0 position.


dblclkmatt

Recommended Posts

So I have a lot of 2D drawings (a couple thousand roughly) that I need to go through and shift the objects within to the absolute 0,0 position. That way, when we insert them into a new drawing, everything is centered appropriately and not way off the screen.

 

Instead of:

Open File > Select Objects > "MOVE" > Specify Basepoint > " * 0 , 0 " > Center View on Newly position Objects > Save File > Close File

... Repeat ...

 

I was hopeful there might be a more efficient way to do this. By way of a LISP routine, or a script that could automagically do the above steps on it's own.

 

Hell, even something that doesn't require me to hit *, then tab, then 0, then tab, then 0 again. Anything to quicken the routine would be appreciated. Thanks. :)

Link to comment
Share on other sites

How about a macro, this will prompt you to pick an object and then the basepoint, it then saves and closes the drawing. So all you need do is open each drawing and run the macro.

^C^C^Cmove;\;\*0,0;zoom;e;qsave;close;

 

EDIT: Added zoom extents

Edited by steven-g
Link to comment
Share on other sites

How about a macro, this will prompt you to pick an object and then the basepoint, it then saves and closes the drawing. So all you need do is open each drawing and run the macro.

^C^C^Cmove;\;\*0,0;zoom;e;qsave;close;

 

EDIT: Added zoom extents

You should change the select objects \ to "ALL" instead so that he doesn't even have to bother with picking anything other than the base point. He makes it seem like he is moving an entire drawing to 0,0 so it would be quicker that way.... unless he isn't moving everything of course. :lol:

Link to comment
Share on other sites

How about a macro, this will prompt you to pick an object and then the basepoint, it then saves and closes the drawing. So all you need do is open each drawing and run the macro.

^C^C^Cmove;\;\*0,0;zoom;e;qsave;close;

 

EDIT: Added zoom extents

 

Hadn't thought of a macro, but tried using the one you provided and it requires input of the second point once I select the basepoint. Also, it does not save and close.

 

If I try it again inside the same file, it will move as it did the first time, then it will proceed to save and exit.

 

Perhaps I set it up wrong?

Link to comment
Share on other sites

Have you thought to re-define the base point in each drawing?

 

That would save having to move everything.

 

I did try moving the UCS and saving it like that, but when I inserted it, it still imported the drawing where the original 0,0 point was and not where I had set it.

Link to comment
Share on other sites

Taking it one step further using both eldon and steven-g's idea:

 

(DEFUN C:BA    () (COMMAND "BASE" PAUSE "SAVE" "" "CLOSE" ))

 

I'm blazing through these now! Whoooooo!

Link to comment
Share on other sites

Your only in the grass if your doing each one make a script and set the forest on fire put the BA defun in autoload.lsp then script, making the script takes a couple of minutes if the dwgs are in a few directories. Post for help use MS word search replace.

 

open dwg1 BA close Y

open dwg2 BA close y

etc

Link to comment
Share on other sites

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...