Jump to content

Lisp routine fails to load


Cad64

Recommended Posts

Hey guys, I have a bit of an issue that I can't seem to figure out. I have a few lisp routines like the one attached which I have been using for years. I have them saved in the AppData/Roaming/Autodesk/ApplicationPlugins folder and I have the path set up in my acaddoc.lsp file, so the routines load automatically when I open a drawing. This has always worked fine, with no problems, until I started using Autocad 2018. Now these routines will not load automatically.

 

Other lisp routines, saved to the same location, load from the acaddoc file and work fine, but the routines like the one attached, which have a bunch of command calls inside, will not load automatically. However, they will load and run fine if I manually load them. They just won't load automatically. Is there some reason for this? Do I need to add something to the routine? Any help would much appreciated.

 

Thanks

 

Zoomlisp.lsp

Link to comment
Share on other sites

don't have 2018 but have you tried :

 

https://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-421B36DE-38EA-4161-9768-01647B5492E8

 

Remarks

Important: 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.
 
and also :
or :
Edited by rlx
Link to comment
Share on other sites

Thanks for the reply.

 

I have secureload set to 0, but all the other lisp routines that I call from the acaddoc file load fine. It's only the ones like the one I attached that won't load. I tried changing secureload to 1 but the routines still don't load. Also, the ApplicationPlugins folder is supposed to be a Trusted Folder, so I shouldn't have to set permissions for it.

 

I have also tried using the startup suite, but these particular routines won't load automatically. I can only load them manually. I'm not really sure what the problem is, they worked fine in 2014 which is supposedly when all this secureload stuff started.

 

I guess I'll just have to load them manually when I want to use them, which is basically every drawing I work on. 🙄

 

Thanks

Link to comment
Share on other sites

56 minutes ago, Cad64 said:

I have them saved in the AppData/Roaming/Autodesk/ApplicationPlugins folder 

Hi,

You may have the link broken with your Plugins folder, so Open AutoCAD then Options -> Files tab -> Support File Search Path then add that path if its already added to the list.

Hope this helps.

Link to comment
Share on other sites

10 minutes ago, Cad64 said:

Thanks for the reply.

 

I have secureload set to 0, but all the other lisp routines that I call from the acaddoc file load fine. It's only the ones like the one I attached that won't load. I tried changing secureload to 1 but the routines still don't load. Also, the ApplicationPlugins folder is supposed to be a Trusted Folder, so I shouldn't have to set permissions for it.

 

I have also tried using the startup suite, but these particular routines won't load automatically. I can only load them manually. I'm not really sure what the problem is, they worked fine in 2014 which is supposedly when all this secureload stuff started.

 

I guess I'll just have to load them manually when I want to use them, which is basically every drawing I work on. 🙄

 

Thanks

I have my own lisp folder , c:/temp/lisp and put it on top in my support path and also have my own acad.lsp which load a few routines in the startup. Most routines are loaded though on demand from one of my toolbars in the old way (if (not (c:mylisp))(load "mylisp"))... etc. This way I have the least problems when autocad is re-installed or other stuff IT hits me with.

Link to comment
Share on other sites

Thanks Tharwat but that didn't help. The file path wasn't there, so I added it, but the routines still don't load. Other routines, saved to the same location, load fine. It's just a couple that won't load. They only work if I load them manually.

 

Thanks

Link to comment
Share on other sites

Yes, I tried adding it to the startup suite but it still won't load.

 

I also tried rlx's suggestion about pointing my acaddoc file to my lisp folder instead of the Plugins folder, but it still won't load.

 

This is very frustrating. All other lisp files load fine. I can't understand why this routine won't load?

 

Thanks for all the suggestions.

Link to comment
Share on other sites

I can't see anything wrong with the routine a first glance. Maybe commands are evaluated upon load? Try command-s instead of just command? Are other routines still loading from this location and is it just this one? Try ".zoom". Put (princ "\nzoom lisp loaded") as last line. Maybe it is loaded but commands are redefined later?

Edited by rlx
Link to comment
Share on other sites

Yes, all other routines are loading from this location. The only one that is not loading is this one.

 

If I manually load it from the APPLOAD dialog, it loads and everything works fine. It just won't load automatically with the startup suite or through my acaddoc file. It's very strange.

Link to comment
Share on other sites

Yeah really strange.

You may try to Repair the program from Control Panel -> uninstall -> Repair and this process would go back with your AutoCAD to the original installation which means you would need to readjust AutoCAD if you have your own customization like menu, toolbars ... etc other than the default one.

Link to comment
Share on other sites

11 minutes ago, Tharwat said:

Yeah really strange.

You may try to Repair the program from Control Panel -> uninstall -> Repair

 

I don't really want to go that far, just because one lisp routine won't load.

Maybe I'll try fooling around with it more later on but I need to get back to work now.

 

Thanks for all the suggestions guys.

Link to comment
Share on other sites

Tried it in 2017 and added (princ"\nzoomlisp loaded") as very last line and added file to startup suite and it works fine. You could try remove the second "" from c:ZR because that gave me
Command: ZR
Unknown command "ZR".  Press F1 for help.

indecating it has one enter to many. Since autocad xx whatever some commands are evaluated a little different and that's when they gave us command-s. To be able to test commands before they are executed.

 

Other (probably stupid) way around might be something like


  (defun whatever ()

    (defun c:ZW()....)

    (defun c:ZE()....)

    (defun.... etc)

  );end defun whatever

; last line in whatever.lsp so it executes automaticaly when loaded

(whatever)

 

Pitty I haven't got 2018 so I can't find out what is happening

Edited by rlx
Link to comment
Share on other sites

47 minutes ago, rlx said:

Tried it in 2017 and added (princ"\nzoomlisp loaded") as very last line and added file to startup suite and it works fine. You could try remove the second "" from c:ZR

 

I added the princ as the last line and removed the 2nd "" from ZR but it's still not loading from startup suite or acaddoc. This is driving me crazy! 😖

Link to comment
Share on other sites

11 minutes ago, Cad64 said:

 

I added the princ as the last line and removed the 2nd "" from ZR but it's still not loading from startup suite or acaddoc. This is driving me crazy! 😖

 

IT (helpdesk from my work) is currently driving me crazy haha.

But so you have a couple of lisp files that are auto-loaded successfully. Remove your zoomlisp from any autoload and add just one of your little zoom defuns to one of those files and see what happens... if that works , add the next...

Edited by rlx
  • Thanks 1
Link to comment
Share on other sites

1 minute ago, rlx said:

IT is currently driving me crazy haha.

But so you have a couple of lisp files that are auto-loaded successfully. Remove your zoomlisp from any autoload and add just one of your little zoom defuns to one of those files and see what happens... if that works , add the next...

 

That's a good idea. I'll try playing around with it later when I have some time.

 

Thanks for the help.

Link to comment
Share on other sites

My $0.05 we have all our lisps on a server and at home in a directory it was just a case of adding the paths and importantly adding trusted paths and it all works for 2016 2018 2019. We do have the file called Autoload.lsp not sure if that makes any difference. On a brand new box just run a lisp that sets all support paths and trusted paths so does in one go. Just find it easier to seperate our and my stuff from Autocad paths. I have not had to add any Command-s to any routines. 

 

I had a similar problem with a toolbar menu and reading end of line in the mnu file.

Link to comment
Share on other sites

  • 2 years later...

Hi!

I have a take on this if it's not been resolved yet..

Had the same problem now, and I found that changing the name of the lisp that got the error solved the problem.

 

Name that malfunctioned "CreateLayer_Z_2D.lsp"

Name that worked "CreateLayer_Z.lsp"

 

Hope it helps.

 

/Simon

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