AUTOLOADER© HTML Programming4.207 | Tutorials and Sampleswrite requests to: takehiko@mit.edu original: 1996/10/18 by Takehiko Nagakura last revised : 2005/02/30 by Takehiko Nagakura AUTOPLOADER© Set Up
|
![]() |
tutorial
When you start making your own web page that you intend AutoLOADER to download your Lisp file and load to AutoCAD, please note that
your_athena_home_directory/www/4.207/
If you are using a PC in the studio or the PC classroom, your_athena_home_directory is mapped to H: drive. www should be in there by default and you need to make 4.207 directory by yourself.
As an entry point, please make sure to place a file named index.html there as is pointed by the list of the students in the 4.207 project page.
http://cat2.mit.edu/4.207/projects/athena/your_account_name/
If you use http:/web.mit.edu/~your_account_name/www/4.207/ , you can still see this page on a browser, but AutoLOADER will not work.
The following is an example of how you can use this utility software
to make a web based presentation that interact with AutoCAD.
The AutoLISP file, stool_01.lsp, provides a
lisp routine to draw variations of a simple stool.
Clicking above link will show the code in another browser window. (If you have another browser window open behind the current one or minimized in the task bar, it may have showed up in there.) To show the text code of the program file, make a copy of the lisp file with .txt suffix and reference to it. Here is the actual HTML code used above.
- < a href="stool_01.txt" target="browser" > stool_01.lsp < /a > : show code
This program defines the following functions.
(stool xpos ypos rot tank_width tank_height)
(c:demo)
- < a href="stool_01.lsp" > stool_01.lsp < /a >
Now, why did I not make this to draw some graphics when you clicked the
file to load? As is typically the case with an add-on program module,
the file, stool_01.lsp, only defines new functions and does not include
a line to execute these functions. If you see the AutoLISP code in the file, its last line is a commented line that says ;(C:demo). If you take this semi-colon out, the demo function will actually run when you load the file.
But here, I am instead expecting the user to execute a new function in one of three ways after loading the AutoLISP file to AutoCAD.
One of the functions defined by this program is C:demo
. For instance, let's think about executing
this function, (c:demo)
.
demo
(c:demo)
(c:demo)
, and load it with LISPLOADER©. (c:demo)
.
For instance, try clicking the lines below.
(c:demo)
(command "erase" "all" "")
(stool 150 120 -35 100 40)
To make a button like those above, your HTML line should look like
- < href="/cgi-bin-4203/lispdispatch.cgi?xxx"> yyy < /a >
For your own code, all you need to fill in are xxx and yyy.
Here, yyy is obviously the text to be displayed on the page.
xxx is the AutoLISP command to be dispatched by the CGI, lispdispatch.cgi,
which exists in a directory, cgi-bin-4203. (Thus you must type the full
/cgi-bin-4203/lispdispatch.cgi.) Make sure to place ?
mark just before xxx
and include no space.
When you place your lisp command in xxx, there are following rules and ristrictions
to be taken care of.
- < a href="/cgi-bin-4203/lispdispatch.cgi?(c:demo)">
(c:demo)
< /a >
- < a href="/cgi-bin-4203/lispdispatch.cgi?(command|^erase^|^all^|^^)">
(command "erase" "all" "")
< /a >
- < a href="/cgi-bin-4203/lispdispatch.cgi?(stool|150|120|-35|100|40)">
(stool 150 120 -35 100 40)
< /a >
Here is a set of standard buttons used throughout my AutoLISP tutorial pages. Feel free to look at the HTML source code and use the image files for these buttons.
(c:demo)
Suppose you have an AutoLISP file, test.lsp, sent to AutoCAD via LISPLOADER© as by
- < a href="test.lsp" >