General instructions for using
the MWTech ARX routines and functions.
First, and most important, place all downloaded files
into a directory that can be found in the Acad search path. To check
your search path to ensure this, type 'preferences' at the command
line within AcadR14 and check the "Support File Search Path" for
your chosen directory. Or alternativley, you could place the file(s)
into your AcadR14/Support directory which should already be listed
within your search path.
Stand Alone Routines - 2 Methods of loading
1) Single time usage (load on demand only)
A) Type "Appload" at the command prompt.
B) Change the file type at the bottom of the dialog box to read
"*.arx"
C) Choose the "Browse" button and graphically select the appropriate
ARX application.
D) Type the appropriate routine name at the command line (ex. Cleanup)
2) Autoload the ARX application everytime Acad is
started
A) This is probably the easiest method for always having access
to your new routine. Do a search within your AcadR14 directory structure
for a file called "acad.rx". (If you don't find one, see "NOTE"
below.)
B) Open the acad.rx file within a text editor (such as NotePad)
C) Simply add the file name on a line by itself (ex. cleanup.arx)
D) That's it. Save the file and whenever you want another arx file
to be autoloaded, just add it's name to the list.
NOTE: If you don't find a acad.rx file, that's OK.
You can easily create your own. Open a new file within a text editor
(such as NotePad - not a word processing program) and follow step
C above. When finished, save the file as acad.rx to any directory
listed in your Acad support file search path.
Programmers Functions
All functions must be loaded before they can be used.
We don't necessarily want them to be loaded whenever Acad is started
but rather whenever our program that uses the function is started.
So the loading of these functions is done manually with some easy
AutoLisp code before calling the function. Below are two methods
of having your code check to see if the function is loaded or not.
This is important, because if the arx file is already loaded and
you try to reload it, an error is returned.
Place the code at the beggining of your routine. (Or
at least before the function call)
Method #1 This checks the list returned by
the function (arx) to see if the function is loaded.
Syntax:
(if
(not (member "application.arx" (arx))) (arxload
"application") )
Example to check to see if the arx program "sort" is loaded.
Note the use of lower case for the arx application name as the (arx)
function always returns lower case. The function your checking must
be in the Acad search path, otherwise the (arx) function may return
the path of the application as well and consequently, you'll never get
a match.
(if
(not (member "sort.arx" (arx))) ;check to see if sort is already loaded
(arxload
"sort") ;if not, then load
)
Method #2 This second method uses the arxload command
itself to check if the function is loaded. This method always tries
to load or reload the named arx function every time and returns the
applications name or failure string. Most programmers prefer to only
attempt to load something if its required, but this method is perfectably
acceptable.
Syntax:
(arxload "application" [failure string])
Example to load the "sort" application. This returns "sort"
if successful and the number 1 if not.
(arxload
"sort" 1)
|