ILoveMadoka Posted August 19, 2011 Share Posted August 19, 2011 Lisp or Script - Procedure on Multiple Drawings? Either way I'm not sure where to start. (Didn't know whether to post this here or in the Scripting forum..) -- Readers' Digest Version: How do I run a lisp routine on all drawings in a directory? -- I have several hundred drawings and I want to open each drawing then go to the model tab and zoom extents then go to each tab and do the same then run a lisp routine that I have that updates to specific printer and print configuration (plotting extents) for model space and each tab. I don't know how to do this to a folder full of drawings and don't know if lisp or scripting is better and how to do it? I looked at ScriptPro but it does not install on XP64. I'm also looking at Lee's ScriptWriter but I don't know how to script going from tab to tab. There may be one tab there may be 30 and they may be called anything.. Is one preferable over another? Has someone written anything along these lines that they're willing to share? How do you run either (script/lisp) on multiple drawings? OR.. Can I force the PUBLISH command to print the Extents? Please advise... Thanks!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 19, 2011 Share Posted August 19, 2011 Write a LISP program to perform all the necessary operations on a drawing. Use a Script to Open / (Load &) Run LISP / Save / Close each drawing in a directory. For operating on each tab, something like: (foreach layout (layoutlist) (setvar 'CTAB layout) ... ) Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted August 19, 2011 Author Share Posted August 19, 2011 How do you open a drawing with a script? So is this used in conjunction with your Script program? >>Use a Script to Open / (Load &) Run LISP / Save / Close each drawing in a directory. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 19, 2011 Share Posted August 19, 2011 How do you open a drawing with a script? Maybe this will help: http://lee-mac.com/scriptwriting.html So is this used in conjunction with your Script program? >>Use a Script to Open / (Load &) Run LISP / Save / Close each drawing in a directory. You are welcome to use my ScriptWriter program, or ScriptPro (there is a 64-bit version somewhere), or even write your script manually. Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted August 19, 2011 Author Share Posted August 19, 2011 Ohhhh.... I have to create this.... _.open "C:\My Folder\Drawing1.dwg" _.open "C:\My Folder\Drawing2.dwg" _.open "C:\My Folder\Drawing3.dwg" That is going to be one LOOOOOOOOONG script! Thanks!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 19, 2011 Share Posted August 19, 2011 I have to create this.... _.open "C:\My Folder\Drawing1.dwg" _.open "C:\My Folder\Drawing2.dwg" _.open "C:\My Folder\Drawing3.dwg" That is going to be one LOOOOOOOOONG script! That's where the Script Writing programs come in Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 19, 2011 Share Posted August 19, 2011 http://labs.blogs.com/its_alive_in_the_lab/2010/10/adn-plugin-of-the-month-scriptpro-for-autocad-now-available.html http://cadig.com/products/autocad-script-pro.php http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618 Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 19, 2011 Share Posted August 19, 2011 That's where the Script Writing programs come in http://labs.blogs.com/its_alive_in_the_lab/2010/10/adn-plugin-of-the-month-scriptpro-for-autocad-now-available.htmlhttp://cadig.com/products/autocad-script-pro.php http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618 Cheers, for the suggestion, guys! Just added ScriptPro to my toolbox. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 22, 2011 Share Posted August 22, 2011 I use old fashioned start cmd DIR *.dwg >dirlist.scr /b and then word to make scripts its very fast when you know how or use excell to copy and paste columns to make your script _.open "C:\My Folder\Drawing1.dwg" (load "lisp1")(load "lisp2") close Y etc also here is zoom all tabs for you ; goes through all layout tabs and zooms all [font=monospace]; By Alan H june 2011[/font] [font=monospace](vl-load-com)[/font] [font=monospace](command "_.pspace")[/font] [font=monospace](setq curtab (getvar "Ctab"))[/font] [font=monospace](setq this_dwg (vlax-get-acad-object))[/font] [font=monospace](foreach d (layoutlist)[/font] [font=monospace] (setvar "CTAB" d)[/font] [font=monospace] (vla-ZoomExtents this_dwg)[/font] [font=monospace])[/font] [font=monospace](setvar "ctab" curtab)[/font] [font=monospace](princ)[/font] Quote Link to comment Share on other sites More sharing options...
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.