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

0 Members and 1 Guest are viewing this topic.

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