Jump to content

ACAD.lsp and ACADDOC.lsp


Bill Tillman

Recommended Posts

In order to fully confirm I have this right:

 

1. The file acad.lsp will be executed only once, provided the variable ACADLSPASDOC=0. If I place this file in a folder on the server so all users have access to it and place this folder at the top of the Support File Path settings, then it will be executed only the one time and each user should get the same settings installed. If however, another copy of this acad.lsp file exists in another folder further down the list in the support path, it will be executed again??? So in essence I'd like to put this file in a folder at the bottom of the support paths so that it will be executed last and will overwrite any previous setting that were set by another acad.lsp???

 

2. The file acaddoc.lsp is executed each time a new drawing is opened. And again, is it executed more than once, and with different settings if more than once copy of this file is in the users' support path folders???

Link to comment
Share on other sites

Just passing through quickly....

 

1. The file acad.lsp will be executed only once, provided the variable ACADLSPASDOC=0. If I place this file in a folder on the server so all users have access to it and place this folder at the top of the Support File Path settings, then it will be executed only the one time and each user should get the same settings installed.

 

Correct... So long as Acad.lsp does not resided within DWGPREFIX, in which case that file takes precedence, as the mechanism which automagically loads Acad.[lsp[fas[vlx]]] and AcadDoc.[lsp[fas[vlx]]] was hard-coded to first trust what is in the drawing's folder, and then trust SFSP.

 

 

 

1. ... If however, another copy of this acad.lsp file exists in another folder further down the list in the support path, it will be executed again??? So in essence I'd like to put this file in a folder at the bottom of the support paths so that it will be executed last and will overwrite any previous setting that were set by another acad.lsp???

 

Incorrect.

 

More specifically, your internal Acad.lsp file should always go as close to, if not the, top of your profile's SFSP to ensure that it is the first found (see exception in my comments above). Subsequent Acad.lsp files are not loaded by default, however one can do so programmatically by parsing SFSP and iterating the list of strings for each path, etc.

 

 

 

2. The file acaddoc.lsp is executed each time a new drawing is opened.

 

Correct.

 

 

 

2. ... And again, is it executed more than once, and with different settings if more than once copy of this file is in the users' support path folders???

 

Incorrect.

 

 

 

Cheers

Link to comment
Share on other sites

Thanks sir. With all the updates that have recently been done around here, both hardware and software it's kind of chaotic. And the IT guys are not that familiar with AutoDesk products. My goal is to make this as efficient as possible with centrally located .lsp files that all users will default to.

Link to comment
Share on other sites

 

... So long as Acad.lsp does not resided within DWGPREFIX, in which case that file takes precedence, as the mechanism which automagically loads Acad.[lsp[fas[vlx]]] and AcadDoc.[lsp[fas[vlx]]] was hard-coded to first trust what is in the drawing's folder, and then trust SFSP.

 

Building on my previous post....

 

In order to prevent this from happening, user must first look at this folder via Windows Explorer to identify that no such file exists (as is not shown via the Open dialog), and then can open the drawing... Or... Implement a .NET plug-in which is loaded at Initialize(), and preemptively checks DWGPREFIX for such files, and programmatically 'Blacklists' same prior to any Acad* file(s) being loaded in the startup sequence.

 

I've been using a 'Blacklist' app for this specific tasks for the past few years, and have yet to publish my work on this at Autodesk Exchange:

 

2d1ec1c.jpg

Link to comment
Share on other sites

Thanks sir. With all the updates that have recently been done around here, both hardware and software it's kind of chaotic. And the IT guys are not that familiar with AutoDesk products. My goal is to make this as efficient as possible with centrally located .lsp files that all users will default to.

 

You're welcome; it's pretty hectic around here as well with the new job (finally!).

 

Also, don't forget to bootstrap your deployment. :beer:

 

Cheers

Link to comment
Share on other sites

... Also, don't forget to bootstrap your deployment. :beer:

Cheers

