wwd Posted September 8, 2009 Posted September 8, 2009 I am trying to create a script that would run anytime a user opens a drawing or creates a new drawing. We are running Civil 3D 2010 and want the user to select a data shortcut (project) when opening a drawing. Something like open (or new), then run the command "setshortcutsfolder". Thanks for any help. Quote
alanjt Posted September 8, 2009 Posted September 8, 2009 I am trying to create a script that would run anytime a user opens a drawing or creates a new drawing. We are running Civil 3D 2010 and want the user to select a data shortcut (project) when opening a drawing. Something like open (or new), then run the command "setshortcutsfolder".Thanks for any help. anything you put in, either the acad.lsp or acaddoc.lsp, will run on every startup. Quote
wwd Posted September 8, 2009 Author Posted September 8, 2009 Thanks for the reply, but I need it to run on all "open" or "new " commands, not just on startup. Quote
AQucsaiJr Posted September 8, 2009 Posted September 8, 2009 alanjt is correct.... Whatever you place in the acad.lsp or acaddoc.lsp will run on every startup. What may be confusing you is the term startup. Any time you open a new drawing Auto-CAD looks for these files before loading that drawing. So if you add commands/settings to these files to run, those commands/settings will run every time you open a drawing. Give it a try, I believe it may be what your looking for as I had a very similar problem a little while back, and it solved my issue. Take a look at this thread: Default Snap Spacing/AQucsaiJr Quote
wwd Posted September 8, 2009 Author Posted September 8, 2009 Thanks also for the reply. Sorry, I don't fully understand how to get this to work. Let's say I wanted the layer manager to open with each drawing I opened, I would just add "layer" to the acaddoc.lsp to get it to open each time? Quote
gilsoto13 Posted September 9, 2009 Posted September 9, 2009 Thanks also for the reply. Sorry, I don't fully understand how to get this to work. Let's say I wanted the layer manager to open with each drawing I opened, I would just add "layer" to the acaddoc.lsp to get it to open each time? I do this in my installation... what I did is I added 2 loading lisp lines in my acad2009doc.lsp (located in the installation support directory) In my case is.. C:\Archivos de programa\AutoCAD 2008\Support Then the last one loads and executes a script to load the first one... check the files attached... all of these files need to be in a support directory (to see support directories go to autocad... options... files... file support search path) reset script.zip Quote
alanjt Posted September 9, 2009 Posted September 9, 2009 Thanks also for the reply. Sorry, I don't fully understand how to get this to work. Let's say I wanted the layer manager to open with each drawing I opened, I would just add "layer" to the acaddoc.lsp to get it to open each time? generally, yes. however, since it's a dialog and a commandline version exists, you have to initiate the dialog: (initdia) (command "_.layer") will open the layer manager (initdia) can be placed before any command called with code, that you want the dialog version of (ie: mtext, plot, layer, image, etc.) Quote
lpseifert Posted September 9, 2009 Posted September 9, 2009 I added 2 loading lisp lines in my acad2009doc.lsp (located in the installation support directory) Better you use (or create) the acaddoc.lsp file than the acadXXXXdoc.lsp file to add to your startup routine. The acadXXXXdoc.lsp file will be overwritten if you need to do a repair or reinstall. http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=2897258&linkID=9240617 Quote
wwd Posted September 9, 2009 Author Posted September 9, 2009 Thanks to all, I will give these a try. Quote
alanjt Posted September 10, 2009 Posted September 10, 2009 Better you use (or create) the acaddoc.lsp file than the acadXXXXdoc.lsp file to add to your startup routine. The acadXXXXdoc.lsp file will be overwritten if you need to do a repair or reinstall.http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=2897258&linkID=9240617 Plus, when it's time to upgrade, you have to remember to copy out all additions you made to the acad(doc)XXXX.lsp and paste into the new version. While it's the best policy, especially since you aren't supposed to edit the *XXXX.lsp files, utilizing the acad(doc).lsp files is just easier and less work (I'm very lazy, I write programs to shorten all things I do). 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.