wannabe Posted January 7, 2009 Share Posted January 7, 2009 Would be keen to spend a bit of time learning about scripts and what they are used for by other people. Does anyone have one already or fancy doing one(tutorial)? I currently have a couple of examples, but nowhere near an in-depth knowledge; which is what I may be aiming for if I can ascertain that it would be worthwhile. cheers. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 "How to write a script file" by Ralph Grabowski. Includes a brief description of what a script file is at the beginning of the article. http://www.upfrontezine.com/tailor/tailor19.htm Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 Start learning about scripts right here at CADTutor. At the top of the screen click on Tutorials...AutoCAD...Techniques. Page down to the section titled Perspectives, Slides and Scripts. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 "How to modify an object with a script" by A. Parsia: http://www.caddigest.com/subjects/autocad/tutorials/select/parsai_modify_objects.htm Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 "Automate tasks with a script file" by Ellen Finkelstein: http://www.ellenfinkelstein.com/autocadtips/AutoCAD_tips_automate_scripts.html Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 A link to CAD-Manager.com hosted by Robert Green.Page down to the section titled "Scripting Made Simple". http://www.cad-manager.com/archives/category/code Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 wannabe: Do you know how I found all these links (plus many others)? I used Google. I conducted a search using the following keywords (include the quotation marks and the plus signs): "autocad"+"script"+"tutorial" The key to getting good useful information from any search engine, without getting overwhelmed by a lot of junk, is to conduct a search on specific words and/or combinations of words. Now that you know my trick go out and discover some of your own links to the topic at hand. There is a wealth of information out there and it is right at your fingertips. Be the Internet equivalent of Indiana Jones and find the treasure. Happy hunting. Quote Link to comment Share on other sites More sharing options...
wannabe Posted January 7, 2009 Author Share Posted January 7, 2009 Indeed, Google does provide many, many links. Whereas a recommendation from a CADTutor member holds more weight, relating to CAD, than anything Google will. Plus, with this information available on this site, I think whoever contributes to this thread will be doing more than just me a favour. Thanks for your time. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 7, 2009 Share Posted January 7, 2009 You're entirely welcomed. We pick and choose what has meaning to us alone. My choices may not be the same as yours. I don't confess to be more CAD knowledgeable than any other forum member here including yourself. I do feel I have a certain knack for "finding" things (said with some humility). With that said, I hope the links provide you with a good starting point for your interest in scripts and their use. I'll be counting on you in the future to be our source of script knowledge. See you around I hope. Quote Link to comment Share on other sites More sharing options...
wannabe Posted January 8, 2009 Author Share Posted January 8, 2009 A link to CAD-Manager.com hosted by Robert Green.Page down to the section titled "Scripting Made Simple". http://www.cad-manager.com/archives/category/code This one seems to be the best IMO for getting a basic understanding. Maybe I should post in general and ask people for some examples of scripts they use. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2009 Share Posted January 8, 2009 You might also want to check the AutoDesk and AUGI websites too. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2009 Share Posted January 8, 2009 Scripts can be used to: - Batch recover files - Automate software installation - load ARX files - batch process drawings - remove hyperlinks from a drawing - add preview images to earlier releases of AutoCAD These and other tasks can be accomplished using the Scriptpro Utility available at: http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618 Here is what AutoDesk has to say about Scriptpro: "ScriptPro takes AutoCAD scripting to a new level with an easy-to-use interface, logging, reusable project files, enhanced scripting with new keywords and utilities, and robust error recovery. Using ScriptPro, you can apply a set of commands to multiple drawings by simply specifying a script file and the list of drawings that you would like to apply the script to". Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted January 8, 2009 Share Posted January 8, 2009 Would http://www.Afralisp.net be of any use to you? Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2009 Share Posted January 8, 2009 If you haven't already, I strongly recommend that you join AUGI the AutoDesk Users Group International. Membership is free. By doing so you'll have access to their forums and a host of educational material. Included in the latter is a handout from AutoDesk University written by Daniel Abbott entitled, "Super Scripting Secrets." To locate this handout click on the word Education at the top of the first AUGI webpage. Then click on AU Class Handouts on the drop-down menu. At the next screen you're prompted to indicate both the Year and the Industry. Your selections should be 2001 and Customization & Programming respectively. On the next page you're taken to page down until you get to the handout previously mentioned. Handouts can be downloaded to one's computer for later reading. I would also suggest you check out entries under other years listed using the same Industry catagory as there may have been other class handouts about working with scripts. You can skip year 2000 as there aren't any (I checked that first). I think you have enough to work with given the information I have provided in this post and the one previous to it. Good luck and happy scripting. Quote Link to comment Share on other sites More sharing options...
dbroada Posted January 8, 2009 Share Posted January 8, 2009 I've come here as I spotted "the other" thread. I don't get this far down very often. Trying to say what a script is used for is a bit like asking what LINE is used for. It is another VERY useful AutoCAD process that few people have ever used. It is basically a series of commands entered from a text file as though you had typed them directly at the command line. my 2 most recent.... ucs z 90 plan c grid nsmnsd resume and ucs w plan c grid off I was drawing a group of flow diagrams and these just turned the page through 90 degrees and back again. and one to launch a VBA royine to combine 2 DXF files into a single drawing file. This is part of a VB program to create hundreds of similar drawings by linking to a database for the variations. sdi 1 new acadiso vbastmt DxfImport("H:\Design_Office\E277\Loops\22-IBTSCS2\Output\E277-22-LD001-384_0.dxf") vbastmt DxfImport("H:\Design_Office\E277\Loops\22-IBTSCS2\Output\E277-22-LD001-384_1.dxf") saveas 2007 "H:\Design_Office\E277\Loops\22-IBTSCS2\Output\E277-22-LD001-384" resume I would also use a script to insert an issue box into a drawing, to update blocks with a new definition or to batch plot a series of drawings. Already the best kept secret of AutoCAD, they may now die out as AutoCAD 2009 comes with a macro recorder which may do all most people want from scripts. I will look when we install or update. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2009 Share Posted January 8, 2009 Dave: That's a good point regarding the Macro Reader. New for 2009 right? Quote Link to comment Share on other sites More sharing options...
dbroada Posted January 8, 2009 Share Posted January 8, 2009 Dave: That's a good point regarding the Macro Reader. New for 2009 right?Yes. Its a bit more versitile than scripting in that you can put pauses for operator intervention. If you have to do the same thing to a LOT of files then scripting will still win. If you have to do similar tasks often the recorder may win. I haven't tried it yet but did see it demo'ed. Quote Link to comment Share on other sites More sharing options...
dbroada Posted January 8, 2009 Share Posted January 8, 2009 and another thing, a big problem with scripting is that there is no error trapping. If the command sequence is unusual for any reason then your script will fall over. It will keep reading the next line of the script file until a suitable command is given and then continue from where there. This will usually happen at the point of maximum devastation. Quote Link to comment Share on other sites More sharing options...
ReMark Posted January 8, 2009 Share Posted January 8, 2009 So Dave, your suggestion would be to test out a script, maybe more than once, to see if it works as intended or bombs part way through? Quote Link to comment Share on other sites More sharing options...
dbroada Posted January 8, 2009 Share Posted January 8, 2009 from personal experience YES!!! there are a few "gotchas" too. Once that had me confused for a very long time is..... you know if you print a file AutoCAD thinks the drawing has changed so before you open another file you get "Do you want to save changes?". From the command line the answer would be "N", but in script you are asked "Do you want to discard changes?" and you need to answer "Y". Normally if things go wrong AutoCAD will look through the rest of the script but not find a suitable answer. The problem comes when there is an appropriate answer, but one to a different question. I will normally "write" my script while typing at the keyboard and then try it on another drawing before letting lose on many. I don't always test them as confidence in my ability is greater than it should be. I will test critical ones though, often on copies first. 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.