Jump to content

Recommended Posts

Posted
5 hours ago, GLAVCVS said:

Can anyone else on this forum say that the same thing is happening to them?

I have ACADLSPASDOC=0.
I have another question:
Is it possible to use your code as a separate reactor without adding it to the acad20##.lsp file?

Posted
23 minutes ago, Nikon said:

I have ACADLSPASDOC=0.
I have another question:
Is it possible to use your code as a separate reactor without adding it to the acad20##.lsp file?

 

The code needs to be loaded before any other code you need to memorize.
For this reason, saving it at the beginning of the "acad2021.lsp" file allows the code to control other programs loaded later from the same "acad2021.lsp" or "acad2021Doc.lsp."
If you load it after other files, it will discard any previously loaded Lisp commands and only consider those loaded later.
Therefore, yes, you can save it in a separate file and load it whenever you need, but you must be aware of this condition.

Are you willing to accept it?

  • Thanks 1
Posted
6 hours ago, Lee Mac said:

 

The acad20##.lsp and acad20##doc.lsp files should not be modified - these are reserved for the application. Instead, you should create your own acad.lsp and acaddoc.lsp files.

 

Note that, by default, acad.lsp will be loaded once per session, and acaddoc.lsp will be loaded per document (unless ACADLSPASDOC=1, in which case acad.lsp will also be loaded per document).

 

To settle this matter I must say yes: it is better to write the code in "acad.lsp" provided that there is not already custom lisp code in "acad####.lsp" or "acad####DOC.lsp", because if so, that code would escape the control of the "fota" function.
I must say that I have the bad habit of writing code both in "acad####.lsp" and in "acad####DOC.lsp".
Simply as a matter of economy.

Lastly, the "ACADLSPASDOC" variable affects only "acad.lsp" but not "acad####.lsp", as it might seem

  • Thanks 1
Posted

Did he say earlier to only record commands that the user initiates rather than any automatically running on opening a drawing? In which case maybe save it in a file "ZZZ.LSP" or something similar so it is loaded last (Assuming here that custom LISP files load alphabetically this will load last - I am not sure if they do or not though), and put the file in the trusted files location.

Posted
2 hours ago, Nikon said:

I can't understand why your code (defun init ( )... it doesn't work for me. 
Is there a problem with the localization of Autocad?
Do I need to change this line?:

 ( (not (wcmatch (setq arg (strcase (car arg))) "SAVE,QSAVE,SAVEAS")))

to

 ( (not (wcmatch (setq arg (strcase (car arg))) "SAVE,QSAVE,SAVEAS,_SAVE,_QSAVE,_SAVEAS")))

Or something else?
Can anyone check the code?

 

Are you issuing some LISP commands during the session before saving?

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