shamsam1 Posted November 25, 2008 Posted November 25, 2008 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 Quote
Lee Mac Posted November 26, 2008 Posted November 26, 2008 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) ) Quote
shamsam1 Posted November 28, 2008 Author Posted November 28, 2008 thanks mac.. thisis what i was looking for.. Quote
shamsam1 Posted November 28, 2008 Author Posted November 28, 2008 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 Quote
Lee Mac Posted November 28, 2008 Posted November 28, 2008 Hey Shamsam, I'm sorry, but I am only mediocre (at best) at LISP, and don't know the first thing about vb code. There are tons of other guys on here who are much more knowledgeable and should be able to lend a hand Quote
shamsam1 Posted November 28, 2008 Author Posted November 28, 2008 hello mac by tomorrow i will be able to solve it.... sam Quote
shamsam1 Posted December 2, 2008 Author Posted December 2, 2008 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 Quote
Lee Mac Posted December 2, 2008 Posted December 2, 2008 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.") Quote
asos2000 Posted December 2, 2008 Posted December 2, 2008 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 Quote
Lee Mac Posted December 2, 2008 Posted December 2, 2008 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. Quote
asos2000 Posted December 2, 2008 Posted December 2, 2008 Hi Lee What a quick reply, did u know my questions before? I just refreshed the browser any way, thanx Quote
Lee Mac Posted December 2, 2008 Posted December 2, 2008 Haha, Just on at the right time I guess Quote
shamsam1 Posted December 2, 2008 Author Posted December 2, 2008 thanks leee:) it is resolved now regards sham Quote
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.