Jump to content
zintonio

Join files dwg in one dwg

Recommended Posts

zintonio

Many thanks for reply. You are right. I was distracted. I try the following, seems to work but obviously i have to put all the dwgs into the same foder of the new dwg. (defun c:main ( / name path prefix i nr ) (setq prefix (getvar "dwgprefix")) ; In this point i want to put a shell window that let me to choose the file to insert in. (setq i 0) (repeat 2 (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))) (setq path (strcat prefix name)) (command "_-LAYER" "_M" name "") (command "-insert" path "0,0" "1" "1" "0") ; in this point I have to: 1. explode the block; 2. select the whole exploded; 3. put it into the layer "name" (princ (strcat " " name)) ) ) Thanks a lot

Share this post


Link to post
Share on other sites
zintonio

Many thanks for reply. You are right. I was distracted. I try the following, seems to work but obviously i have to put all the dwgs into the same foder of the new dwg.

 

(defun c:main ( / name path prefix i nr )

 

(setq prefix (getvar "dwgprefix")) ; In this point i want to put a shell window that let me to choose the file to insert in.

(setq i 0)

(repeat 2

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

(setq path (strcat prefix name))

(command "_-LAYER" "_M" name "")

(command "-insert" path "0,0" "1" "1" "0") ; in this point I have to: 1. explode the block; 2. select the whole exploded; 3. put it into the layer "name"

 

(princ (strcat " " name))

)

 

 

)

Share this post


Link to post
Share on other sites
fuccaro

If you are familiar with Lisp, try to explore the GETFILED command.

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