Jump to content
zintonio

Join files dwg in one dwg

Recommended Posts

zintonio

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

Share this post


Link to post
Share on other sites
ReMark

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.

Share this post


Link to post
Share on other sites
zintonio

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.

Share this post


Link to post
Share on other sites
ReMark

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?

Share this post


Link to post
Share on other sites
rkent

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.

Share this post


Link to post
Share on other sites
zintonio

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

 

 

 

 

Share this post


Link to post
Share on other sites
ReMark

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?

Share this post


Link to post
Share on other sites
zintonio

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.

Share this post


Link to post
Share on other sites
ReMark

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?

Share this post


Link to post
Share on other sites
zintonio

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?

Share this post


Link to post
Share on other sites
ReMark

Are you familiar with the use of lisp? Had you planned on possibly writing a lisp routine?

Share this post


Link to post
Share on other sites
zintonio

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

Share this post


Link to post
Share on other sites
ReMark

So you are going to have your lisp routine create all 104 layers prior to inserting all 104 drawings?

Share this post


Link to post
Share on other sites
zintonio

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

Share this post


Link to post
Share on other sites
ReMark

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?

Share this post


Link to post
Share on other sites
zintonio

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

Share this post


Link to post
Share on other sites
zintonio

Yes I'm going to do a purge at the end of all this.

Share this post


Link to post
Share on other sites
fuccaro

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

Share this post


Link to post
Share on other sites
zintonio

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

Share this post


Link to post
Share on other sites
fuccaro

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

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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