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

Paste to original coordinates as a block

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
atuckerJKU9U
1142 Views, 4 Replies

Paste to original coordinates as a block

Has anybody ever come across away to combine paste to original coordinates and paste as a block?  I'm pasting from one drawing to another, and am pasting to original coordinates, but I'd like all the objects to be in a block so I can keep track of them.  Tried to make a workaround by making the objects into a group before I copy and paste, but for whatever reason, they're not in a group once they arrive in the target drawing.  That seems weird to me...

4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: atuckerJKU9U

Do you care where the Block's insertion point is?  Since an AutoLisp routine can't start in one drawing and continue in another, this can't be done with a single routine anyway.  I would suggest COPYBASE using 0,0 as the base in the source drawing, and then PASTEBLOCK in the target drawing, re-using 0,0 as the insertion point, which will put the stuff at the original coordinates, without needing to somehow transfer a saved non-0,0 insertion point between drawings.

 

If you do care where the insertion base point is, you could use COPYCLIP from the source drawing and then have a routine that would first mark the last entity in the target drawing, do the PASTEORIG, and then find all objects newer than that to build a selection set to turn into a Block or Group.  One example of that kind of find-everything-newer approach [there are many others] is >here<.

Kent Cooper, AIA
Message 3 of 5
atuckerJKU9U
in reply to: atuckerJKU9U

That will do the trick!  Why didn't I think of that?  😊  Thanks Kent!!

Message 4 of 5
Kent1Cooper
in reply to: atuckerJKU9U


@atuckerJKU9U wrote:

That will do the trick!  Why didn't I think of that?  😊  Thanks Kent!!


You're welcome, but while you were approving that, I edited my Reply with another suggestion, if it interests you.

Kent Cooper, AIA
Message 5 of 5
atuckerJKU9U
in reply to: Kent1Cooper

I have officially been doing this too long.  Your last comment sparked a memory.  Years ago, somebody on my team asked me to make a lisp where you copy from one drawing, then paste it into another at the same coordinates, but when you paste it, they wanted everything to go onto whatever the current layer was.  So you could make yourself a temp layer in the destination drawing and all your stuff would go onto there, then you could either isolate or delete that layer once you had done whatever you needed to with it.  I never used the routine, but it would actually work well for what I was doing.  Here is the routine if you're interested.  Lol, I solved my own problem then forgot about it. 😂

 

;paste to current layer
;
(defun c:c0 ()
(command "copybase" "0,0,0"))
(defun c:pst ()
(command "pasteblock" "0,0,0")
(command "explode" "L" "")
(command "._change" "_P" "" "_P" "_LA" (getvar "clayer") "")
)

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report