Author Topic: cant edit acad.lsp or acaddoc.lsp  (Read 6055 times)

0 Members and 1 Guest are viewing this topic.

andrew..

  • Newt
  • Posts: 24
cant edit acad.lsp or acaddoc.lsp
« on: July 31, 2015, 09:19:07 AM »
hello gang.
i started a new job and couldnt remember my old login so had to make a new account.
anyway. i have some custom lisp files i need to add to the acad.lsp and the acaddoc.lsp files but they are admin controlled.
how can i get my acad and acaddoc lsp files to load along side of the OOTB acad and acaddoc lsp files?

is there maybe another way to load my files on startup without editing these files?


JohnK

  • Administrator
  • Seagull
  • Posts: 10652
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #1 on: July 31, 2015, 09:30:05 AM »
Yes, a MNL file.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ChrisCarlson

  • Guest
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #2 on: July 31, 2015, 09:36:52 AM »
People still load their routines into those files? Why not load through the startup suite which is not admin controlleD?

ronjonp

  • Needs a day job
  • Posts: 7529
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #3 on: July 31, 2015, 10:14:35 AM »
People still load their routines into those files? Why not load through the startup suite which is not admin controlleD?

I have not used the startup suite in over a decade. Last time I remember it was sorta half baked .. but maybe it's better now?


Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

JohnK

  • Administrator
  • Seagull
  • Posts: 10652
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #4 on: July 31, 2015, 10:22:11 AM »
People still load their routines into those files? Why not load through the startup suite which is not admin controlleD?

Ummm...why wouldn't they *not* use an MNL file? Don't you create a custom or enterprise CUIX file? There was no way I was going to go around to everyone's computer and add files to the end users startup thing (way too many people/computers); I would have lost my job for wasting time!

Quote
...
MNL files with the same name and location as your main, enterprise, or partial customization files are loaded automatically; these files cannot be removed.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #5 on: July 31, 2015, 10:24:14 AM »
hello gang.
i started a new job and couldnt remember my old login so had to make a new account.
anyway. i have some custom lisp files i need to add to the acad.lsp and the acaddoc.lsp files but they are admin controlled.
how can i get my acad and acaddoc lsp files to load along side of the OOTB acad and acaddoc lsp files?

is there maybe another way to load my files on startup without editing these files?

You don't.  If those files are locked down there is generally a good reason.  Your customizations could end up bypassing important protocols/procedures you aren't aware of.  First, as a new employee you need to learn to do things the company way.  Then you can see if fiddling around would improve things rather than making them worse.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

ChrisCarlson

  • Guest
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #6 on: July 31, 2015, 10:30:38 AM »
People still load their routines into those files? Why not load through the startup suite which is not admin controlleD?

Ummm...why wouldn't they *not* use an MNL file? Don't you create a custom or enterprise CUIX file? There was no way I was going to go around to everyone's computer and add files to the end users startup thing (way too many people/computers); I would have lost my job for wasting time!

Quote
...
MNL files with the same name and location as your main, enterprise, or partial customization files are loaded automatically; these files cannot be removed.

We utilize enterprise CUIx here but the way it sounds he doesn't have access to modify the CUI file (maybe they have the same setup?) so the next step is to

A) Figure out why, maybe its a bad routine? Not vetted?
B) If he absolutely needs that routine the next best step is to add it to his start-up suite.

BlackBox

  • King Gator
  • Posts: 3770
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #7 on: July 31, 2015, 10:32:51 AM »
If using 2012+, you can always use one of the 2-3 ..\ApplicationPlugins\ folders to load a custom .bundle (which loads your own LISP, etc.) and completely bypasses all AutoCAD Security (save some 2016 changes, which user can immediately, and permanently dismiss, BTW)... See this old post for more info.



Also, doesn't CUIx support 'embedded' LISP (no need for MNL)? :-)

About Loading an AutoLISP File with a CUIx File

Quote
...
MNL files with the same name and location as your main, enterprise, or partial customization files are loaded automatically; these files cannot be removed. Additional AutoLISP (LSP) files can be loaded with a CUIx file by adding a reference to the file under the LISP Files node displayed for a loaded CUIx file in the Customizations In pane of the Customize User Interface (CUI) Editor.
« Last Edit: July 31, 2015, 10:37:42 AM by BlackBox »
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #8 on: July 31, 2015, 10:36:59 AM »
We utilize enterprise CUIx here but the way it sounds he doesn't have access to modify the CUI file (maybe they have the same setup?) so the next step is to

