Jump to content

Recommended Posts

Posted
On 10/17/2023 at 9:56 PM, Steven P said:

Yes, rename it as you want, Macro01 will work as well as anything else. The c before the lisp name just lets it be used in the command line (could rename it c:Macro01).

It should work if you put this line at the end of the code - after the last bracket, )

(Macro01)

 

So the LISP file will load into CAD and when it reaches the (Macro01) line will run it

 

As for dragging and dropping, a lot of time I find it quicker to use the keyboard, so dragging and dropping or typing Macro01 will take a similar length of time, you could add the LISP file to the start-up suit (appload - startup suit), without the (Macro01) line of course else it will run on every file you load, and go that way. Update the LISP file, save, load the drawings and the LISP should also be loaded (probably telling you what you all ready know).

 

For this I also have this, so you can load a modified LISP file easier (they will load when the drawing is opened but but be updated unless you tell it to), add your Macro01 and file path below, modify as required, 'appreload' in any open drawings (once per drawing) and 'Macro01'

 

(defun c:appreload ( / )
  (load "c:\\filepath\\misc.lsp" "misc Lisp Failed to Load")
  (princ "OK")(princ)
)

 

This is hugely helpful, thank you. To improve this I was hoping I could turnoff specific tags when they don't need to be run rather than having to remove them. Ideally by putting a ';' at the start. 

 

Would you know how this can be done?

Posted

"The idea was to update the lsp in a text editor, save it and drag and drop the relevant drawings into CAD. "

 

Look into Notepad++ its free and has a plugin for Activex which runs your lisp in the editor auto loading it a great function. Just change code and hit run button.

image.png.46c3051cee90e9844ad5d92212fe6638.png

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