Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Force a lisp routine to be run

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
thierry.huisman
794 Views, 14 Replies

Force a lisp routine to be run

I have created an acad.lsp file in where I want to arrange all our company settings. I've stored it on the network to make sure everyone will use the same one and when updates take place I don't have to run past all pc's to change it. I've set everything in the deployment package but users can still change it when they reset their profile. Plus some pc's are already installed with AutoCAD before creating the lisp routine, how can I enforce the support directory to check on the network for the acad.lsp each time?

14 REPLIES 14
Message 2 of 15

I believe that moving the network location for "acad.lsp" above the installed location on the C:\ drive is what you are looking to do.  This is done through the OPTIONS dialog under "Files" tab. 

 

(if ("mysolution"=answer) then (click "Accept As Solution"))
------------------------------------------------------------------------------------

─────────────────────────────────────────────────────────────────────────────────────────────
Brandon Gingerich
Message 3 of 15
dgorsman
in reply to: bgingerich

I've also distributed an ACAD.LSP file to the local computers and manage the search paths with the start-up routine.  If users try to get creative or sneaky, all they end up doing is loading the local LSP file first which immediately closes AutoCAD.  Plus, without the common files they don't get any of the tools which make their life easier.  Stick and carrot approach.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 4 of 15
thierry.huisman
in reply to: dgorsman

For excisting installations I would still need to replace the local acad.lsp file?

Message 5 of 15


@thierry.huisman wrote:

For excisting installations I would still need to replace the local acad.lsp file?


I expect you're going to need to do something on each computer, but maybe only once.  I would be inclined to remove any acad.lsp and/or acaddoc.lsp files from each computer [rather than try to maintain a standard version on each one], so that the only way each installation can get at what's in those files is from the shared one in a shared location.  If you do leave any such file(s) on each computer [which you might possibly want to do so that, for example, they can at least function if the Server goes down], that shared location should be at the top of the Support File Search Path list to ensure AutoCAD "sees" the right one, so you may need to get into each installation to ensure that.  [The reply from dgorsman suggests maybe there's a way to do that via setup code, but I haven't done such things, so I couldn't say.]

 

 

Of course, a really knowledgeable user could always circumvent such arrrangements if they have some nefarious reason to -- make their own such file(s) and change the hierarchy in their Support File Search Path list.  Even if you can configure something to change it back the next time they open AutoCAD, they could always change it again each time, so there may be no iron-clad way to enforce compliance by a really determined user.

Kent Cooper, AIA
Message 6 of 15
hmsilva
in reply to: thierry.huisman

thierry.huisman, just another idea,
in the beginning of each session, copy and repace the acad.lsp, acadoc.lsp and acad.pgp files,
from the network location to the each user suport directory...

 

Henrique

EESignature

Message 7 of 15
dgorsman
in reply to: hmsilva

I'd stay away from the PGP file myself.  Users can get *real* cranky when you mess with their command aliases.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 8 of 15
dgorsman
in reply to: Kent1Cooper

I planned for doing such things as distributing local files to users from the outset, since there is always something which absolutely must be local be it a data file for a third-party application or a core AutoCAD file like ACAD.LSP.  On the server I have a set of folders in which I can drop a LSP file; when the user runs the application associated with that folder, each LSP file in that folder is loaded and the function inside is run (if it hasn't done so already).  Then that particular file is logged so it isn't run over and over again.  The update LSP file may create folders, rename/copy/delete files, make minor registry changes, call simple EXE's or BAT's, basically everything a LSP can do in terms of file management.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 9 of 15
hmsilva
in reply to: dgorsman

dgorsman,
in our company, those files are company policy
we all work with the same files,is not easy
In the beginning, but allows us to work on any PC, anywhere ...

 

Henrique

EESignature

Message 10 of 15
Kent1Cooper
in reply to: dgorsman


@dgorsman wrote:

I planned for doing such things as distributing local files to users from the outset, since there is always something which absolutely must be local be it a data file for a third-party application or a core AutoCAD file like ACAD.LSP.  ....


Just so you know....

 

ACAD.LSP is optional, and if used, it doesn't need to be local.  To quote from Help:

 

"The acad.lsp file is useful if you want to load specific AutoLISP routines every time you start AutoCAD. When you start AutoCAD, the program searches the library path for an acad.lsp file. If it finds one, it loads the file into memory."

 

We use one, just to do the MODEMACRO thing for status-line display of some stuff, and it lives only at a shared location on the Server [which is at the top of everyone's Support File Search Path list], not on each computer.

Kent Cooper, AIA
Message 11 of 15
dgorsman
in reply to: Kent1Cooper

Never mentioned it being required.  If you are referring to the "core" descriptor thats intended to differentiate it from other files which aren't directly related with AutoCAD e.g. steel shape data.  In fact, sometimes those "optional" AutoCAD files become required by those third-party programs, in some cases they *must* be local.  Bad design, certainly not what I would do, but its what we have to live with.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 12 of 15
dgorsman
in reply to: hmsilva

Our users can also work on any computer through personal AutoCAD support files are kept on a network drive personalized for each user.  No messing around with login IDs either, since its the same path for everybody.  We've even had a few users leave the company, work elsewhere, come back and their settings are still in place.

 

We used to have a common PGP file and the whining was deafening.  🙂

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 13 of 15
hmsilva
in reply to: dgorsman

dgorsman, when I wrote:

 

...but allows us to work on any PC, anywhere ...

 

I mean anywhere, not only in our offices. In our company we have to travel to the countries in which we work, and sometimes we are in the interior of africa, without internet, working with one computer from another coworker...

Is the advantage to have the same settings in all computers.

But I understand the whining...

 

Henrique

EESignature

Message 14 of 15
thierry.huisman
in reply to: hmsilva

Thanks everyone for thinking along. Think I will make a local acad.lsp indeed forcing the network lisp routine to be loaded first. Any changes can then be done in the network lisp file like dgorsman described.

We have just started creating a standard within the company and this is just the starting point for it all.

Message 15 of 15

I have always stayed clear of modifying any routine provided, replacing is another issue altogether, with AutoCAD. From my perspective the acad.lsp file is no different than the standard text or the defpoints and 0 layers - it is provided for reference only and shouldn't be used. The best practice is to make any and all system variable changes from an externally hosted file. This reduces future update headaches and it reduces the ability for the local user's to wreak havoc (Kent1Cooper is right, a knowledgeable user can get around any safeguard, including pathing uses).

 

So to that end I will suggest that you look into the best practices for CUI manipulation and use an MNL file to load routines and/or make system wide changes ...

 

I can outline how our network profile is setup if you or anyone else is curious.


- Rob

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost