Jump to content

Recommended Posts

Posted

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

Posted

There are the build-in INSERT and XREF (with Bind option) commands.

Posted

It is easy to copy and paste the contents of the first file to other one , is not it ?

 

Otherwise , explain more .

Posted

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.

Posted

So you want to insert many dxf drawings into one drawing . are they going to have the same base point (e.g zero coordinates ) ?

Posted

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.

Posted

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

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

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

Posted

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

Posted

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)

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

Posted

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

(vl-load-com)

 

vl-*** functions do not require vl-load-com (AFAIK) .

Posted

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

Posted
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 . :)

  • 2 years later...
Posted

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

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