Jump to content

Deploying company LISP, autoload and other questions


guitarguy1685

Recommended Posts

I was watching this presentation on AU about deploying AutoLisp.

 

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/classes/year-2015/autocad/it9952#chapter=0

 

This made me question a few things because I'm going to be deploying company autoLisps. The one that interested me most was "autoload". He mentioned if you have several lisps to load it could increase your drawing load time. He mentioned using the autoload function to to load lisps as they are called.

 

anyone have experience with doing this? what do you do with sub-routines shared by several lisps?

 

I'm currently planning on using the *.mnl file extension to load the company lisps with the CUI. Can I just fill that *.mnl file with autoload lines that point to the actual lisp?

 

Also, should I still have just one lisp with all programs or should I break them down into individual program.lsp files? Again, what would I do with subroutines? I don't like the idea of having copies of sub-routines in different lisp files.[

 

Thanks ahead of time for your input

Link to comment
Share on other sites

There is various ways of loading lisps as and when required, ours are individual for the most makes debugging and modifying easier to test, but common ones are in a library. Not sure why you load all your lisps via a mnl rather than just demand load or as per examples below. If we have a lisp that we dont use often its not loaded, its loaded via the menu. We have our library lisp totally seperate from Acaddoc.lsp etc

 

In our library lisp we have multiple "Autoload" lines, to quote Autodesk

"AutoLISP file to be loaded when one of the commands defined by the cmdlist argument is entered at the Command prompt."

 

I have moved more to deman loading for common "library" type lisps so even those are not preloaded.

; demand load if defun not loaded
; put somewhere near start of lisp, use in any program
; this example AH:getval2 not found so load lisp before continuing
; getvals3 is a multiple dcl entry dialouge
(if (not AH:getval2) (load "getvals3"))

 

Autoload example these are in a lisp we call autoload.lsp there is 36 currently.