The IT dept uses Zenworks with Novell to deploy everything, but even still there's a load of stuff they missed. And their answers are, "If we didn't deploy it, it wasn't needed." And if we need them to add to the deployment it will take 3-4 weeks. And if we ask them to expedite it, they say that will add another 3-4 weeks.:lol:

Link to comment
Share on other sites

... So add a check in your network located Acad.lsp file that will vl-File-Copy ..\Acad.lsp.bootstrap from the same network folder to user's install folder (as Acad.lsp) if it does not already exist. :thumbsup:

Link to comment
Share on other sites

Still needed some more information on this I found this website.

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.

 

It states that you can have a different one in each drawing directory. Does this mean that when you open a drawing in say the C:\MyDrawings folder, and there is a ACADDOC.lsp file in this same folder, AutoCAD will load it, even if C:\MyDrawings folder is not in your SFSP? Or to put it another way.....

 

I have a ACADDOC.lsp file in one of the default SFSP folders. Thus AutoCAD will load it every time I open a new or existing drawing. I also have another ACADDOC.lsp file in C:\MyDrawings folder, (Note C:\MyDrawings is not in the SFSP) so will AutoCAD load it if I open any drawing in the C:\MyDrawings folder?

 

And don't you just hate it when the author of an article says, "... in the order defined by the library path; ..." when they should actually have written " ... in the order defined by the Support File Search Path settings ... ", or am I wrong and they are not talking about the same thing.

Link to comment
Share on other sites

As I attempted to point out here....

 

It states that you can have a different one in each drawing directory. Does this mean that when you open a drawing in say the C:\MyDrawings folder, and there is a ACADDOC.lsp file in this same folder, AutoCAD will load it, even if C:\MyDrawings folder is not in your SFSP?

 

Correct... DWGPREFIX == Drawing Directory. This location is not included in SFSP, but is included with any call to the Database.FindFile() Method (which is used for all Acad* code files).

 

The mechanism that loads AcadDoc.lsp FIRST searches the Drawing Directory (DWGPREFIX), and only if none are found, THEN searches SFSP... Which to my mind is the antithesis of what should happen, but entirely beside the point.

 

 

 

Or to put it another way.....

 

I have a ACADDOC.lsp file in one of the default SFSP folders. Thus AutoCAD will load it every time I open a new or existing drawing. I also have another ACADDOC.lsp file in C:\MyDrawings folder, (Note C:\MyDrawings is not in the SFSP) so will AutoCAD load it if I open any drawing in the C:\MyDrawings folder?

 

Incorrect.

 

Only the first AcadDoc.lsp file found (if any), is loaded by default.

Link to comment
Share on other sites

Okay, thanks. I see now that if I have a drawing folder with residential house plans in it I could place an AcadDoc.lsp file there and when I open one of those drawings it would load that AcadDoc.lsp. Likewise, when I'm doing structural steel drawings for another client I could have a different AcadDoc.lsp file in a folder for those drawings.

 

Great, now I think I have my arms around it.

Link to comment
Share on other sites

Okay, thanks. I see now that if I have a drawing folder with residential house plans in it I could place an AcadDoc.lsp file there and when I open one of those drawings it would load that AcadDoc.lsp. Likewise, when I'm doing structural steel drawings for another client I could have a different AcadDoc.lsp file in a folder for those drawings.

 

Great, now I think I have my arms around it.

 

You're welcome; I'm happy to help.

 

 

 

If you want your own network located file to load also, then you'd need to add some additional code to each-and-every-single AcadDoc.lsp file copied into your projects, or simply implement an Autoloader .bundle to load your custom LISP who's PerDocument XmlAttribute within the ComponentEntry XmlNode is enabled:

 

<!-- ... -->

<Components>
	<RuntimeRequirements SupportPath="./Contents/Resources" />
	<ComponentEntry AppDescription="Your App Description Here." AppName="Your App Name Here" ModuleName="./Contents/Resources/Your File Name.lsp"[color="red"] PerDocument="true"[/color] Version="1.0.0" />
</Components>

<!-- ... -->

Link to comment
Share on other sites

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