EntDraught Posted August 25, 2023 Posted August 25, 2023 (edited) I'm creating a lisp routine to fix some problems within a portion of our designs. I open the affected files, have the routine do some cleanup, it then exports the DWG to DXF and opens the DXF so a 2nd lisp routine can be ran. Problem is when the DXF file is opened it does not recognize ANY lisp routines even though they are in the startup suite. You have to either APPLOAD it back in or close Autocad and reopen the file. I've tried a number of things from the internet and a couple different ways of opening the file (vla-open & FILEOPEN) hoping it was just the method I was using to open the newly created file. In the startup suite dialogue it shows the lisp files greyed out. I know there is a problem if you try to open a new file and have the lisp routine try to continue where it left off and I hope to eventually make just one routine to do everything so it's not a two step process but right now as a workaround I have two separate lisp routines the very last command for the first part is the FILEOPEN command, the only thing that follows is the last ')' to end the command but I have a feeling my problem lies therein. Any help is appreciated! Edited August 25, 2023 by EntDraught Quote
mhupp Posted August 25, 2023 Posted August 25, 2023 Need to add them to the startup suite in appload. https://www.youtube.com/watch?v=srVnbz2eRSU Quote
BIGAL Posted August 26, 2023 Posted August 26, 2023 (edited) If your opening another dwg or dxf the current lisp is abandoned you need to use a script. Are you doing that ? "opens the DXF so a 2nd lisp routine can be ran." Else add like (load "Multi Getvals.lsp") load the program required. Just a side note never had a problem with programs in the Startup Suite. Edited August 26, 2023 by BIGAL Quote
SLW210 Posted August 26, 2023 Posted August 26, 2023 You should try a Script as mentioned, a batch routine or VBA might be needed or at least better. Several examples on the internet. You may need to close the drawing and reopen again if possible, you can test manually if that will work. Maybe try clearing the Startup Suite and load the LISPs at the start of the routine. I use ACAD.lsp and ACADDOC.lsp for LISP loading (you can use Autoload to load as needed) or just manually load as needed for those I rarely need. In some instances you need to add the function at the end of the routine when going to a new drawing IIRC, i.e. (defun myroutine ()..... at the end of function myroutine, add: (C:myroutine). Maybe check for a problem LISP Routines Not Working I am not sure what else is in your code, as you haven't posted anything and I am far from a LISP expert, though recently been working up my skills. When I am at work Monday, I'll post a VBA Script program, it runs on a folder(s) of drawings IIRC, if you are interested. Quote
SLW210 Posted August 26, 2023 Posted August 26, 2023 With a quick search I found THIS on CADTutor. See Lee Macs post. Quote
EntDraught Posted August 28, 2023 Author Posted August 28, 2023 Sounds like I need to do some reading up on scripts. I've never used one before. 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.