**Detailed Explanation of AutoLISP Functions**
AutoLISP offers a wide range of built-in functions that can be used to perform various tasks in AutoCAD. To call a function, you simply use its name (case-insensitive) as the first element in a list, followed by any required arguments. This chapter provides an alphabetical listing of all basic AutoLISP functions, many of which are standard in LISP programming. Some functions are specifically designed for use within AutoCAD's graphical environment and provide enhanced functionality.
One important system variable is **FLATLAND**, which ensures compatibility between different versions of AutoCAD. When FLATLAND is set to 0, AutoLISP utilizes the latest 3D capabilities. If it is set to a non-zero value, the behavior of certain functions reverts to that of AutoLISP version 9. The following functions are affected by FLATLAND:
- DISTANCE
- GRREAD
- POLAR
- ENTGET
- INITGET
- TBLNEXT
- GETDIST
- INTERS
- TBLSEARCH
- GETPOINT
- OSNAP
Each function’s description includes how FLATLAND influences its operation.
---
**1. (+ Number Number ...)**
This function returns the sum of all the provided numbers. Numbers can be integers or real values. If all inputs are integers, the result is also an integer. However, if at least one number is a real, all others will be converted to real, and the result will be a real number.
Examples:
`(+ 1 2)` returns `3`
`(+ 1 2 3 4.5)` returns `10.5`
`(+ 1 2 3 4.0)` returns `10.0`
---
**2. (- Number Number ...)**
This function subtracts the second number from the first and returns the difference. If more than two numbers are provided, the first number is subtracted from the sum of the rest. If only one number is given, it returns zero minus that number.
Examples:
`(- 50 40)` returns `10`
`(- 50 40.0 2)` returns `8.0`
`(- 50 40.0 2.5)` returns `7.5`
`(- 8)` returns `-8`
---
**3. (* Number Number ...)**
This function multiplies all the provided numbers together. It supports both integers and real numbers, with automatic type conversion based on standard rules.
Examples:
`(* 2 3)` returns `6`
`(* 2 3 4.0)` returns `24.0`
`(* 3 -4.5)` returns `-13.5`
---
**4. (/ Number Number ...)**
This function divides the first number by the second. If multiple numbers are provided, the first is divided by the product of the rest. The result is returned as a real or integer, depending on the input types.
Examples:
`(/ 100 2)` returns `50`
`(/ 100 2.0)` returns `50.0`
`(/ 100 20.0 2)` returns `2.5`
`(/ 135 360)` returns `0`
`(/ 135 360.0)` returns `0.375`
---
**5. (= Atom Atom ...)**
This function checks for equality between atoms. It returns `T` if all specified atoms are equal in value, otherwise `nil`. It works with numbers and strings.
Examples:
`(= 4 4.0)` returns `T`
`(= 20 388)` returns `nil`
`(= "me" "me")` returns `T`
`(= "you" "me")` returns `nil`
---
**6. (/= Atom Atom ...)**
This function checks for inequality. It returns `T` if the first atom is not equal to the second; otherwise, it returns `nil`. Only two atoms are supported.
Examples:
`(/= 10 20)` returns `T`
`(/= "you" "you")` returns `nil`
`(/= 5.43 5.44)` returns `T`
---
**7. (< Atom Atom ...)**
This function checks if the first atom is less than the second. If more than two atoms are provided, each must be less than the next for the result to be `T`.
Examples:
`(< 10 20)` returns `T`
`(< "b" "c")` returns `T`
`(< 357 33.2)` returns `nil`
`(< 2 3 88)` returns `T`
`(< 2 3 4 4)` returns `nil`
---
**8. (<= Atom Atom ...)**
This function checks if the first atom is less than or equal to the second. If multiple atoms are given, each must be less than or equal to the next for the result to be `T`.
Examples:
`(<= 10 20)` returns `T`
`(<= "b" "b")` returns `T`
`(<= 357 33.2)` returns `nil`
`(<= 2 9 9)` returns `T`
`(<= 2 9 4 5)` returns `nil`
---
**9. (> Atom Atom ...)**
This function checks if the first atom is greater than the second. If multiple atoms are given, each must be greater than the next for the result to be `T`.
Examples:
`(> 120 17)` returns `T`
`(> "c" "b")` returns `T`
`(> 3.5 1792)` returns `nil`
`(> 77 4 2)` returns `T`
`(> 77 4 4)` returns `nil`
Ac To Dc Transformer,Ef High Frequency Transformer,Rm 10 Electric Transfomer,110 Volt Transformer
IHUA INDUSTRIES CO.,LTD. , https://www.ihuagroup.com