Jump to content

Load lisp in Startup suite via lisp


OMEGA-ThundeR

Recommended Posts

Hello,

 

i'm trying to create an lisp so that on new installations of AutoCAD all the settings, variables and filelocations are set and loaded in one step.

 

i'm trying to reverse engineer my current profile (.arg file) but i guess there is no 'setenv' for the lisp that are set in the startup suite.

 

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.1\ACAD-D001:409\Profiles\OMEGA-ThundeR\Dialogs\Appload\Startup]
"NumStartup"="2"
"1Startup"="C:\\folder\\Lisp\\Lisp 1.lsp"
"2Startup"="C:\\folder\\Lisp\\Lisp 2.lsp"

 

Above the part that lists the lisp that are in my current Startup suite.

 

 

TLDR; Is there a (simple) way to set lisp routines in the Startup Suite via lisp?

 

Something like:

 

(setenv "StartupSuite" "C:\\folder\\Lisp\\Lisp 1.lsp")

 

But any code that works is fine by me :).

Link to comment
Share on other sites

TLDR; Is there a (simple) way to set lisp routines in the Startup Suite via lisp?

 

Avoid the Startup Suite altogether - use the acaddoc.lsp instead (see Method 2 of my tutorial here).

 

Note: if the acaddoc.lsp file does not exist in your AutoCAD Support Path, you can create this file as you would any other AutoLISP file. Do not modify the acad20##.lsp or acad20##doc.lsp, as these are reserved for use by AutoCAD.

 

To check whether an acaddoc.lsp file already exists, open AutoCAD to a new drawing and type at the command-line:

(findfile "acaddoc.lsp")

If the above returns nil, AutoCAD cannot find any files with the filename acaddoc.lsp in any Support File Search Paths or the working directory.

Link to comment
Share on other sites

I found that page too. But i want to make it user friendly. Open Autocad, load one lisp and that lisp does all the work for them.

 

Besides, that would also mean i have to make ACADDOC.lsp lisp that contains all the AUTOLOAD commands. Its to much work for the amount of lisp routines i made

 

We don't use much lisp routine (its one file with dozens of handy commands), and there are no heavy programs in the standard loaded lisp routines that would cause any problems.

 

 

So i just want to know how i can get an lisp routine in the startup suite via a command or variable that can be loaded via an lisp.

Link to comment
Share on other sites

I found that page too. But i want to make it user friendly. Open Autocad, load one lisp and that lisp does all the work for them.

 

There is no difference in the user-friendliness of your requested solution to that which I am suggesting - you are requesting that the user run a program to configure the Startup Suite, whereas my solution simply involves running a program to configure the support paths & trusted paths so that AutoCAD can find the acaddoc.lsp.

 

Besides, that would also mean i have to make ACADDOC.lsp lisp that contains all the AUTOLOAD commands. Its to much work for the amount of lisp routines i made

 

No you don't, you can use the AutoLISP load function as described on that page.

 

We don't use much lisp routine (its one file with dozens of handy commands), and there are no heavy programs in the standard loaded lisp routines that would cause any problems.

 

Even easier, you can use a single load expression to load this one file.

 

So i just want to know how i can get an lisp routine in the startup suite via a command or variable that can be loaded via an lisp.

 

The Startup Suite cannot be automated via LISP.

Link to comment
Share on other sites

It's probably something the same as 'hanhphuc', but i made an registery file to add the lisp to the Startup Suite

 

File.reg (for Autocad 2015)

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R20.0\ACAD-E001:409\Profiles\<<Unnamed Profile>>\Dialogs\Appload\Startup]
"1Startup"="C:\\Folder\\Lisp\\Lisp.lsp"
"NumStartup"="1"

 

And added the Trusted Path via the installation lisp.

 

Install.lsp

(command "TRUSTEDPATHS" "C:\\Folder\\Lisp")

(setq program "C:\\Windows\\regedit.exe"
 filename "\42C:\\folder\\File.reg\42")

(startapp program filename)
(princ)

 

Works like a charm (for me).

 

i'm no advanced user of lisp so i try to keep it basic.

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