Jump to content

Recommended Posts

Posted

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

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • zintonio

    12

  • ReMark

    7

  • fuccaro

    3

  • rkent

    1

Posted

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

)

 

 

)

Posted

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

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