Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(getreal [prompt])
This describes all of the functions provided by AutoLISP It consists of a synopsis and a catalogue of the functions. In the synopsis, function names are grouped by topic, and each is followed by a brief description. In the catalogue, function names appear in alphabetical order, and the functions are described in detail.
Prompts for user input of a real (floating-point) number. Prompts for user input of a string. Prompts for user input of a point. Prompts for user input of the corner of a rectangle. Prompts for user input of a distance. Prompts for user input of an angle. Similar to getangle, but takes into account the current value of the ANGBASE system variable. Prompts for user input of a keyword. Prompts for user input of an integer.
Synopsis of Functions
(defun sym argument-1ist expr ...)
Defines an external function (Subr).
Error Handling
(*error* string) (alert string)
Prints an error message. Displays a dialogue box alerting the user with string.
Conversion
(rtos number [mode [precision]]) (distof string [mode])
Formats a real (floating-point) value as a string. Converts a string that displays a real value into a real (floating-point) value. Formats an angle as a string. Converts a string that displays an angle into a real (floating-point) value. Converts between real-world units.
(angtos angle [mode [precision]]) (angtof string [mode]) (cvunit value from to)
Geometric Utilities
(distance pt1 pt2) (angle pt1 pt2) (polar pt angle dist)
Finds the distance between two points. Finds the angle between two lines. Finds a point via polar co-ordinates. Finds the intersection of two lines. Returns the diagonal co-ordinates of a box that encloses a text entity.
Display Control
(prin1 [expr [file-desc]]) (princ [expr [file-desc]]) (print [expr [file-desc]]) (prompt msg)
Prints a message on the text screen or to an open file. Prints a message on the text screen or to an open file. Prints a message on the text screen or to an open file. Displays a message on the prompt line. Displays and activates menus.
Page 1
User Input
(initget [bits] [string])
Determines valid user input for the next call to a get xxx function.
(menucmd string)
Redraws the current graphics screen. Displays the current graphics screen. Displays the current text screen. Same as textscr, but clears the text screen first.
(entdel ename) (entnext [ename]) (entlast) (handent handle) (entsel [prompt]) (nentsel [prompt])
Deletes (and undeletes) entities in the drawing. Finds the next entity in the drawing.
Finds the last entity in the drawing. Finds an entity by its handle. Prompts user to select an entity by specifying a point. Like entsel, but returns additional data for nested entities. Similar to nentsel but returns a full 3D 4x4 matrix and enables the program to specify the pick point. Updates the screen image of an entity.
Low-level Graphics
(grclear)
Clears the graphics screen. Draws a vector in the current viewport. Draws multiple vectors in the current viewport. Reads from an input device. Displays text in the menu, mode, or status area of the graphics screen.
(entupd ename)
Selection Sets
(ssget [mode] [pt1 [pt2]] [pt-list] [filter-list]) (ssadd [ename [ss]]) (ssdel ename ss) (sslength ss) (ssname ss index) (ssmemb ename ss)
Gets a selection set. Adds an entity to a selection set (or creates a new set). Deletes an entity from a selection set. Returns the number of entities in a selection set. Returns the name of an entity in a selection set. Checks whether an entity is a member of a selection set.
(xdroom ename)
Symbol Tables
(tblnext table-name [rewind])
Finds the next item in a symbol table. Searches for a symbol in a symbol table.
Entity Handling
(entget ename [applist]) (entmod elist) (entmake [elist])
Gets the definition data of an entity. Modifies the definition data of an entity. Makes a new entity and appends it to the drawing database.
(- number [number ....]) (* number [number ...]) (/ number [number ...]) (~ number) (1+ number)
(1- number) (abs number) (atan num1 [num2]) (cos angle) (exp number) (expt base power) (fix number) (float number)
(gcd num1
Returns number decremented by 1. Returns the absolute value of number. Returns the arctangent of a number in radians. Returns the cosine of an angle. Returns a value raised to the number power (natural antilog). Returns base raised to power. Returns the conversion of a number into an integer. Returns the conversion of a number into a real value. Returns the greatest common denominator of two numbers. Returns the natural log of a number as a real value. Returns the result of a logical bitwise AND of a list of numbers. Returns the result of a logical bitwise inclusive OR of a list of numbers. Returns the logical bitwise shift of a number by a given number of bits. Returns the largest of the numbers given. Returns the smallest of the numbers given. Verifies that I t em is a real or integer and evaluates to a negative value. Evaluates to constant p. Divides two numbers and returns the remainder. Returns the sine of an angle as a real value. Returns the square root of a number as a real value. Verifies that item is a real number or an integer that evaluates to zero.
(atom item)
(atoms-family format [symlist]) (boundp atom) (not item) (null item) (numberp item) (quote expr ...) (set sym expr)
Verifies that item is an atom. Returns a list of previously defined functions. Verifies that a value has been bound to an atom. Verifies that item is nil. Verifies that item is bound to fill. Verifies that item is a real or an integer. Returns an expression unevaluated. Sets the value of a quoted symbol to that of an expression. Sets the value of one or more symbols to that of an expression. Returns the type of I t em.
num2)
(log number)
(logand number number ...) (logior integer ...) (lsh num1 numbits)
Text Strings
(read string) (read-char [file-desc]) (read-line [file-desc])
Returns the first list or atom obtained from the string. Reads a single character from the keyboard or from an open file. Reads a string from the keyboard or from an open file. Returns a copy of a string with all characters converted to upper or lowercase. Returns the concatenation of one or more strings. Returns the length, in characters, of a string. Returns a substring of a string. Writes one character, described by an ASCII code, to the screen or an open file. Writes a string to the screen or to an open file.
(max number number ...) (min number number ...) (minusp item) pi (rem num1 num2 ...) (sin angle) (sqrt number) (zerop item)
Symbol Handling
Page 3
Conversion
(ascii string)
Returns the conversion of the first character of a string into its ASCII character code. Returns the conversion of a string into a real value. 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. Returns the conversion of an integer into a string.
List Manipulation
(append expr) (assoc item alist)
Takes any number of lists and runs them together as one list. Searches an association list using I tern as a key, and returns the associated entry. Returns the first element of a list. Returns a list containing all but the first element of the list. Concatenations up to four levels deep are supported. Returns a list with the new element added to the beginning. Steps through a list and evaluates each expression for every element in the list. Creates a list from any number of expressions.
(itoa int)
(caar list), (cadr list), (cddr list), (cadar list), etc. (cons new-first-element list) (foreach name list expr ...)
Equality/Conditional
(= atom atom . .) (/= atom atom . . (< atom atom ...) (<= atom atom) (> atom atom . . (>= atom atom) (and expr ...)
The equal to relational function. The not equal to relational function. The less than relational function. The less than or equal to relational function. The greater than relational function. The greater than or equal to relational function. Returns the logical AND of a list of expressions. A general bitwise Boolean function. Primary conditional function in Autolisp. Determines whether two expressions are identical. Determines whether two expressions evaluate to the same thing. Conditionally evaluates expressions. Returns the logical OR of a list of expressions. Evaluates each expression a given number of times. Repeats the enclosed expressions while the test expression remains true.
(listp item)
Verifies that Item is a list. Returns a list as the result of executing a function with the elements of lists supplied. 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. Returns a copy of a list with newitem in place of every olditem.
(nth n
list)
(reverse list)
File Handling
(close file-desc)
Closes a file. Loads a file of AutoLISP expressions. Opens a file for access by the AutoLISP I/O functions.
Page 4
Display
(terpri) (vports)
Prints a newline on the screen. Returns a list of viewport descriptors for the current viewport configuration.
Function Handling
(apply function list) (eval expr) (exit)
Executes a function with the arguments given. Returns the result of evaluating any AutoLISP expression. Forces the current application to quit. Defines an anonymous function. Evaluates sequentially. each expression
(lambda arguments expr ...) (progn expr ...) (trace function ...) (quit) (untrace function ...)
Sets the trace flag for the specified functions. Forces the current application to quit. Clears the trace flag for specified functions.
Memory Management
(alloc number) (expand number) (gc) (mem)
Sets the segment size to a given number of nodes. Allocates node space by requesting a specified number of segments. Forces a garbage collection. Displays the current state of AutoLISPs memory.
Miscellaneous
(getenv variable-name) (ver)
Returns the string value assigned to a system environment variable. Returns a string containing the current AutoLISP version.
Page 5
Creating Images
(dimx_tile key) (dimy_tile key) (start_image key)
Retrieves dimensions of the specified tile. Starts creating the specified image. Draws a vector in the currently active image. Draws a filled rectangle in the currently active image. Draws an AutoCAD slide in the currently active image. Ends creation of the currently active image.
(unload_dialog dcl_id)
Initialises a dialogue box and displays it. Begins accepting user input from the dialogue box initialised by the new_dialog call. Terminates the current dialogue box and stops displaying it. Must be called from within an action expression or call-back function. This function also returns the current (X,Y) position of the dialogue box.
(done_dialog [status])
Application-specific Data
(client_data_tile key clientdata)
Associates application managed data with the specified tile.
(term_dialog)
Terminates all current dialogue boxes as if the user had cancelled them.
Page 6