zintonio Posted September 10, 2010 Share Posted September 10, 2010 Hi, I have many files dwg named like this: A001.dwg, A002 dwg...etc I want join them in one dwg. In this new dwg will be created new layers named like files dwg (layer: A001, A002 etc) and obviously inside layer A001, for example, the relative content of A001.dwg I hope to be claer. Thanks Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 These "other" drawings can be dragged and dropped into your new drawing using the Design Center or by using the Insert command just as you would for inserting a block. Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Thanks ReMark for your quick reply, The problem is the i have about 140 dwgs so, there is a way to insert them in automatic way. For example a script or lisp the let me to do that. I try to open design center but i cannot understand how i can insert the dwgs. I forgot insert block, it is the method more interesting, it is possible to make it in automatic mode. I try with (command "_-insert") but i cannot to do naything. I would appreciate if there is a rapid way to insert them. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 I suppose you could insert the drawings via a script. I want to be sure I understand one thing. You want to insert 140 existing drawings into just 1 new drawing? If so, why? Wouldn't this create one very large drawing file? Quote Link to comment Share on other sites More sharing options...
rkent Posted September 10, 2010 Share Posted September 10, 2010 If you xref them in, bind them, (and explode if need be) you will have the layer convention you are after, albiet with some extra characters, but none the less you will have distinct layers for each drawings. Hopefully you can just xref all the files and not bind and use the file that way. Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Thanks for reply, For remark Yes i want to insert them in one file..unfortunately this would create a big file, but i need all dwgs in a one dwg to let me to verify and modify them and more than that to use it for another software. For rkent I thinked about xrif them, but it will be inserted a lot of layer coming from all of dwgs that do no let me to manage the new dwg. Morever the layer created is not suitable with the other software that use as layer A001 etc. So everything is inserted will go to appropriate layer (A001.dwg goes to layer A001 into the new big dwg). Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 What is a typical file size for one of the inserted drawings? Does your computer have the ability to work with very large file sizes without running out of memory or crashing altogether? Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Approximately 200 KB. So the total will be 28 MB one dwg. For our job is quite normal works with this file size. obviuosly the dwgs group is closed...I open only the new dwg when i will make this operation. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 OK...if you say so. The largest file I've worked with was 35MB (a complex 3D building/equipment) drawing on a workstation class computer. Then I guess you need to get working on that script file. Were you planning on using ScriptPro or what? Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Yes, I'm planning to use a script file or a Lisp if is better. I think Lisp file, where i can choose the file to insert. is it possible? Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 Are you familiar with the use of lisp? Had you planned on possibly writing a lisp routine? Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 I am quite familiar with Lisp language, i don't know the full language, but i know the basic command. If you can make a lisp, i can study on that, in order to understand better the language and to improve our program. I think to use: (command "_-insert") to insert the dwg (command "_-layer") to create and change the layer Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 So you are going to have your lisp routine create all 104 layers prior to inserting all 104 drawings? Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 The step should be the following: 1. Insert the dwg1 in the (0,0) point as block; 2. create layer A001; 3. select the last entity and insert it in layer A001; 4. explode it 5. repeat the cycle for dwg2 I hope to be clear Thanks Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 10, 2010 Share Posted September 10, 2010 Why not create the layer first and insert dwg1 on that layer? Wouldn't that save a step for each drawing insertion? Also, couldn't you explode the block upon insertion? You're going to do a purge at the end of all this or at certain intervals right? Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Many thanks for quick reply, The layer inserted should be have the same name of the layer. In any case I have to create the layer so the step should be similar. so: 1. read the dwg name A001.dwg; 2. create layer A001; 3. Insert A001.dwg on layer just created A001; 4. explode it; How can i translate that in Lisp? Thanks Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 10, 2010 Author Share Posted September 10, 2010 Yes I'm going to do a purge at the end of all this. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted September 11, 2010 Share Posted September 11, 2010 The simplest way to create a layer in lisp is to send strings to the command line as you would enter them by hand. This should create a new layer named "abc" (command "-layer" "n" "abc" "") And to insert a block: (command "-insert" "abc" "0,0,0" "" "" "") Quote Link to comment Share on other sites More sharing options...
zintonio Posted September 11, 2010 Author Share Posted September 11, 2010 I do not have actually with me Autocad with me. So i write down the following: (defun c:( / DWG L name) (setq DWG (getvar "dwgname")) (setq L (strlen DWG)) (setq name (substr DWG 1 (- L 4))) (command "-layer" "n" name "") (command "-insert" name "0,0,0" "" "" "") ) But how can isert in my code the window shell that let me to chhose the file to insert and how to select the last entity inserted to put it in the layer just created? Thanks Quote Link to comment Share on other sites More sharing options...
fuccaro Posted September 11, 2010 Share Posted September 11, 2010 The second line will return the name of the current drawing, and in the last line you try to insert that file in the current drawing. With other words, you insert a file into itself! Better generate the name by the program. Try to modify this to get the desired names: (defun c:TEST() (setq i 0) (repeat 300 (setq i (1+ i)) (setq nr (cond ((> i 99) 0) ((> i 9) 1) (t 2) ) ) (setq name "A") (repeat nr (setq name (strcat name "0")) ) (setq name (strcat name (itoa i))) (princ (strcat " " name)) ) ) 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.