Jump to content

Recommended Posts

Posted

Hello All,

I have never created a .lsp before. I just use the basic tools when drawing, but always thought that "programming" was beyond me.

 

Recently, I read a tip in Micheal's Corner of putting the company name on the toolbar at the bottom of the page by using setvar: mediamacro.

Of course, it is gone when next I open a session. I found some instruction on how to make it permanent, but was mystified by the programming language.

 

This is what I tried to decipher:

 

I have downloaded a VLX or LSP file - what can I do now to use it?

The LISP code has to be loaded into AutoCAD. You can load ("install") a LSP, VLX or FAS file containing an add-on application or utility into AutoCAD just by mouse-dragging it from Windows Explorer (or other file manager) to the AutoCAD window. Only after you load the application into the running session (and current drawing), the functions and commands programmed in the specific application will become available. On loading, the application usually lists the command name(s) which it defines and which is then used to start or control the application functionality. E.g. if it displays the text C:MYCODE on load, you can run the function with the MYCODE command typed on the AutoCAD command line (with small utilities, the name of the LSP/VLX file is often the same as the command name).

Another way of loading the AutoLISP (VisualLISP) code of an application is the APPLOAD command, where you select the requested files to load. By dragging them to the "briefcase" icon in the dialog of this command, you can guarantee their automatic loading in the subsequent AutoCAD sessions.

Yet another option is entering the LISP command (load "myapplication.LSP") on the AutoCAD command line (in this case, your LSP file should be stored in the AutoCAD support path). You can also add this command to your ACAD.LSP or ACADDOC.LSP file for automatic loading in the next sessions. LISP files with the .MNL extension are loaded automatically when loading the relevant menu file (MNS, MNU, CUI, CUIX).

 

 

Could someone be so kind to explain to an old dog this new trick?

 

Thanks,

John

Posted

That paragraph is just telling you about some of the ways lisp routines can be loaded into AutoCAD. If you want it to be done automatically then use either the Startup Suite or Acaddoc.lsp both of which are explained here...

 

http://lee-mac.com/autoloading.html

Posted

Thank you ReMark for your help. I tried appload, but I think I needed something before that....like creating a file of some sort that would change the settings variable perhaps?

Appload expected to load and existing .lsp. How do I get the following into that form: setvar:mediamacro "Company Name" ?

 

Sorry to be so dense,

John

Posted

Yes, if you are using APPLOAD it would be beneficial to actually be loading a lisp routine. SETVAR, in and of itself, is not a lisp routine; it is used in lisp to set an AutoCAD variable to a specified value. For example, when you run the Fillet command the default radius is set to 0.500 but you may want it this changed to 0.7500. If that's the case you could create an acaddoc.lsp file and insert the following line in it...

 

(setvar "FILLETRAD" 0.75)

 

Note the parenthesis and the quotation marks.

 

MEDIAMACRO is not a system variable that I recognize. Could you be referring to MODEMACRO?

 

There is no toolbar at the bottom of the screen by default. Could you be referring to the Status Bar?

Posted

System variables can be saved in two locations 1) the drawing itself and 2) the Windows Registry. Unfortunately MODEMACRO is one of those variables that is not saved in either thus the reason for including it in a lisp file.

Posted

 

MEDIAMACRO is not a system variable that I recognize. Could you be referring to MODEMACRO?

 

There is no toolbar at the bottom of the screen by default. Could you be referring to the Status Bar?

 

Correct on both accounts!,

John

Posted

It always helps to use the correct terminology. I'm confused enough most days to begin with.:lol:

Posted

Thanks to rkent.

I am studying that article now, but am not sure DIESEL is available in AutoCAD 2000. Will discover if so or not as I progress.

 

Thanks,

John

Posted

You don't need diesel. You need either an acad.lsp file or an acaddoc.lsp file in which you list your various system variables and their settings whether it is one or one hundred.

 

If you scroll down towards the bottom of the article you'll see why the author mentions using diesel. The reason has to do with AutoCAD LT which does not support lisp but does support the use of diesel macros. So if someone wanted to set MODEMACRO in AutoCAD LT they would have to use a diesel macro.

Posted

Diesel will work in 2000, that has been around a while.

Posted

Just add the line of code below to your acaddoc.lsp file and change the "Company Name" to "Whatever your Company Name Is"

 

(command "modemacro" "Company Name")

 

Save the acaddoc.lsp file to your C:\Program Files\Autodesk\AutoCAD 2000 folder and then open Autocad and the text should display in the lower left corner of your screen.

Posted

Could not resist having a play with this idea

 

(setq who (getenv "username"))
(cond 
((= who "Ahxx")(setvar "modemacro" "BIGALS Computer"))
((= who "Barney")(setvar "modemacro" "Barney Rubble's Computer"))
((= who "Fred")(setvar "modemacro" "Fred flinstone's Computer"))
)

 

The messages that could be displayed and no one the wiser.

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