Jump to content

Merge multiple DXF in a single drawing


satishrajdev

Recommended Posts

Hey guys,

Is it possible to merge different or multiple DXF file in single drawing with their respective coordinates.

Is there any lisp or tool that could help me out of it

 

thanks a lot

Link to comment
Share on other sites

Thanks for showing your interest

@Msasu....... if you use insert command then you have to choose single dxf at the time we cannot select more than 1 file at the time.

 

@Tharwat........ in case you having more than 50 DXF we cannot copy and paste single-single file, it will take too much time, thats why i m finding a way that could save my time.

Link to comment
Share on other sites

The XREF command will allow you to select more than one file to attach; next select them all in reference manager window and chouse Bind to insert.

 

Alternatively, can do a list of those files and create a script (run it with SCRIPT command) to insert them in one step.

Link to comment
Share on other sites

More info about creating a script for this task: create a BAT file (simple text format) with the code below and run it to create the list of your DXF files - next use Excel to build the script. Please remember that if the path contains spaces will need to embrace it with quotes (").

DIR /b *.DXF > drawings.txt

The script should look like:

_INSERT "C:\My Drawings\FistSketch.DXF" 0.0,0.0,0.0 1.0 1.0 0.0

Link to comment
Share on other sites

More info about creating a script for this task: create a BAT file (simple text format) with the code below and run it to create the list of your DXF files - next use Excel to build the script. Please remember that if the path contains spaces will need to embrace it with quotes (").

DIR /b *.DXF > drawings.txt

The script should look like:

_INSERT "C:\My Drawings\FistSketch.DXF" 0.0,0.0,0.0 1.0 1.0 0.0

this was how I was going to suggest doing it. No need, MSasu beat me to it.
Link to comment
Share on other sites

Change the directory name ( in RED ) of this code ....

 

(defun c:Test (/ directory files)
 (setq directory "[color=red][b]C:\\Users\\Tharwat\\Desktop\\DXF Drawings"[/b][/color])
 (if (setq files (vl-directory-files directory "*.dxf" 1))
   (foreach dxf files
     (command "_.-insert"
              (strcat directory "\\" dxf)
              '(0. 0. 0.)
              ""
              ""
              ""
     )
   )
   (princ "\n No DXF files found into that folder !")
 )
 (princ)
)

Link to comment
Share on other sites

Thanks all of you for your time

 

@ Tharwat..... i have gone through as per your lisp, i have changed that code as per my DXF directory, but still it is showing "No DXF files found into that folder !", What would be the reason of it???? any guesses

Link to comment
Share on other sites

Did you used double-backslash to write your path?

(setq directory "C:[color=magenta]\\[/color]My Drawings[color=magenta]\\[/color]Project DXFs")

Alternatively, may use slashes:

(setq directory "C:[color=magenta]/[/color]My Drawings[color=magenta]/[/color]Project DXFs")

 

Also, may be useful to place this along Tharwat's code:

(vl-load-com)

Link to comment
Share on other sites

Thanks all of you for your time

 

@ Tharwat..... i have gone through as per your lisp, i have changed that code as per my DXF directory, but still it is showing "No DXF files found into that folder !", What would be the reason of it???? any guesses

 

We are not guessing .

 

You should have all your drawings that have the extension of .dxf into that directory ( Folder ) to be inserted one by one .

Link to comment
Share on other sites

Hey It worked........ actually it was mt mistake i didnt put that code properly and i didnt noticed that.

I am really sorry for that.

This lisp is really great, now i can insert more 50 or 100 DXF at the time, it will save my time now

 

Thanks a lot Tharwat and MSasu

Link to comment
Share on other sites

Hey It worked........ actually it was mt mistake i didnt put that code properly and i didnt noticed that.

I am really sorry for that.

This lisp is really great, now i can insert more 50 or 100 DXF at the time, it will save my time now

 

Thanks a lot Tharwat

 

Not a problem , Enjoy it . :)

Link to comment
Share on other sites

  • 2 years later...

Hi Mircea,

 

I am trying to work combine multiple DXFs into a dwg file..

Could you let me know where to run the BAT file? I'm assuming that I have to copy the code, put it in notepad and save it as a .bat??

I am also not sure how you could use Excel to build the script. :?

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