satishrajdev Posted June 18, 2012 Share Posted June 18, 2012 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 Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 18, 2012 Share Posted June 18, 2012 There are the build-in INSERT and XREF (with Bind option) commands. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 18, 2012 Share Posted June 18, 2012 It is easy to copy and paste the contents of the first file to other one , is not it ? Otherwise , explain more . Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted June 18, 2012 Author Share Posted June 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 18, 2012 Share Posted June 18, 2012 So you want to insert many dxf drawings into one drawing . are they going to have the same base point (e.g zero coordinates ) ? Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 18, 2012 Share Posted June 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 18, 2012 Share Posted June 18, 2012 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 Quote Link to comment Share on other sites More sharing options...
dbroada Posted June 18, 2012 Share Posted June 18, 2012 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. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 18, 2012 Share Posted June 18, 2012 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) ) Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted June 19, 2012 Author Share Posted June 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 19, 2012 Share Posted June 19, 2012 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) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 19, 2012 Share Posted June 19, 2012 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 . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 19, 2012 Share Posted June 19, 2012 Also, may be useful to place this along Tharwat's code: (vl-load-com) vl-*** functions do not require vl-load-com (AFAIK) . Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted June 19, 2012 Author Share Posted June 19, 2012 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 Quote Link to comment Share on other sites More sharing options...
Tharwat Posted June 19, 2012 Share Posted June 19, 2012 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 . Quote Link to comment Share on other sites More sharing options...
andreak Posted September 23, 2014 Share Posted September 23, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.