(autoload "COPY0" '("COPY0"))
(autoload "COPYCOMMAND" '("ZZZ"))
(autoload "COVER" '("COVER"))
(autoload "p2p" '("p2p"))
(autoload "DRAWXFALL" '("DRAWXFALL"))
(autoload "DRAWPIPE" '("DRAWPIPE"))

 

menu code

[->LISP1 A-B]
            [1/4 POINTS]^C^C(LOAD "1-4 POINTS")
            [Add 2 Level]^C^C(LOAD "add-to-levels")
            [Add-pits-drain]^C^C(LOAD"Add-pits-drain")
            [Allbylayer]^C^C(LOAD "Allbylayer")
.........

Link to comment
Share on other sites

So if a routine has sub-routines you still just keep them within their individual files?

Link to comment
Share on other sites

Not sure why you load all your lisps via a mnl rather than just demand load or as per examples below.

 

I use the MNL file because it will load with the CUI that is on the network automatically. This way if I change the mnl file on the server it will update on every ones computers automatically.

 

I haven't tried it yet, but I'd like to just use autoload to demand load the lisps.

 

If I use acaddoc.lsp how do I add new functions? Do I have to go around every ones computer and update the acaddoc.lsp file?

Link to comment
Share on other sites

I assume you could network the acaddoc.lsp, but all users would need to add this location to their support path.

Link to comment
Share on other sites

I use the MNL file because it will load with the CUI that is on the network automatically. This way if I change the mnl file on the server it will update on every ones computers automatically.

 

I haven't tried it yet, but I'd like to just use autoload to demand load the lisps.

 

If I use acaddoc.lsp how do I add new functions? Do I have to go around every ones computer and update the acaddoc.lsp file?

 

The advantage of using the mnl is that allows uses to have an acaddoc.lsp for custom lisp or setting for themselves. AutoCAD only loads the first acad.lsp, acaddoc.lsp, & acad.rx files it finds.

Link to comment
Share on other sites

 

Autoload example these are in a lisp we call autoload.lsp there is 36 currently.

(autoload "COPY0" '("COPY0"))
(autoload "COPYCOMMAND" '("ZZZ"))
(autoload "COVER" '("COVER"))
(autoload "p2p" '("p2p"))
(autoload "DRAWXFALL" '("DRAWXFALL"))
(autoload "DRAWPIPE" '("DRAWPIPE"))

 

I've been trying to get autoload to work. It seems as thought I'm not allowed to use a path with the lisp file name, i.e. "L:\\CAD\\CUI\\LISPS\\mylisp.lsp". when I try it get this error

 

he file LCADCUILISPSmylisps.lsp(.lsp/.exe/.arx) was not found in your search path folders.

Check the installation of the support files and try again.nil

 

It looks like I must have the lisp folder in my support path. Is this correct that I can not use a relative path?

Link to comment
Share on other sites

From the link I posted above:

 

Note: Starting with AutoCAD 2014-based products, custom applications must work under secure mode; when the SECURELOAD system variable is set to 1 or 2. When operating under secure mode, the program is restricted to loading and executing files that contain code from trusted locations; trusted locations are specified by the TRUSTEDPATHS system variable.

 

I recommend keeping it all in one folder and include it in both the Support File Support Path as well as Trusted Locations to both keep your office safe and make loading your files easier. No need to include paths when you set it up like this.

Link to comment
Share on other sites

A little secret try your support path like this L:\cad.. note the double dot .. it means include lower down directories in search path, you dont need to add them all then.

 

We run a network server arrangement we have default cui's plus our menuloded cuix from the server. So if we change the server mnu "source code" I menuload it, then it makes a new Cuix on the server the next time anyone else opens their Autocad the new menu is autoloaded with no user interaction so they are always up to date.

 

All our lisps are on the server in one directory. Re defuns if its something used by multiple lisps then its made a library lisp ie use the if not to load, if its a defun written specifically for a task it lives in the correct lisp not outside, again this lisp may call library routines as well.

Link to comment
Share on other sites

I got one lisp in my AppLoad startup suit. Within that lisp i load all other lispfiles. Easy to keep the overview. And only have to add only file to all peoples autocad instal.

Link to comment
Share on other sites

A little secret try your support path like this L:\cad.. note the double dot .. it means include lower down directories in search path, you dont need to add them all then.

 

We run a network server arrangement we have default cui's plus our menuloded cuix from the server. So if we change the server mnu "source code" I menuload it, then it makes a new Cuix on the server the next time anyone else opens their Autocad the new menu is autoloaded with no user interaction so they are always up to date.

 

All our lisps are on the server in one directory. Re defuns if its something used by multiple lisps then its made a library lisp ie use the if not to load, if its a defun written specifically for a task it lives in the correct lisp not outside, again this lisp may call library routines as well.

 

I couldn't get the double dot trick to work. I set my support path the "L:\Engineering\CAD.." ( also tried "L:\Engineering\CAD\..") but no success.

 

As for the menus. do you have multiple cuix files partially loaded to the acad main cui? Or do you have them all set up in an enterprise cui?

 

I am planning on setting up a signel cuix file as our Enterprise cui with all of our menus. The issue I may have is edditing the menus. As I see it has to go down lilke this

 

1. I update the MNU files

2. I have to set the Enterprise CUi and the main so I can edit it.

3. I have to delete the menus from the enterprise cui

4. I have to transfer the updated menus to the main cui

 

I not sure that is the best way to go about that. I like your idea of menuloading the menu to create a new cui.

Link to comment
Share on other sites

We do have multiple cuix files loaded to the main menu, its just part of the open Autocad that it reloads the cuix on startup. At times we make a change to a mnu etc via a request and its normally just a menu-unload and reload for them so they can help the testing. The others get it when they next open Autocad. Is it the right way not sure but it works and makes the next 2018 install/customise pretty easy. I menuload the mnu to make it to a cuix but the users just have the cuix loaded.

 

Last comment I have some personal cuix so they are loaded from my c: drive as well.

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