Author Topic: Trying to load a LSP....help  (Read 5626 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
Trying to load a LSP....help
« on: July 20, 2005, 11:58:21 AM »
Ok, I know how to silent load a LSP file by editing the ACAD.lsp file but I dont want to have to do that, reason being this will go to other peoples computers and I dont want to copy a new acad.lsp file to their cpu casue it may change some user settings they have already.

All this Lisp file I want to load will do is, say at the command line " Custom CAD settings Version 2.0 Loaded"

I want this just to keep track of wha version everyone has on their pc's.

Right now all the custom stuff we have is coming from a mns file that loads all our toolbars and menus.

Is there a way to load a LSP file with in the mns file? or is there another way to do this?

I want to keep the loading paths like in the startup suite as less as possible, too many paths and people start asking me too many questions  :wink:

thanks guys/gals.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Trying to load a LSP....help
« Reply #1 on: July 20, 2005, 12:03:17 PM »
Quote from: AVCAD
Is there a way to load a LSP file with in the mns file? or is there another way to do this?

You can use an .mnl file.
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Trying to load a LSP....help
« Reply #2 on: July 20, 2005, 12:07:40 PM »
just to refresh your memory if you don't already know .. an MNL is a "menu lisp" file ... essentially it is a lisp file ... it must be named the same as the menu file .. so if your MNS file is called "CustomCAD.MNS" you should also have a "CustomCAD.MNL" file ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

AVCAD

  • Guest
Trying to load a LSP....help
« Reply #3 on: July 20, 2005, 04:43:17 PM »
hmmm....where would this MNL file be located? I have a MNS MNR and MNC file but no MNL file.


I use ACAD 2004, if that makes a differance...

ronjonp

  • Needs a day job
  • Posts: 7529
Trying to load a LSP....help
« Reply #4 on: July 20, 2005, 04:55:49 PM »
Put it in the same dir as your mns file.

I like the idea of having an easy way to tell if the user is up to date so I added this to my mnl file:

(princ "\n   <<U p d a t e d - 0 7 . 2 0 . 2 0 0 5>>")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Trying to load a LSP....help
« Reply #5 on: July 20, 2005, 04:56:31 PM »
You create it and put it in the same location as the MNS ... it is essentially just a lisp file with a different extension
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

hendie

  • Guest
Trying to load a LSP....help
« Reply #6 on: July 21, 2005, 03:53:38 AM »
I would look into using Acad Install and Inno Setup
It automatically searches for the acaddoc,lsp and you can APPEND whatever you like to the file without worrying about changing any of the users current settings

Tom Smith

  • Guest
Trying to load a LSP....help
« Reply #7 on: July 21, 2005, 10:45:38 AM »
"I dont want to copy a new acad.lsp file to their cpu casue it may change some user settings"

I agree that the mnl would be a logical place to do what you want. However, I'm curious about the acad.lsp reference. Several points...

To load in every drawing, you'd normally use acaddoc.lsp, not acad.lsp. And in most setups I've seen, both of these are deemed company-standard files, not user-customizable. This can be a pretty complex issue, which files the user is allowed to personalize. It's a balance between maintaining company standards, simplifying routine file maintenance, and allowing a reasonable degree of latitude for personal preference without compromising the standards.

I've never used a startup lisp to change any "settings," and have an aversion to anything about a file being altered upon its being opened. I want a file to open exactly as it was saved. Don't want any of my profile settings changed either, I want everything that's kept in the registry to remain the same as when I set it last.

hendie

  • Guest
Trying to load a LSP....help
« Reply #8 on: July 21, 2005, 10:52:19 AM »
I believe the ACADDOC.LSP is the Autodesk recommended method

Quote
Each time a drawing opens, AutoCAD searches the library path for an acaddoc.lsp file. If it finds one, it loads the file into memory. The acaddoc.lsp file is always loaded with each drawing regardless of the settings of ACADLSPASDOC and LISPINIT.

Most users will have a single acaddoc.lsp file for all document-based AutoLISP routines. AutoCAD searches for an acaddoc.lsp file in the order defined by the library path; therefore, with this feature, you can have a different acaddoc.lsp file in each drawing directory, which would load specific AutoLISP routines for certain types of drawings or jobs.

The acaddoc.lsp file can contain AutoLISP code for one or more routines, or just a series of load function calls. The latter method is preferable, because modification is easier. If you save the following code as an acaddoc.lsp file, the files mydocumentapp1.lsp, build.lsp, and counter.lsp are loaded every time a new document is opened.

(load "mydocumentapp1")
(load "build")
(load "counter")
AutoCAD searches for an acaddoc.lsp file in the order defined by the library path; therefore, you can have a different acaddoc.lsp file in each drawing directory. You can then load specific AutoLISP routines for certain types of drawings or jobs.

Warning!  Do not modify the reserved acad2000doc.lsp file. Autodesk provides the acad2000doc.lsp file, which contains AutoLISP-defined functions that are required by AutoCAD. This file is loaded into memory immediately before the acaddoc.lsp file is loaded.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Trying to load a LSP....help
« Reply #9 on: July 21, 2005, 10:55:09 AM »
In my office we use the ACAD.LSP file to load standards and to enforce certain things. For example, upon opening the drawing, if there are dimensions that are not to our standard, they are MADE to be to the standard. If the user requires something not in the standard or which deviates from the standard, they must create a deviation dimension style for that particular dimension.

In my last company we enforced specific geometric locations ... we would define the limits then move the entire project from it's location to align it to the invisible grid we defined. It made it possible to develope more applications that would work with the model.

I do a LOT of housekeeping with ACAD.LSP and the (S::STARTUP) function .. users are not allowed to modify that, but may modify anything else not specifically set out in standards.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ronjonp

  • Needs a day job
  • Posts: 7529
Trying to load a LSP....help
« Reply #10 on: July 21, 2005, 11:17:16 AM »
Quote
I do a LOT of housekeeping with ACAD.LSP and the (S::STARTUP) function .. users are not allowed to modify that, but may modify anything else not specifically set out in standards.


Me too  :D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Tom Smith

  • Guest
Trying to load a LSP....help
« Reply #11 on: July 21, 2005, 11:56:32 AM »
Quote from: Keith
In my office we use the ACAD.LSP file to load standards and to enforce certain things


I don't disagree with the general approach of enforcing things through a standardized startup sequence. But by default the file that loads in every drawing is acaddoc.lsp, not acad.lsp. You can force "legacy" behavior of acad.lsp by setting acadlspasdoc=1 but this defeats the useful distinction in behavior between the two files.

I do a bit of housekeeping in a company-standard acad.lsp, which generally gets runs about once a day in the first drawing opened. But it's nothing drawing-specific. Stuff I want loaded in every file gets implemented through acaddoc.lsp, and that file is office-standard too.

In bending over backwards to allow personalizations which don't conflict with standards, our initial A2K4 install on every machine includes a "user" menu containing one blank toolbar and a user.mnl, which loads an initially empty user.lsp. If they're clever enough, they can do stuff in there, and it won't be overwritten by my standards updates.

Historically, about 1 in 5 users have done a little toolbar modification, and maybe 1 in 15 or 20 have done anything in the lisp files. I give them the ability to do a bit of lisp "just in case" anyone is ever interested. But it's rare at best -- just another reason I'd never consider the acad(doc).lsp files to be "user" files.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Trying to load a LSP....help
« Reply #12 on: July 21, 2005, 12:23:28 PM »
The main reason we use acad.lsp is because of the S::STARTUP routine ...setting acadlspasdoc is not a problem .. all of our users do.

Personally though, I don't modify any of them for user customization, if the user has a toolbar they want to incorporate, or a lisp routine, they must load it via their profile (and any IT guy who overwrites it should be drawn and quartered) and the Startup Suite In this manner, there is no problems with customization and standardization.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Tom Smith

  • Guest
Trying to load a LSP....help
« Reply #13 on: July 21, 2005, 03:30:47 PM »
Quote from: Keith
The main reason we use acad.lsp is because of the S::STARTUP routine


Huh? See the docs. You can put (s::startup) anywhere in the startup sequence -- in acad.lsp, acaddoc.lsp, in any mnl that's loaded, or in any lisp file that's loaded by any of the above. The fact that it can be in any or all of these places is why it's thought best to do the append thing.

When Acad changed things and added acaddoc.lsp in support of the MDI, they did not require that you change the default value of acadlspasdoc in order to use an (s::startup) function. The simplest way to keep a legacy acad.lsp acting exactly the same was to rename it to acaddoc.lsp -- the (s::startup) will run just the same in that file.

Tom Smith

  • Guest
Trying to load a LSP....help
« Reply #14 on: July 22, 2005, 11:51:34 PM »
Hey, it's not like I need a reply, I'm just a newbie that told you're wrong. I guess that's when it turns boring and you jump on another thread. Cool.