Sunteți pe pagina 1din 46

SL. No.

Function/Command
Application-handling functions
1 (arx)
2 (arxload application [onfailure])
3 (arxunload application [onfailure])
4 (autoarxload filename cmdlist)
5 (autoload filename cmdlist)
6 (initdia [dialogflag])
7 (load filename [onfailure])
8 (showhtmlmodalwindow uri)
9 (startapp appcmd file)
10 (vl-load-all filename)
11 (vl-vbaload "filename")
12 (vl-vbarun "macroname")
(vlax-add-cmd "global-name" 'func-sym [“local-name"
13 cmd-flags])
Arithmetic functions
1 (+ [number number ...])
2 (- [number number ...])
3 (* [number number ...])
4 (/ [number number ...])
5 (~ int)
6 (1+ number)
7 (1- number)
8 (abs number)
9 (atan num1 [num2])
10 (cos ang)
11 (exp number)
12 (expt base power)
13 (fix number)
14 (float number)
15 (gcd int1 int2)
16 (log number)
17 (logand [int int ...])
18 (logior [int int ...])

19 (lsh [int numbits])


20 (max [number number ...])
21 (min [number number ...])
22 (minusp number)
23 (rem [num1 num2 ...])
24 (sin ang)
25 (sqrt number)
26 (zerop number)
1 (= numstr [numstr ...])

2 (/= numstr [numstr ...])

3 (< numstr [numstr ...])

4 (<= numstr [numstr ...])

5 (> numstr [numstr ...])

6 (>= numstr [numstr ...])


7 (and [expr ...])
8 (boole func int1 [int2 ...])
9 (cond [(test result ...) ...])
10 (eq expr1 expr2)
11 (equal expr1 expr2 [fuzz])
12 (if testexpr thenexpr [elseexpr])
13 (or [expr ...])
14 (repeat int [expr ...])

15 (while testexpr [expr ...])

Error-handling functions
1 (alert string)
2 (*error* string)
3 (exit)
4 (*pop-error-mode*)

5 (*push-error-using-command*)

