Jump to content

When opening a file from within LISP new file does not have access to startup suite lisps


Recommended Posts

Posted (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 by EntDraught
Posted (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 by BIGAL
Posted

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.

Posted

Sounds like I need to do some reading up on scripts. I've never used one before.

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