A) Figure out why, maybe its a bad routine? Not vetted?
B) If he absolutely needs that routine the next best step is to add it to his start-up suite.

So long as the Enterprise CUIx is not read-only, this may be of use.

I could not disagree with you more on point B - demand loading, anyone? :angel:
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10652
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #9 on: July 31, 2015, 10:39:42 AM »
Make your own CUIx file.

Yes, BB it does but I loaded all my "support" functions into the MNL file and anything else I used embeded. ...of course I also rolled my own loader which was in the MNL file so I never used the embeded lisps that much either so take that with a grain of salt.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10652
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #10 on: July 31, 2015, 10:42:13 AM »
Would you mind sending me that lisp from RRB, BlackBox (I'm not a member there).

Also, Is RRB still active? What's he up to these days?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ChrisCarlson

  • Guest
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #11 on: July 31, 2015, 10:59:40 AM »
Make your own CUIx file.

Yes, BB it does but I loaded all my "support" functions into the MNL file and anything else I used embeded. ...of course I also rolled my own loader which was in the MNL file so I never used the embeded lisps that much either so take that with a grain of salt.

Why make a new CUIx file simply for loading of local, per-user lisp routines? You can definitely do that but Confucius says "don't use a cannon to kill a mosquito".

andrew..

  • Newt
  • Posts: 24
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #12 on: July 31, 2015, 12:03:40 PM »
its custom block commands and ddedit and a few other general all purpose custom commands but for my custom wblock command i undefind the OOTB block command and the ddedit command and so on.
ill look into the startup suite and the mnl and determine what is easiest

if any other ideas come to mind, please post them

thanks again

andrew..

  • Newt
  • Posts: 24
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #13 on: July 31, 2015, 12:07:09 PM »
Make your own CUIx file.

Yes, BB it does but I loaded all my "support" functions into the MNL file and anything else I used embeded. ...of course I also rolled my own loader which was in the MNL file so I never used the embeded lisps that much either so take that with a grain of salt.
i was able to load my own menu with no issues. its the acad and the acaddoc lisp files that i need access to.
or a way to load my own code on startup

ronjonp

  • Needs a day job
  • Posts: 7529
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #14 on: July 31, 2015, 12:10:02 PM »
If you can load your own menu, I'd suggest the mnl route. There are plenty of example routines here for loading files from a directory.
« Last Edit: July 31, 2015, 12:14:08 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #15 on: July 31, 2015, 12:20:33 PM »
Make your own CUIx file.

Yes, BB it does but I loaded all my "support" functions into the MNL file and anything else I used embeded. ...of course I also rolled my own loader which was in the MNL file so I never used the embeded lisps that much either so take that with a grain of salt.

Why make a new CUIx file simply for loading of local, per-user lisp routines? You can definitely do that but Confucius says "don't use a cannon to kill a mosquito".

One of the major drawbacks of the Startup Suite is loads for every AutoCAD profile.  You don't necessarily want everything loading everywhere, especially if you have potentially conflicting functions for third-party applications in each profile.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Lee Mac

  • Seagull
  • Posts: 12916
  • London, England
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #16 on: July 31, 2015, 12:59:00 PM »
People still load their routines into those files? Why not load through the startup suite which is not admin controlleD?

Aside from the fact that the Startup Suite is historically known to be notoriously buggy, there are several other advantages to using files such as the acaddoc.lsp to load customisations, such as distributing/updating customisations for multiple users simultaneously across a network, using project-specific acaddoc.lsp files residing in a project directory to only load customisations required by a project (since AutoCAD will only ever load one acaddoc.lsp file, and will always look in the working directory first) etc.

BlackBox

  • King Gator
  • Posts: 3770
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #17 on: July 31, 2015, 01:42:59 PM »
Would you mind sending me that lisp from RRB, BlackBox (I'm not a member there).

Source code from RRB's post directly copied here:
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2.  
  3. Edit Enterprise CUI.lsp
  4.  
  5. Version history
  6. 1.1     2009/06/09      Added support for CUIX files.
  7. 1.0     2007/12/07      Initial release.
  8.  
  9. Switches the enterprise CUI into the main CUI under Preferences, Files, Customization Files.
  10. Allows for editing, then switches the CUI files back to the original settings.
  11.  
  12. Dependencies:   none
  13. Usage:          Command: EditEnterprise, or Command: EC
  14. Arguments:      n/a
  15. Returns:        n/a
  16.  
  17. Copyright © 2007-2009 by Sparling, Inc.
  18.  
  19. Written permission must be obtained to copy, modify, and distribute this software.
  20. Permission to use this software for any purpose and without fee is hereby granted,
  21. provided that the above copyright notice appears in all copies and that both
  22. the copyright notice and the limited warranty and restricted rights notice below
  23. appear in all supporting documentation.
  24.  
  25. SPARLING PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
  26. SPARLING SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
  27. MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
  28. SPARLING DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM
  29. WILL BE UNINTERRUPTED OR ERROR FREE.
  30.  
  31. |;
  32.  
  33. (defun sinc:UpdateCUIs  (mainCUI entCUI)
  34.  (cond ((and entCUI (findfile mainCUI) (findfile entCUI))
  35.         (vla-Put-MenuFile
  36.          mainCUI)
  37.         (setenv "EnterpriseMenuFile" entCUI)
  38.         (command "._Menu" "")
  39.         'T)
  40.        ((and (not entCUI) (findfile mainCUI))
  41.         (setenv "EnterpriseMenuFile" "")
  42.         (vla-Put-MenuFile
  43.          mainCUI)
  44.         (command "._Menu" "")
  45.         'T)
  46.        ((princ "\nOne (or both) of the cui files was not found."))))
  47.  
  48. (defun C:EC () (C:EditEnterprise))
  49.  
  50. (defun C:EditEnterprise  (/ wsNow fileExt mainNow entNow)
  51.  (setq wsNow   (getvar "WSCurrent")
  52.        fileExt (cond ((< (atoi (getvar 'AcadVer)) 18) ".cui")
  53.                      (".cuix"))
  54.        mainNow (strcat (vla-Get-MenuFile
  55.                         (vla-Get-Files (vla-Get-Preferences (vlax-Get-Acad-Object))))
  56.                        fileExt)
  57.        entNow  (strcat (getenv "EnterpriseMenuFile") fileExt))
  58.  (cond ((sinc:UpdateCUIs entNow nil)
  59.         (command "._CUI")
  60.         (sinc:UpdateCUIs mainNow entNow)))
  61.  (cond ((/= wsNow "") (setvar "WSCurrent" wsNow)))
  62.  (princ))
  63.  



Also, Is RRB still active? What's he up to these days?

He may not be active in the forums, but he is the current AUGI President.



... You can definitely do that but Confucius says "don't use a cannon to kill a mosquito".

Sun Tzu teaches to engage the enemy with overwhelming force, if victory is your goal.



Aside from the fact that the Startup Suite is historically known to be notoriously buggy, there are several other advantages to using files such as the acaddoc.lsp to load customisations, such as distributing/updating customisations for multiple users simultaneously across a network, using project-specific acaddoc.lsp files residing in a project directory to only load customisations required by a project (since AutoCAD will only ever load one acaddoc.lsp file, and will always look in the working directory first) etc.

1+

I employ a .NET app to 'blacklist' any auto-loading Acad* code files found to be accessible (that are not our own) before the startup sequence attempts to load them, but to support project-specific code, we load a custom named, relative-path LISP, only if found within a given project... which all helps to mitigate potential 'infections' (which have happened in the past).
"How we think determines what we do, and what we do determines what we get."

andrew..

  • Newt
  • Posts: 24
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #18 on: August 03, 2015, 07:57:32 AM »
ok now that i got that straight.. how about loading a separate acad.pgp file?
will acad load 2 different acad.pgp files?
if not any way to get another .pgp file to load up?


Crank

  • Water Moccasin
  • Posts: 1503
Re: cant edit acad.lsp or acaddoc.lsp
« Reply #19 on: August 03, 2015, 01:24:43 PM »
[...]
if not any way to get another .pgp file to load up?
The support paths are searched in the order as they are placed in the OPTIONS panel. So put your .PGP file in the first folder of that list (or change the order of the list).
Vault Professional 2023     +     AEC Collection