6 (*push-error-using-stack*)
7 (quit)
8 (vl-catch-all-apply 'function list)
9 (vl-catch-all-error-message error-obj)
10 (vl-catch-all-error-p arg)

Function-handling functions
1 (apply function lst)
2 (defun sym ([arguments] [/variables ...]) expr ... )
3 (defun-q sym ([arguments] [/ variables ...]) expr ...)
4 (defun-q-list-ref 'function)
5 (defun-q-list-set 'sym list)
6 (eval expr)
7 (lambda arguments expr ...)
8 (progn [expr ...])
9 (trace function ...)
10 (untrace function ...)

1 (acad_strlsort lst)
2 (append lst ...)
3 (assoc item alist)
4 (car lst)
5 (cdr lst)
6 (cons new-first-element lst)
7 (foreach name lst [expr ...])
8 (last lst)
9 (length lst)
10 (list [expr ...])
11 (listp item)
12 (mapcar function list1 ... listn)

13 (member expr lst)

14 (nth n lst)
15 (reverse lst)
16 (subst newitem olditem lst)
17 (vl-consp list-variable)
18 (vl-every predicate-function list [ more-lists ...])
19 (vl-list* object [more-objects ...])
20 (vl-list->string char-codes-list)
21 (vl-list-length list-or-cons-object)
22 (vl-member-if predicate-function list)
23 (vl-member-if-not predicate-function list)
24 (vl-position symbol list)
25 (vl-remove element-to-remove list)
26 (vl-remove-if predicate-function list)
27 (vl-remove-if-not predicate-function list)
28 (vl-some predicate-function list [more-lists ...])
29 (vl-sort list comparison-function)
30 (vl-sort-i list comparison-function)
31 (vl-string->list string)
String-handling functions
1 (read [string])
2 (strcase string [which])
3 (strcat [string1 [string2 ...])
4 (strlen [string ...])
5 (substr string start [length])
6 (vl-prin1-to-string object)

7 (vl-princ-to-string object)
8 (vl-string->list string)
9 (vl-string-elt string position)
10 (vl-string-left-trim character-set string)
11 (vl-string-mismatch str1 str2 [pos1 pos2 ignore-case-p])
12 (vl-string-position char-code str [ start-pos [from-end-p]])
13 (vl-string-right-trim character-set string)
14 (vl-string-search pattern string [ start-pos])
15 (vl-string-subst new-str pattern string [start-pos])
16 (vl-string-translate source-set dest-set str)
17 (vl-string-trim char-set str)
18 (wcmatch string pattern)
Symbol-handling functions
1 (atom item)
2 (atoms-family format [symlist])
3 (boundp sym)
4 (not item)
5 (null item)
6 (numberp item)
7 (quote expr)
8 (set sym expr)
9 (setq sym1 expr1 [sym2 expr2 ...])
10 (type item)
11 (vl-symbol-name symbol)
12 (vl-symbol-value symbol)
13 (vl-symbolp object)
Description
Application-handling functions
Returns a list of the currently loaded ObjectARX applications
Loads an ObjectARX application
Unloads an ObjectARX application
Predefines command names to load an associated ObjectARX file
Predefines command names to load an associated AutoLISP file
Forces the display of the next command's dialog box
Evaluates the AutoLISP expressions in a file
Displays a modal dialog box with a specified URI (Uniform Resource
Identifier)
Starts a Windows application
Loads a file into all open AutoCAD documents
Loads a VBA project
Runs a VBA macro
Adds commands to the AutoCAD built-in command set

Arithmetic functions
Returns the sum of all numbers
Subtracts the second and following numbers from the first and returns
the difference
Returns the product of all numbers
Divides the first number by the product of the remaining numbers and
returns the quotient
Returns the bitwise NOT (1's complement) of the argument
Returns the argument increased by 1 (incremented)
Returns the argument reduced by 1 (decremented)
Returns the absolute value of the argument
Returns the arctangent of a number in radians
Returns the cosine of an angle expressed in radians
Returns the constant e (a real) raised to a specified power (the natural
antilog)
Returns a number raised to a specified power
Returns the conversion of a real into the nearest smaller integer
Returns the conversion of a number into a real
Returns the greatest common denominator of two integers
Returns the natural log of a number as a real
Returns the result of the logical bitwise AND of a list of integers
Returns the result of the logical bitwise inclusive OR of a list of integers

Returns the logical bitwise shift of an integer by a specified number of


bits
Returns the largest of the numbers given
Returns the smallest of the numbers given
Verifies that a number is negative
Divides the first number by the second, and returns the remainder
Returns the sine of an angle as a real expressed in radians
Returns the square root of a number as a real
Verifies that a number evaluates to zero
Equality and conditional functions
Returns T if all arguments are numerically equal, and returns nil
otherwise
Returns T if the arguments are not numerically equal, and nil if the
arguments are numerically equal
Returns T if each argument is numerically less than the argument to its
right, and returns nil otherwise
Returns T if each argument is numerically less than or equal to the
argument to its right, and returns nil otherwise
Returns T if each argument is numerically greater than the argument to
its right, and returns nil otherwise
Returns T if each argument is numerically greater than or equal to the
argument to its right, and returns nil otherwise
Returns the logical AND of a list of expressions
Serves as a general bitwise Boolean function
Serves as the primary conditional function for AutoLISP
Determines whether two expressions are identical
Determines whether two expressions are equal
Conditionally evaluates expressions
Returns the logical OR of a list of expressions
Evaluates each expression a specified number of times, and returns the
value of the last expression
Evaluates a test expression, and if it is not nil, evaluates other
expressions; repeats this process until the test expression evaluates to
nil
Error-handling functions
Displays an alert dialog box with the error or warning message passed
as a string
A user-definable error-handling function
Forces the current application to quit
Error-handling function that ends the previous call to *push-error-using-
command* or *push-error-using-stack*
Error-handling function that indicates the use of the command function
within a custom *error* handler
Error-handling function that indicates the use of variables from the
AutoLISP stack within a custom *error* handler
Forces the current application to quit
Passes a list of arguments to a specified function and traps any
exceptions
Returns a string from an error object
Determines whether an argument is an error object returned from vl-
catch-all-apply
Function-handling functions
Passes a list of arguments to a specified function
Defines a function
Defines a function as a list (intended for backward-compatibility only)
Displays the list structure of a function defined with defun-q
Defines a function as a list (intended for backward-compatibility only)
Returns the result of evaluating an AutoLISP expression
Defines an anonymous function
Evaluates each expression sequentially, and returns the value of the last
expression
Aids in AutoLISP debugging
Clears the trace flag for the specified functions

List manipulation functions


Sorts a list of strings by alphabetical order
Takes any number of lists and runs them together as one list
Searches an association list for an element and returns that association
list entry
Returns the first element of a list
Returns the specified list, except for the first element of the list
The basic list constructor
Evaluates expressions for all members of a list
Returns the last element in a list
Returns an integer indicating the number of elements in a list
Takes any number of expressions and combines them into one list
Verifies that an item is a list
Returns a list of the result of executing a function with the individual
elements of a list or lists supplied as arguments to the function

Searches a list for an occurrence of an expression and returns the


remainder of the list, starting with the first occurrence of the expression

Returns the nth element of a list


Returns a list with its elements reversed
Searches a list for an old item and returns a copy of the list with a new
item substituted in place of every occurrence of the old item
Determines whether or not a list is nil
Checks whether the predicate is true for every element combination
Constructs and returns a list
Combines the characters associated with a list of integers into a string
Calculates list length of a true list
Determines whether the predicate is true for one of the list members
Determines whether the predicate is nil for one of the list members
Returns the index of the specified list item
Removes elements from a list
Returns all elements of the supplied list that fail the test function
Returns all elements of the supplied list that pass the test function
Checks whether the predicate is not nil for one element combination
Sorts the elements in a list according to a given compare function
Sorts the elements in a list according to a given compare function, and
returns the element index numbers
Converts a string into a list of character codes
String-handling functions
Returns the first list or atom obtained from a string
Returns a string where all alphabetic characters have been converted to
uppercase or lowercase
Returns a string that is the concatenation of multiple strings
Returns an integer that is the number of characters in a string
Returns a substring of a string
Returns the string representation of any LISP object as if it were output
by the prin1 function
Returns the string representation of any LISP object as if it were output
by the princ function
Converts a string into a list of character codes
Returns the ASCII representation of the character at a specified position
in a string
Removes the specified characters from the beginning of a string
Returns the length of the longest common prefix for two strings, starting
at specified positions
Looks for a character with the specified ASCII code in a string
Removes the specified characters from the end of a string
Searches for the specified pattern in a string
Substitutes one string for another, within a string
Replaces characters in a string with a specified set of characters
Removes the specified characters from the beginning and end of a string
Performs a wild-card pattern match on a string
Symbol-handling functions
Verifies that an item is an atom
Returns a list of the currently defined symbols
Verifies whether a value is bound to a symbol
Verifies that an item evaluates to nil
Verifies that an item is bound to nil
Verifies that an item is a real or an integer
Returns an expression without evaluating it
Sets the value of a quoted symbol name to an expression
Sets the value of a symbol or symbols to associated expressions
Returns the type of a specified item
Returns a string containing the name of a symbol
Returns the current value bound to a symbol
Identifies whether or not a specified object is a symbol
Special remarks if any

Core functions that are used to perform


mathematical calculations, manipulate list and
strings, provide error handling for programs,
and much more.

Extended AutoLISP extension: requires vl-load-com


SL. No. Function/Command
Conversion functions
1 (angtof string [mode])
2 (angtos angle [mode [precision]])
3 (ascii string)
4 (atof string)
5 (atoi string)
6 (chr integer)
7 (cvunit value from to)
8 (distof string [mode])
9 (itoa int)
10 (rtos number [mode [precision]])
11 (trans pt from to [disp])

Device access functions


1 (grread [track] [allkeys [curtype]])
2 (tablet code [row1 row2 row3 direction])
Display control functions
1 (graphscr)
2 (grdraw from to color [highlight])
3 (grtext [box text [highlight]])
4 (grvecs vlist [trans])
5 (menucmd string)
6 (menugroup groupname)
7 (prin1 [expr [file-desc]])

8 (princ [expr [file-desc]])

9 (print [expr [file-desc]])


10 (prompt msg)
11 (redraw [ename [mode]])
12 (terpri)
13 (textpage)
14 (textscr)

15 (vports)

File-handling functions
1 (close file-desc)
2 (findfile filename)
3 (findtrustedfile filename)
4 (open filename mode)
5 (read-char [file-desc])
6 (read-line [file-desc])
7 (vl-directory-files [ directory pattern directories])
8 (vl-file-copy "source-filename" "destination-filename" [append])
9 (vl-file-delete "filename")
10 (vl-file-directory-p "filename")
11 (vl-file-rename "old-filename" "new-filename")
12 (vl-file-size "filename")
13 (vl-file-systime "filename")
14 (vl-filename-base "filename")

15 (vl-filename-directory "filename")

16 (vl-filename-extension "filename")
17 (vl-filename-mktemp ["pattern" "directory" "extension"])
18 (write-char num [file-desc])
19 (write-line string [file-desc])
Geometric functions
1 (angle pt1 pt2)
2 (distance pt1 pt2)
3 (inters pt1 pt2 pt3 pt4 [onseg])
4 (osnap pt mode)

5 (polar pt ang dist)

6 (textbox elist)

Query and command functions


1 (acad_colordlg colornum [flag])
2 (acad_helpdlg helpfile topic)
3 (command [arguments] ...)
4 (command-s [arguments] ...)
5 (getcfg cfgname)
6 (getcname cname)
7 (getenv "variable-name")
8 (getvar "varname")
9 (help [helpfile [topic [command]]])
10 (setcfg cfgname cfgval)
11 (setenv "varname" "value")

12 (setfunhelp "c:fname" ["helpfile" ["topic" ["command"]]])

13 (setvar "varname" value)


14 (ver)
15 (vl-cmdf [arguments] ...)
16 (vlax-add-cmd global-name func-sym [local-name cmd-flags])
17
18 (vlax-remove-cmd global-name)
User input functions
1 (entsel [msg])
2 (getangle [pt] [msg])
3 (getcorner pt [msg])
4 (getdist [pt] [msg])
5 (getfiled title default ext flags)
6 (getint [msg])
7 (getkword [msg])
8 (getorient [pt] [msg])
9 (getpoint [pt] [msg])
10 (getreal [msg])
11 (getstring [cr] [msg])
12 (initget [bits] [string])

13 (nentsel [msg])

14 (nentselp [msg] [pt])

Memory management functions


1 (alloc int)
2 (expand number)
3 (gc)
4 (mem)
Windows Registry and Property List File fu
1 (vl-registry-delete reg-key [val-name])

2 (vl-registry-descendents reg-key [val-names])

3 (vl-registry-read reg-key [val-name])


4 (vl-registry-write reg-key [val-name val-data])
5 (vlax-machine-product-key)

7 (vlax-product-key)

9 (vlax-user-product-key)
Description
Conversion functions
Converts a string representing an angle into a real (floating-point)
value in radians
Converts an angular value in radians into a string
Returns the conversion of the first character of a string into its ASCII
character code (an integer)
Returns the conversion of a string into a real
Returns the conversion of a string into an integer
Returns the conversion of an integer representing an ASCII character
code into a single-character string
Converts a value from one unit of measurement to another
Converts a string that represents a real (floating-point) value into a
real value
Returns the conversion of an integer into a string
Converts a number into a string
Translates a point (or a displacement) from one coordinate system to
another
Device access functions
Reads values from any of the AutoCAD input devices
Retrieves and sets digitizer (tablet) calibrations
Display control functions
Displays the AutoCAD graphics screen
Draws a vector between two points, in the current viewport
Writes text to the status line or to screen menu areas
Draws multiple vectors on the graphics screen
Issues menu commands, or sets and retrieves menu item status
Verifies that a menu group is loaded
Prints an expression to the command line or writes an expression to
an open file
Prints an expression to the command line, or writes an expression to
an open file
Prints an expression to the command line, or writes an expression to
an open file
Displays a string on your screen's prompt area
Redraws the current viewport or a specified object (entity) in the
current viewport
Prints a newline to the Command line
Switches from the graphics screen to the text screen
Switches from the graphics screen to the text screen (like the
AutoCAD Flip Screen function key)
Returns a list of viewport descriptors for the current viewport
configuration
File-handling functions
Closes an open file
Searches the AutoCAD library path for the specified file
Searches the AutoCAD trusted file paths for the specified file
Opens a file for access by the AutoLISP I/O functions
Returns the decimal ASCII code representing the character read from
the keyboard input buffer or from an open file
Reads a string from the keyboard or from an open file
Lists all files in a given directory
Copies or appends the contents of one file to another file
Deletes a file
Determines if a file name refers to a directory
Renames a file
Determines the size of a file, in bytes
Returns last modification time of the specified file
Returns the name of a file, after stripping out the directory path and
extension
Returns the directory path of a file, after stripping out the name and
extension
Returns the extension from a file name, after stripping out the rest of
the name
Calculates a unique file name to be used for a temporary file
Writes one character to the screen or to an open file
Writes a string to the screen or to an open file
Geometric functions
Returns an angle in radians of a line defined by two endpoints
Returns the 3D distance between two points
Finds the intersection of two lines
Returns a 3D point that is the result of applying an Object Snap mode
to a specified point
Returns the UCS 3D point at a specified angle and distance from a
point
Measures a specified text object, and returns the diagonal coordinates
of a box that encloses the text
Query and command functions
Displays the standard AutoCAD Color Selection dialog box
Invokes the Help facility (obsolete)
Executes an AutoCAD command
Executes an AutoCAD command and the supplied input
Retrieves application data from the AppData section of
the acadXXXX.cfg file
Retrieves the localized or English name of an AutoCAD command
Returns the string value assigned to an environment variable
Retrieves the value of an AutoCAD system variable
Invokes the Help facility

Writes application data to the AppData section of theacadXXXX.cfg file


Sets an environment variable to a specified value
Registers a user-defined command with the Help facility so the
appropriate help file and topic are called when the user requests help
on that command
Sets an AutoCAD system variable to a specified value
Returns a string that contains the current AutoLISP version number
Executes an AutoCAD command after evaluating arguments
Adds commands to a group
Note: Extended AutoLISP extension: requires vl-load-com
Removes a single command or command group
User input functions

Prompts the user to select a single object (entity) by specifying a point


Pauses for user input of an angle, and returns that angle in radians
Pauses for user input of a rectangle's second corner
Pauses for user input of a distance
Prompts the user for a file name with the standard AutoCAD file
dialog box, and returns that file name
Pauses for user input of an integer, and returns that integer
Pauses for user input of a keyword, and returns that keyword
Pauses for user input of an angle, and returns that angle in radians
Pauses for user input of a point, and returns that point
Pauses for user input of a real number, and returns that real number
Pauses for user input of a string, and returns that string
Establishes keywords for use by the next user input function call
Prompts the user to select an object (entity) by specifying a point, and
provides access to the definition data contained within a complex
object
Provides similar functionality to that of the nentsel function without
the need for user input
Memory management functions
Sets the segment size to a given number of nodes
Allocates node space by requesting a specified number of segments
Forces a garbage collection, which frees up unused memory
Displays the current state of memory in AutoLISP
Windows Registry and Property List File functions
Deletes the specified key from the Windows Registry or property list
file on Mac OS
Returns a list of subkeys or value names for the specified key of the
Windows Registry or property list file on Mac OS
Returns data stored by a specific key/value pair in the Windows
Registry or property list file on Mac OS
Creates a key in the Windows Registry or property list file on Mac OS
Returns the AutoCAD Windows Registry path in the HKLM
(HKEY_LOCAL_MACHINE)
Note: Available on Windows only and requires a call to the vl-load-
comfunction.
Returns the AutoCAD Windows Registry path (Obsolete)
Note: Use the vlax-machine-product-key function instead.
Returns the AutoCAD Windows registry path in the HKCU
(HKEY_CURRENT_USER)
Special remarks if any

Functions that are used to convert between


data types, work with standard AutoCAD
commands, get input from the user at the
command prompt, and much more.
Extended AutoLISP extension: requires vl-load-com

Available on Windows only and requires a call to


the vl-load-comfunction.
SL. No. Function/Command
Extended data-handling function
1 (regapp application)

2 (xdroom ename)

3 (xdsize lst)

Object-handling functions
1 (dumpallproperties ename [context])
2 (entdel ename)
3 (entget ename [applist])
4 (entlast)
5 (entmake [elist])
6 (entmakex [elist])
7 (entmod elist)
8 (entnext [ename])
9 (entupd ename)
(getpropertyvalue ename propertyname [or collectionName
10 index name])
11 (handent handle)
(ispropertyreadonly ename propertyname [or collectionName
12 index name])
(setpropertyvalue ename propertyname value [or
13 collectionname index name val])
14 (vlax-dump-object obj)
15 (vlax-erased-p obj)
16 (vlax-get-acad-object)
17 (vlax-method-applicable-p obj method)
18 (vlax-object-released-p obj)
19 (vlax-read-enabled-p obj)
20 (vlax-release-object obj)
21 (vlax-typeinfo-available-p obj)
22 (vlax-write-enabled-p obj)
Selection set manipulation functio
1 (ssadd [ename [ss]])
2 (ssdel ename ss)
3 (ssget [mode] [pt1 [pt2]] [pt-list] [filter-list])
4 (ssgetfirst)
5 (sslength ss)
6 (ssmemb ename ss)
7 (ssname ss index)
8 (ssnamex ss index)
9 (sssetfirst gripset [pickset])

Symbol table and dictionary-handling fu


1 (dictadd ename symbol newobj)
2 (dictnext ename symbol [rewind])
3 (dictremove ename symbol)
4 (dictrename ename oldsym newsym)
5 (dictsearch ename symbol [setnext])
6 (layoutlist)

7 (namedobjdict)

8 (setview view_description [vport_id])


9 (snvalid sym_name)
10 (tblnext table-name [rewind])
11 (tblobjname table-name symbol)
12 (tblsearch table-name symbol [setnext])
13 (vlax-ldata-delete dict key)
14 (vlax-ldata-get dict key [default-data])
15 (vlax-ldata-list dict)
16 (vlax-ldata-put dict key data)
17 (vlax-ldata-test data)
Description
Extended data-handling functions
Registers an application name with the current AutoCAD drawing in
preparation for using extended object data
Returns the amount of extended data (xdata) space that is available
for an object (entity)
Returns the size (in bytes) that a list occupies when it is linked to an
object (entity) as extended data
Object-handling functions
Retrieves an entity’s supported properties
Deletes objects (entities) or restores previously deleted objects
Retrieves an object's definition data
Returns the name of the last non-deleted main object in the drawing
Creates a new entity (graphical object) in the drawing
Makes a new object, gives it a handle and entity name (but does not
assign an owner), and then returns the new entity name
Modifies the definition data of an object
Returns the name of the next object in the drawing
Updates the screen image of an object
Returns the current value of an entity’s property
Returns an object name based on its handle
Returns the read-only state of an entity’s property

Sets the property value for an entity


Lists an object's methods and properties
Determines whether an object was erased
Retrieves the top-level AutoCAD application object for the current
AutoCAD session
Determines whether an object supports a particular method
Determines whether an object has been released
Determines whether an object can be read
Releases a drawing object
Determines whether type library information is present for the
specified type of object
Determines whether an AutoCAD drawing object can be modified
Selection set manipulation functions
Adds an object (entity) to a selection set, or creates a new selection
set
Deletes an object (entity) from a selection set
Prompts the user to select objects (entities), and returns a selection
set
Determines which objects are selected and gripped
Returns an integer containing the number of objects (entities) in a
selection set
Tests whether an object (entity) is a member of a selection set
Returns the object (entity) name of the indexed element of a
selection set
Retrieves information about how a selection set was created
Sets which objects are selected and gripped

Symbol table and dictionary-handling functions


Adds a non-graphical object to the specified dictionary
Finds the next item in a dictionary
Removes an entry from the specified dictionary
Renames a dictionary entry
Searches a dictionary for an item
Returns a list of all paper space layouts in the current drawing
Returns the entity name of the current drawing's named object
dictionary, which is the root of all non-graphical objects in the
drawing
Establishes a view for a specified viewport
Checks the symbol table name for valid characters
Finds the next item in a symbol table
Returns the entity name of a specified symbol table entry
Searches a symbol table for a symbol name
Erases AutoLISP data from a drawing dictionary
Retrieves AutoLISP data from a drawing dictionary
Lists AutoLISP data in a drawing dictionary
Stores AutoLISP data in a drawing dictionary
Determines whether data can be saved over a session boundary
Special remarks if any

Functions used to work with extended data


(Xdata), manipulate and select objects, and
work with symbol tables and dictionaries.

Extended AutoLISP extension: requires vl-load-com


Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Extended AutoLISP extension: requires vl-load-com
Note: Extended AutoLISP extension: requires vl-load-com
Note: Extended AutoLISP extension: requires vl-load-com
Note: Extended AutoLISP extension: requires vl-load-com
Note: Extended AutoLISP extension: requires vl-load-com
Note: Extended AutoLISP extension: requires vl-load-com
ith extended data
elect objects, and
and dictionaries.
SL. No. Function/Command
Collection manipulation functio
1 (vlax-for symbol collection [expression1 [expression2 ...]])
2 (vlax-map-collection obj function)
Data conversion functions
1 (vlax-3D-point list)
2 (vlax-ename->vla-object entname)
(vlax-make-safearray type '(l-bound . u-bound) ['( l-bound . u-
3 bound) ...])
4 (vlax-make-variant value type)
5 (vlax-safearray-fill var 'element-values)
6 (vlax-safearray-get-dim var)
7 (vlax-safearray-get-element var element)
8 (vlax-safearray-get-l-bound var dim)
9 (vlax-safearray-get-u-bound var dim)
10 (vlax-safearray-put-element var element value)
11 (vlax-safearray-type var)
12 (vlax-safearray->list var)
13 (vlax-tmatrix list)
14 (vlax-variant-change-type var type)
15 (vlax-variant-type var)
16 (vlax-variant-value var)
17 (vlax-vla-object->ename obj)
Method invocation functions
1 (vlax-invoke-method obj method list)
2 (vlax-method-applicable-p obj method)
ActiveX Object-handling functio
1 (vlax-dump-object obj)
2 (vlax-erased-p obj)
3 (vlax-get-acad-object)
4 (vlax-method-applicable-p obj method)
5 (vlax-object-released-p obj)
6 (vlax-read-enabled-p obj)
7 (vlax-release-object obj)
8 (vlax-typeinfo-available-p obj)
9 (vlax-write-enabled-p obj)
Property-handling functions
1 (vlax-get-property obj property)
2 (vlax-property-available-p obj prop [T])
3 (vlax-put-property obj property arg)

1 (vlax-curve-getArea curve-obj)
2 (vlax-curve-getClosestPointTo curve-obj givenPnt [extend])
(vlax-curve-getClosestPointToProjection curve-obj givenPnt
3 normal [extend])

4 (vlax-curve-getDistAtParam curve-obj param)

5 (vlax-curve-getDistAtPoint curve-obj point)


6 (vlax-curve-getEndParam curve-obj)
7 (vlax-curve-getEndPoint curve-obj)
8 (vlax-curve-getFirstDeriv curve-obj param)

9 (vlax-curve-getParamAtDist curve-obj point)


10 (vlax-curve-getParamAtPoint curve-obj dist)
11 (vlax-curve-getPointAtDist curve-obj dist)

12 (vlax-curve-getPointAtParam curve-obj param)

13 (vlax-curve-getSecondDeriv curve-obj param)


14 (vlax-curve-getStartParam curve-obj)
15 (vlax-curve-getStartPoint curve-obj)
16 (vlax-curve-isClosed curve-obj)

17 (vlax-curve-isPeriodic curve-obj)

18 (vlax-curve-isPlanar curve-obj)
Dictionary functions
1 (vlax-ldata-delete dict key)
2 (vlax-ldata-get dict key [ default-data])
3 (vlax-ldata-list dict)
4 (vlax-ldata-put dict key data)
5 (vlax-ldata-test data)
Functions for handling drawing ob
1 (vlax-create-object "prog-id")
2 (vlax-dump-object obj)
3 (vlax-erased-p obj)
4 (vlax-get-acad-object)
5 (vlax-get-object "prog-id")
6 (vlax-get-or-create-object "prog-id")

(vlax-import-type-library :tlb-filename filename [ :methods-


7 prefix mprefix :properties-prefix pprefix :constants-
prefix cprefix])
8 (vlax-method-applicable-p obj method)
9 (vlax-object-released-p obj)
10 (vlax-read-enabled-p obj)
11 (vlax-release-object obj)
12 (vlax-typeinfo-available-p obj)
13 (vlax-write-enabled-p obj)

1 (vl-load-com)
2 (vlr-acdb-reactor data callbacks)
3 (vlr-add obj)
4 (vlr-added-p obj)
5 (vlr-beep-reaction [args])
6 (vlr-command-reactor data callbacks)
7 (vlr-current-reaction-name)
8 (vlr-data obj)
9 (vlr-data-set obj data)
10 (vlr-deepclone-reactor obj data)
11 (vlr-docmanager-reactor obj data)
12 (vlr-dwg-reactor obj data)

13 (vlr-dxf-reactor obj data)


14 (vlr-editor-reactor data callbacks)
15 (vlr-insert-reactor data callbacks)
16 (vlr-linker-reactor data callbacks)
17 (vlr-lisp-reactor data callbacks)
18 (vlr-miscellaneous-reactor data callbacks)

19 (vlr-mouse-reactor data callbacks)

20 (vlr-notification reactor)
21 (vlr-object-reactor owners data callbacks)
22 (vlr-owner-add reactor owner)
23 (vlr-owner-remove reactor owner)
24 (vlr-owners reactor)
25 (vlr-pers reactor)
26 (vlr-pers-list [reactor])
27 (vlr-pers-p reactor)
28 (vlr-pers-release reactor)
29 (vlr-reaction-name reactor-type)
30 (vlr-reaction-set reactor event function)
31 (vlr-reactions reactor)
32 (vlr-reactors [reactor-type ...])
33 (vlr-remove reactor)
34 (vlr-remove-all reactor-type)
35 (vlr-set-notification reactor 'range)

36 (vlr-sysvar-reactor data callbacks)

37 (vlr-toolbar-reactor data callbacks)


38 (vlr-trace-reaction)
39 (vlr-type reactor)
40 (vlr-types)
41 (vlr-undo-reactor data callbacks)
42 (vlr-wblock-reactor data callbacks)

43 (vlr-window-reactor data callbacks)

44 (vlr-xref-reactor data callbacks)

VLX namespace functions


1 (vl-arx-import [ function | application])
2 (vl-doc-export 'function)

3 (vl-doc-import ['function | application])

4 (vl-doc-ref symbol)
5 (vl-doc-set symbol value)
6 (vl-exit-with-error "msg")
7 (vl-exit-with-value value)
8 (vl-list-exported-functions [“appname”])

9 (vl-list-loaded-vlx)

10 (vl-unload-vlx "appname")
11 (vl-vlx-loaded-p "appname")
Namespace communication func
1 (vl-bb-ref 'variable)
2 (vl-bb-set 'variable value)
3 (vl-load-all "filename")

4 (vl-propagate 'variable)
Description
Collection manipulation functions
Iterates through a collection of objects, evaluating each expression (Visual LISP
Function)
Applies a function to all objects in a collection
Data conversion functions
Creates an ActiveX-compatible 3D point structure
Transforms entity to VLA-object
Creates a safearray
Creates a variant data type
Stores elements in a safearray
Returns the number of dimensions in a safearray object
Returns an element from an array
Returns the lower boundary (starting index) of a dimension of an array
Returns the upper boundary (end index) of a dimension of an array
Adds or updates an element in an array
Returns the data type of a safearray
Returns the elements of a safearray in list form
Returns a suitable representation for a 4 x 4 transformation matrix to be used in
VLA methods
Returns the value of a variant after changing it from one data type to another
Returns the data type of a variant
Returns the value of a variant
Transforms a VLA-object to an AutoLISP entity
Method invocation functions
Calls the specified method of an object
Determines if an object supports a particular method
ActiveX Object-handling functions
Lists an object's methods and properties
Determines whether an object was erased
Retrieves the top-level AutoCAD application object for the current AutoCAD
session
Determines if an object supports a particular method
Determines if an object has been released
Determines whether an object can be read
Releases a graphical object
Determines whether type library information is present for the specified type of
object
Determines whether an AutoCAD drawing object can be modified
Property-handling functions
Low-level property get function. May be used for custom ActiveX object
Determines whether an object has a specified property
Low-level property set function

Curve measurement functions


Returns the area inside the curve
Returns the point (in WCS coordinates) on a curve that is nearest to the specified
point
Returns the closest point (in WCS) on a curve after projecting the curve onto a
plane
Returns the length of the curve's segment from the curve's beginning to the
specified parameter
Returns the length of the curve's segment between the curve's start point and
the specified point
Returns the parameter of the endpoint of the curve
Returns the endpoint (in WCS coordinates) of the curve
Returns the first derivative (in WCS coordinates) of a curve at the specified
location
Returns the parameter of a curve at the specified distance from the beginning of
the curve
Returns the parameter of the curve at the point
Returns the point (in WCS coordinates) along a curve at the distance specified by
the user
Determines the point on the curve that corresponds to the param parameter
and returns the point
Returns the second derivative (in WCS coordinates) of a curve at the specified
location
Returns the start parameter on the curve
Returns the start point (in WCS coordinates) of the curve
Determines if the specified curve is closed (i.e., start point is same as endpoint)
Determines if the specified curve has an infinite range in both directions and
there is a period value dT, such that there is a point on curve at ( u + dT) = point
on curve ( u), for any parameter u
Determines if there is a plane that contains the curve
Dictionary functions
Erases AutoLISP data from a drawing dictionary
Retrieves AutoLISP data from a drawing dictionary
Lists AutoLISP data in a drawing dictionary
Stores AutoLISP data in a drawing dictionary
Determines whether data can be saved over a session boundary
Functions for handling drawing objects
Creates a new instance of an ActiveX object
Lists an object's methods and properties
Determines whether an object was erased
Retrieves the top-level AutoCAD application object for the current AutoCAD
session
Returns a running instance of an ActiveX object
Returns a running instance of an ActiveX object, if one exists, otherwise starts a
new instance of the object

Imports information from a type library


Determines whether an object supports a particular method
Determines whether an object has been released
Determines whether an object can be read
Releases a drawing object
Determines whether type library information is present for the specified type of
object
Determines whether an AutoCAD drawing object can be modified

Reactor functions
Loads AutoLISP reactor support functions and other AutoLISP extensions
Constructs a database (global) reactor object
Enables a disabled reactor object
Tests to determine whether a reactor object is enabled
Produces a beep sound
Constructs an editor reactor that notifies of a command event
Returns the name (symbol) of the current event, if called from within a reactor's
callback
Returns application-specific data associated with a reactor
Overwrites application-specific data associated with a reactor
Constructs an editor reactor object that provides notification of deep clone
events
Constructs a reactor object that provides notification of MDI-related events
Constructs an editor reactor object that provides notification of a drawing event
(for example, opening or closing a drawing file)
Constructs an editor reactor object that notifies of an event related to reading or
writing of a DXF file
Constructs an editor (global) reactor object
Constructs an editor reactor object that notifies of an event related to block
insertion
Constructs a linker (global) reactor object
Constructs an editor reactor object that notifies of a LISP event
Constructs an editor reactor object that does not fall under any of the other
editor reactor types
Constructs an editor reactor object that provides notification of a mouse event
(for example, a double-click)
Determines whether or not a reactor's callback function will execute if its
associated namespace is not active
Constructs an object reactor object
Adds an object to the list of owners of an object reactor
Removes an object from the list of owners of an object reactor
Returns the list of owners of an object reactor
Makes a reactor persistent
Returns a list of persistent reactors in the current drawing
Determines whether or not a reactor is persistent
Makes a reactor transient
Returns a list of all callback conditions for this reactor type
Adds or replaces a callback function in a reactor
Returns a list of pairs ( event-name . callback_function) for the reactor
Returns a list of reactors of the specified types
Disables a reactor
Disables all reactors of the specified type
Defines whether or not a reactor's callback function will execute if its associated
namespace is not active
Constructs an editor reactor object that provides notification of a change to a
system variable
Constructs an editor reactor object that provides notification of a change to the
bitmaps in a toolbar
A pre-defined callback function that prints one or more callback arguments in
the Trace window
Returns a symbol representing the reactor type
Returns a list of all reactor types
Constructs an editor reactor object that provides notification of an undo event
Constructs an editor reactor object that provides notification of an event related
to writing a block
Constructs an editor reactor object that notifies of an event related to moving or
sizing an AutoCAD window
Constructs an editor reactor object that provides notification of an event related
to attaching or modifying XREF
VLX namespace functions
Imports ADS-DEFUN functions into a separate-namespace VLX

Makes a function loaded in a VLX namespace available to the current document


Imports a function that was previously exported from another separate-
namespace VLX
Retrieves the value of a variable from the namespace of the associated
document
Sets the value of a variable in the associated document's namespace
Passes control from a VLX error handler to the *error* function of the associated
document namespace
Returns a value to the document namespace from which the VLX was invoked
Lists all functions exported by the specified application, or all exported functions
if no application is specified
Returns a list of all separate-namespace VLX files associated with the current
document

Unloads a VLX that is loaded in its own namespace (a separate-namespace VLX)


Determines whether a VLX is loaded in its own namespace
Namespace communication functions
Returns the value of a variable from the blackboard namespace
Sets the value of a variable in the blackboard namespace
Loads a file into all open AutoCAD documents, and into any document
subsequently opened during the current AutoCAD session
Copies the value of a variable into all open AutoCAD documents, and into any
document subsequently opened during the current AutoCAD session
Special remarks if any

Functions used to utilize the AutoCAD and other


third-party ActiveX/COM APIs with AutoLISP.
SL. No. Function/Command
1 + (add)
2 - (subtract)
3 = (equal_to)
4 /= (not equal to)
5 / (divide)
6 * (multiply)
7 *error*
8 *pop-error-mode*

9 *push-error-using-command*

10 *push-error-using-stack*

11 > (greater_than)

12 >= (greater_than_or_equal_to)

13 < (less_than)

14 <= (less_than_or_equal_to)
15 ~ (bitwise_not)
16 1- (decrement)
17 1+ (increment)
Description
Returns the sum of all numbers

Subtracts the second and following numbers from the first and returns
the difference
Compares arguments for numerical equality
Divides the first number by the product of the remaining numbers and
returns the quotient
Returns the product of all numbers
A user-definable error-handling function
Error-handling function that ends the previous call to *push-error-
using-command* or *push-error-using-stack*
Error-handling function that indicates the use of the command
function within a custom *error* handler
Error-handling function that indicates the use of variables from the
AutoLISP stack within a custom *error* handler
Returns T if each argument is numerically greater than the argument
to its right; otherwise returns nil
Returns T if each argument is numerically greater than or equal to the
argument to its right; otherwise returns nil
Returns T if each argument is numerically less than the argument to
its right; otherwise nil
Returns T if each argument is numerically less than or equal to the
argument to its right; otherwise returns nil
Returns the bitwise NOT (1's complement) of the argument
Decrements a number by 1
Increments a number by 1
Special remarks if any

These AutoLISP functions all start non-


alphabetic or numeric characters.
SL. No. Function/Command
1 3dsin
2 align
3 cal
4 mirror3d
5 rotate3d
6 solprof
Description
Imports a 3D Studio (.3ds) file
Translates and rotates objects, allowing them to be aligned with other objects
Invokes the on-line geometry calculator and returns the value of the evaluated expression
Reflects selected objects about a user-specified plane
Rotates an object about an arbitrary 3D axis
Creates profile images of three-dimensional solids
Special remarks if any AutoCAD ® commands defined by ObjectARX ®
or AutoLISP ® applications are called externally
defined. AutoLISP applications may need to
access externally defined commands differently
from the way they access built-in AutoLISP
functions. Many externally defined commands
have their own programming interfaces that

S-ar putea să vă placă și