Jump to content

Recommended Posts

Posted

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.

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

Posted

Thanks for the reply, but I need it to run on all "open" or "new " commands, not just on startup.

Posted

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

Posted

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?

Posted
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

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

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

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