dblclkmatt Posted January 21, 2014 Share Posted January 21, 2014 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. Quote Link to comment Share on other sites More sharing options...
steven-g Posted January 21, 2014 Share Posted January 21, 2014 (edited) 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 January 21, 2014 by steven-g Quote Link to comment Share on other sites More sharing options...
eldon Posted January 21, 2014 Share Posted January 21, 2014 Have you thought to re-define the base point in each drawing? That would save having to move everything. Quote Link to comment Share on other sites More sharing options...
Tuns Posted January 21, 2014 Share Posted January 21, 2014 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. Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted January 21, 2014 Author Share Posted January 21, 2014 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? Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted January 21, 2014 Author Share Posted January 21, 2014 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. Quote Link to comment Share on other sites More sharing options...
eldon Posted January 21, 2014 Share Posted January 21, 2014 Using the BASE command is not the same as defining a UCS. Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted January 21, 2014 Author Share Posted January 21, 2014 Using the BASE command is not the same as defining a UCS. I was not aware this was thing. That worked perfectly. Thank you ! Quote Link to comment Share on other sites More sharing options...
dblclkmatt Posted January 21, 2014 Author Share Posted January 21, 2014 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! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 22, 2014 Share Posted January 22, 2014 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.