Script for Moving all drawings to 0,0

Script for Moving all drawings to 0,0

Anonymous
Not applicable
2,266 Views
9 Replies
Message 1 of 10

Script for Moving all drawings to 0,0

Anonymous
Not applicable

Looking for the command which can help me in picking the lowest left corner of the drawing so that I can make it as the base point for moving it to 0,0.  

Please help .... 

Thanks a lot

0 Likes
Accepted solutions (1)
2,267 Views
9 Replies
Replies (9)
Message 2 of 10

cadffm
Consultant
Consultant

_COPYCLIP is the best way

_unlock and thaw your layers

and then copyclip all objects

 

_.COPYCLIP _all

_.PASTECLIP 0,0,0 or *0,0,0 to force wcs coordinates

 

You know now the way to go, create your macro - 😀

 

[EDIT: And think twice about the UCS handling you want/need]

 

Sebastian

Message 3 of 10

pendean
Community Legend
Community Legend
The user will still have to manually select a start point, there is no such level of automation in the LT version of AutoCAD, if that is your intent.

See the easy tip above assuming the default AutoCAD-found lower-left corner is actually what you want to place at 0,0, unless you know the exact starting coordinates that are 100% identical in ALL files you open, which would be somewhat of a miracle.

HTH
0 Likes
Message 4 of 10

Anonymous
Not applicable

Thanks for the information.... Need a small clarification also.

I could understand that command : extmin will give the lowest left corner of the drawing, but facing difficulty in assigning that coordinate as the base point (dont know how to assign the coordinate generated with Extmin as the base point for the move command). The intension is,  if the base point can be assigned as the extmin value then the second point can be given as 0,0 and could complete what I am looking for. 

Is there any solution for the same... Please guide.

0 Likes
Message 5 of 10

cadffm
Consultant
Consultant

Just one question, why not using (my) simple way?

Sebastian

0 Likes
Message 6 of 10

steven-g
Mentor
Mentor

You will need to learn how to use DIESEL expressions in a macro. The macro would be something like this as an example.

 

^C^C_.move;all;;$M=$(getvar,extmin);0,0;

However, this is again unreliable as you are relying on what Autocad thinks are the extents at that particular moment in time (and you will get odd results sometimes).

0 Likes
Message 7 of 10

steven-g
Mentor
Mentor

@cadffm _.COPYCLIP results in doubling the geometry in the drawing and could be placing a copy at an offset from the original with objects mixed together (it makes a copy it doesn't move).

Message 8 of 10

cadffm
Consultant
Consultant

Funny people here, thank you for explaination.

 

Copyclip and delete all

or just

cutclip instead copyclip&delete

 

 

Sebastian

Message 9 of 10

Anonymous
Not applicable

Thanks for your valuable guidance. It worked fine to some extent, however there was still a small issue which I was not able to resolve.

- There are some attributes in the titleblock which will ask for entering the values as I do the pasteclip.

- If I could do with the move command it would not ask for entering the attribute values. 

Any Idea how to resolve without entering the attribute value? If there is a solution for that then it would be a great help and would save lot of time for me.

 

 

0 Likes
Message 10 of 10

cadffm
Consultant
Consultant
Accepted solution


>>"There are some attributes in the titleblock which will ask for entering the values as I do the pasteclip."
You doesn't paste lines and attribute definitions, you are creating a new Block and blockreference... Wrong thing.
This is not a usual happening, your program-or-your file(s) doesn't works as it should!

Or you are using the wrong command, for _pasteblock it would be right, but it is the wrong command with a wrong result.
_PASTECLIP shouldn't create a new block and a blockreference => no attributes => no question about attribute values.Read this ans 100 other threads where other people had the same issue
https://forums.autodesk.com/t5/autocad-forum/ctrl-v-is-pasting-as-a-block/td-p/5128540

 

>>"- If I could do with the move command it would not ask for entering the attribute values. "
You doesn't understand that attributdefinitions never askl for a attribute value and if it happens,
there is something wrong!? 😉

 

>>"Any Idea how to resolve without entering the attribute value?"
1. You have a buggy system or file, this process should ask for attribute values
because these steps SHOULD insert attdefs and lines and not a blockreference with attributes.
2. If you have another case where you want to insert blockreferences, you can controle by ATTDIA and ATTREQ [F1]-Help for more informations


Note, Extmin and also the pasteclip way is just NEAR TO what you want, it is not exactly - but the best way without programming.
Just a workaround, but better than nothing 😉

If you like to check the result: New empty file, draw one RECTANGle, set Luprec to 8
and try both macros (cutclip/pasteclip works a bit better than EXMIN coordinate).

 

EXTMIN way
^C^C^C_.UCS;_world;_.ZOOM;_extents;_.MOVE;_all;;$M=$(getvar,EXTMIN);_none;0,0,0;_.ZOOM;_extents

 

and

CUTCLIP way
^C^C^C_.CUTCLIP;_all;;_.PASTECLIP;_none;*0,0,0;_.ZOOM;_extents

Sebastian

0 Likes