ammobake Posted January 25, 2021 Posted January 25, 2021 My boss has set up a folder on our server with all of his old LISP routines. He wants me to see about getting them working for him. He tells me that he can't get them to work properly. Methinks the folder has to be added to trusted locations first in Autocad settings - am I correct in assuming that? What other steps are there, if any? Any help is appreciated. Thanks! -ChriS Quote
ammobake Posted January 25, 2021 Author Posted January 25, 2021 Since many of these LISP routines are years old - 1998 and earlier - my guess is that LISPSYS variable would need to be set to zero to allow for the older LISP stuff to run properly. LISPSYS of "0" results in... Visual LISP IDE (VL IDE) is set as the default editor, however AutoLISP functions don't fully support Unicode characters. AutoLISP source (LSP) files when saved and compiled use the ASCII (MBCS) character set. Note: This setting results in the behavior of AutoCAD 2020 and earlier releases, and is supported on Windows only. -ChriS Quote
BIGAL Posted January 26, 2021 Posted January 26, 2021 (edited) Put all your lisps in one directory and Yes add it as a support path and add it as a trusted path else message will appear each time loaded. For me any lisps to be preloaded I use the Appload "Start up suite" rather than adding to acaddoc.lsp etc. So long as you startups don't require user input you can have 1 lisp file with multiple stuff in it. If running all locally the way I am tackling this now is to use a Bundle approach, make a zip, unzip to correct folder on new pc and all ready to go very easy. The lisps may need a preloaded lisp to run I have a 3 library lisps that load. Try loading 1 using appload and see what errors occur post here if you can not figure it out. Look inside for missing defuns, use CMD FINDSTR to find the lisps with the missing defuns. CMD bottom left in windows Cd d:\lisps Findstr rtd *.lsp Edited January 26, 2021 by BIGAL Quote
Steven P Posted January 28, 2021 Posted January 28, 2021 Another option which might take a bit longer, if you know what they do there might be a (more up to date) LISP doing the same thing out there somewhere, swap them over which might take away some of the problems Might be that the boss had a LISP in the start up suit that he has forgotten was in there, which is necessary for them to run. I also use this to load / reload LISPS from a directory, change the file path to where your LISPS are, and run this and it should load everything in that folder (defun c:appreload ( / mylispfolder mylispfiles myfiles acount Failedtoload) (setq mylispfolder "--YOUR FOLDER HERE-- DON't FORGET TO USE \\ IN THE FILE PATH") (setq mylispfiles (vl-directory-files mylispfolder "*.lsp" nil)) ;;list of files in mylispfolder location. (setq myfiles (vl-directory-files mylispfolder "*.lsp" nil)) ;;myfiles is list of files in mylispfolder location (setq acount -1) (repeat (length myfiles) (setq acount (1+ acount)) (setq FailedtoLoad (strcat (nth acount myfiles) " failed to load")) (load (strcat mylispfolder (nth acount myfiles)) FailedtoLoad) ;;Loads each LISP file ) (princ) ) Quote
ammobake Posted January 28, 2021 Author Posted January 28, 2021 So he had a ton of lisp routines that were in an old folder he had at home from a previous employer. He had been trying to get them to work in Autocad 2021 but he couldn't get them to work so asked for some help. my hunch is there are a few reasons for this. The older LISP stuff wouldn't necessarily work without having variable LISPSYS of "0" so that the commands result in the behavior of earlier releases. But I'm not sure he understands how to tweak acad paths in the settings. I am going to attach in 2 separate folders here for you guys to check out.. But have no idea what these LISP routines are or what they're for. The overall file size was 16MB but it included a block library that was erroneous/unrelated. the LISP routines are generally from the timeframe 1992-1999 If anyone wants to go digging through history... lol. -ChriS LISP_attach1.zip Quote
ammobake Posted January 28, 2021 Author Posted January 28, 2021 (edited) Well, it wont' let me upload the other folder due to the file size restrictions. But you get the idea. These files from 1992 are the real deal which is pretty impressive. Definitely the oldest I've seen. LISP is the second oldest high level programming language in widespread use today - originally from 1958 I guess. -ChriS Edited January 28, 2021 by ammobake Quote
BIGAL Posted January 28, 2021 Posted January 28, 2021 Wow 381 lisps. Unfortunately when one does not work just have to look in side and see if its calling other external defuns, the obvious is rtd dtr. If one fails and you solve, it will be fix for others. For me use CMD level findstr, My 1st guess look at acad*****.lsp there are a few. Quote
ammobake Posted February 9, 2021 Author Posted February 9, 2021 I was only able to post about half of them - there are more. What is interesting to me is that the LISP library is pretty extensive but many of them were developed to be solutions to problems that Autocad couldn't easily do in the 90's - but can now with a single command. But is interesting to see I guess. -ChriS Quote
BIGAL Posted February 9, 2021 Posted February 9, 2021 There may be a way to find crash point, one of the old DOS commands is copy file1+file2 newfile so file2 is your lisp all 381 files. Do this on 230+ files re licencing. File1 is an error routine which has say an (alert "Lisp xyz failed") in it, revealing where it stopped. Obviously if you have a error routine you need to add it inside. Could just add exactly that to every routine so it will stop and display what is running. As lisp is a text file could create a list of all lisp names and write 1st line to a new file then copy all other lines in the lisp to the new file using filename in alert. There is what commands are running (setq afList (atoms-family 1)) vlsort it maybe remove the VL commands and any others that are obvious keep the c : defuns throw into excel etc each crash compare a column in excel should reveal what defuns have been loaded, then use findstr. Quote
ammobake Posted February 9, 2021 Author Posted February 9, 2021 (edited) now that I see what the LISP routines consist of I'm gonna bring it to my boss and see what he really wants to do. Just the stuff in Autocad's tool pallete alone can do like 1/3 of these functions with just a couple clicks. Annotation symbols, north arrows, etc... I'm not sure it will be a good use of time to get all of these working when in almost all cases Autocad now has built-in features to do those same very things. Some of the LISP routines also seem to require or reference DWG files that my boss doesn't have anymore. They had LISP routines to change layer color of a selection set but we can now do this all at once in properties or layer manager. They had a LISP to connect the ends of lines but we now have a more functional JOIN command that works with polylines and other entitites too. Like the list just goes on - which isn't surprising I guess since these LISP routines go back to 1991 or something. There are like 6 LISP routines for different hatch functions but we now have the hatch manager to make the hatch function a more dynamic as-you-go process so those are also obsolete. But it is interesting to see how they problem solved back then using AutoLISP to make shortcuts and do things Autocad couldn't easily do by itself in the early/mid 1990's. -ChriS Edited February 9, 2021 by ammobake Quote
BIGAL Posted February 9, 2021 Posted February 9, 2021 Look at Mline we wrote a 4 line routine in say 1991. Quote
Recommended Posts
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.