Jump to content

insert n no of autocad drawings from path specified


Recommended Posts

Posted

i have notepad in which i specify all path of the dwg file ex

 

c:\fisrt.dwg

d:\foler1\second.dwg

D:\aaaa\area.dwg

 

i am looking for lisp program or vb.6 program which will extract the drawing and insert the drawings in same layers.

i.e open all drawings in same layers

Posted

Maybe this?

 

(defun c:dwin () (c:DWGINSERT)) ; Program Shortcut

(defun c:DWGINSERT (/ dwglist oldlay pt1)
   
   (setq dwglist '("C:\\Users\\Lee Mac\\Drawing1.dwg"   ;  <<-----<< List Drawings Here
                   "C:\\Users\\Lee Mac\\Drawing5.dwg"
   ))

   (setvar "cmdecho" 0)
   (setq oldlay (getvar "clayer"))
   (if (not (tblsearch "LAYER" "DWGS"))
   (command "-layer" "m" "DWGS" "C" "1" "DWGS" ""))
   (foreach dwg dwglist
       (if (and
           (setq pt1 (getpoint "\nSpecify Insertion Point for Dwg."))
           (vl-cmdf "-insert" dwg pt1 "" "" ""))
           (princ (strcat "\n" dwg " Inserted."))
           (alert "\nDrawing Not Found.")
       ) ; end if
   ) ; end foreach
   (setvar "cmdecho" 1 )
   (setvar "clayer" oldlay)
   (princ)
)

Posted

thanks mac..

 

thisis what i was looking for..

Posted

hello mac

 

i wan to edit

'("C:\\Users\\Lee Mac\\Drawing1.dwg"   ;  <<-----<< List Drawings Here
                   "C:\\Users\\Lee Mac\\Drawing5.dwg"

 

i want to edit particular line form vb.6 code. as i will be passing the dwg path form vb.6 code

can u guide me

Posted

Hey Shamsam,

 

I'm sorry, but I am only mediocre (at best) at LISP, and don't know the first thing about vb code. :oops:

 

There are tons of other guys on here who are much more knowledgeable and should be able to lend a hand :)

Posted

hello mac

 

by tomorrow i will be able to solve it....

 

:)

sam

Posted

Hello Mac

 

I have a problem with the lisp , when i am insering the autocad file the its not getting inseted in its original(its geting rotated)

i have attached picture1 and picture2 for reference..

 

picture1 is original dwg file.. picture2 is by using lisp

Picture1.jpg

Picture2.jpg

Posted

Hi Sham,

 

try this, let me know if it resolves the issue:

 

;|

    .: Multiple Block Insertor :.

        .: by Lee McDonnell :.

         .: December 2008 :.

|;

; Version 1.1 ~ UCS code added.


(defun c:dwin () (c:DWGINSERT)) ; Program Shortcut

(defun c:DWGINSERT (/ dwglist oldlay pt1)
   
   (setq dwglist '("C:\\Users\\Lee Mac\\Drawing1.dwg"   ;  <<-----<< List Drawings Here
                   "C:\\Users\\Lee Mac\\Drawing5.dwg"   ;  <<-----<< List More Drawings Here...
   ))

   (setvar "cmdecho" 0)
   (setq oldlay (getvar "clayer"))
   (if (not (tblsearch "LAYER" "DWGS"))
   (command "-layer" "m" "DWGS" "C" "1" "DWGS" ""))
   (command "ucs" "w")
   (foreach dwg dwglist
       (if (and
           (setq pt1 (getpoint "\nSpecify Insertion Point for Dwg."))
           (vl-cmdf "-insert" dwg pt1 "" "" ""))
           (princ (strcat "\n" dwg " Inserted."))
           (alert "\nDrawing Not Found.")
       ) ; end if
   ) ; end foreach
   (command "ucs" "p")
   (setvar "cmdecho" 1 )
   (setvar "clayer" oldlay)
   (princ)
)
(princ "\nMultiple Block Insertor Loaded. Type \"DWIN\" to invoke.")

Posted

Mr. Lee

thanx for that nice and helpful lisp.

there are 2 questions

- Could the lisp open the browser then I choose the files which i want to insert?

- Could the inserted file be a block?

 

Regards

Posted

Hi Asos,

 

Thank you for your message, your questions, in reverse order:

 

2) The files that are inserted are inserted as blocks, so I would be inclined to say yes.

 

1) The LISP can pause and prompt the user for a drawing name of the drawing to be inserted, in which case one could enter a filepath. But I cannot find a way to make it open the browser at this pause. It may be possible using Active X methods, but I do not know enough in this field to know whether or not it is possible.

Posted

Hi Lee

What a quick reply,

did u know my questions before? I just refreshed the browser

any way, thanx

Posted

thanks leee:)

 

it is resolved now

 

regards

sham

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