Jump to content

copy a selection from another cad file


Recommended Posts

I did use STEAL lisp by MAC LEE before but since I am not inserting blocks anymore (Thousands of blocks on master general blocks), also because STEAL mess up the draw order on the hatch in dynamic blocks, is there a way:

Upon entering a command to copy a selection coordinates from the source file and let user choose a place to paste them on the destination file; example:

Cables <Enter> (go to D:/blocks/general blocks.dwg) and copy from specific coordinates and let me paste them to where I want on my current cad file?




Link to comment
Share on other sites

I can not remember but I think you can do something in a new dwg and return back to original, there may be some extra code. If I remember correct opens a new dwg but returns to original. The only issue is if you have multiple drawings open the acdocs 1 becomes the current dwg in the acdocs if you dump acdocs it has a variable called count how many dwg's open. Very basically tested no guarantee's.


; by alanh copy a window from another dwg
; Nov 2019
(defun openblk (blkname / adocs)
(setq acDocs (vla-get-documents (vlax-get-acad-object)))
(vla-open acDocs blkname)
(command "copyclip" "w" "13,30" "402,276" "")
(vla-close (vla-item acdocs 1) :vlax-false)
(command "pasteclip" "0,0")
(openblk "d:\\acadtemp\\2circs.dwg")


Edited by BIGAL
Link to comment
Share on other sites

I have a bit of an issue with the pasteclip since it always paste last copied entity on memory but I think I can work with the initial code though.

The challenge I have is inserting blocks messes up my older block`s draw order (as I stated on another post). I am thinking copying eliminates that issue and preserves my draw order on blocks when inserting. It takes some time for the general block dwg to open and copy entities but this is what I can come up with - unless BIGAL comes to saves the day again!

Steal from Lee Mac brings the blocks quite fast and invisible but I have the draw order issue when attempting to insert them. so copying would remain the only option for now. I also posted another one to see if I can fix the draw order but seems I was wrong to make my blocks years ago without paying little to no attentions to basics!


Thanks BIGAL.

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.

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