Jump to content

combine 2 or more dwg in one


hosyn

Recommended Posts

thanks a lot

my q is How we can merge 2 or more dwg togather with lisp or simple way:cry: without opening them

Link to comment
Share on other sites

Here is a way,

 

Create a folder in drive Known as Merge DWG whose directory will be C:\Merge DWG

 

and put all drawing file in that folder which you want to merge,

 

and run the following routine, but check drawing units of drawings which you want to insert and keep them same

 

(defun c:MDWG (/ directory files)
(setvar "cmdecho" 0)
(alert "\n Please put your DWG files in ''C:\\Merge DWG'' Directory")
 (setq directory "C:\\Merge DWG")
 (if (setq files (vl-directory-files directory "*.dwg" 1))
   (foreach dwg files
     (command "_.-insert"
              (strcat directory "\\" dwg)
              '(0. 0. 0.)
              ""
              ""
              ""
     )
   )
   (princ "\n No DWG files found into that folder !")
 )
(alert (strcat "\n ''DWG files has merged together''  ")
      )
(setvar "cmdecho" 1)
)

 

Enjoy:)

Edited by satishrajdev
Link to comment
Share on other sites

 

I was referring to the system variable "cmdecho" and not to the other codes . ;)

 

You only have provided this routine, so big thanks to you, it made my work lot easier:)

 

Happy to hear that .

Link to comment
Share on other sites

I was referring to the system variable "cmdecho" and not to the other codes . ;)

 

Oops....forgot to put that, Being newbie it happens in excitement :shock:

Link to comment
Share on other sites

Are the DWGs already xreffed into one another? Or do you want to simply place them into a blank DWG and not overlap each other (like in the thread teknomatika pointed to)?

 

If the former, there are lots of stuff concerning binding xrefs. Just do a search here.

 

Also, what about any paper space tabs? Neither of these would bring those in as well. For that you'd need to import the layouts, and might also need to adjust the viewports.

Link to comment
Share on other sites

  • 1 year later...

Dear satishrajdev

I tried your lisp and that massage "DWG files has merged together" but but i don't know that which location save the merged dwg??

Link to comment
Share on other sites

Dear satishrajdev

I tried your lisp and that massage "DWG files has merged together" but but i don't know that which location save the merged dwg??

 

It saves merged files into your current drawing, where you have loaded this lisp...:)

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