IntelliCAD Developer Reference

You can customize IntelliCAD by adding custom programs written in any of several programming languages that run within IntelliCAD, including LISP and Solutions Development System™ (SDS). With IntelliCAD, you can run many programs originally created for use with AutoCAD. Specifically, you can use programs written entirely in AutoLISP with no modification.

IntelliCAD supports the AutoCAD dialog control language (DCL), which is used by AutoLISP functions to define the look of dialog boxes. You can use all DCL files unmodified within IntelliCAD.

To write applications in C or C++, IntelliCAD uses SDS, a C/C++ language interface compatible with the AutoCAD Development System (ADS) interface in AutoCAD.

For more information about adding custom programs to IntelliCAD in one of the compatible programming languages, click the appropriate link here.

Solutions Development System™ (SDS)

Dialog Control Language (DCL)

List Processing Language (LISP)

Visual Basic for Applications(VBA)


Copying Code Examples from the

Copying Code Examples from the IntelliCAD Programmer's Reference

Most of the Help topics in the IntelliCAD Programmer's Reference contain code examples. You can easily copy these examples into your own code and then further modify them, as desired.

To copy a code example from the Programmer's Reference:

  1. In the Help window, highlight the code you want to copy.
  2. In the Help window, choose Edit | Copy. (Or, press Ctrl + C.)
  3. Paste the code into your programming enviroment, using the appropriate command (usually Edit | Paste, or Ctrl + V).
  4. Delete the copyright notice that is pasted in along with the sample code.
  5. Modify the code, as necessary.

Tell me about...

Programming Overview of LISP

Programming Overview of DCL

Programming Overview of SDS


Programming Overview of LISP (LISt Processing) Language

LISP is an acronym for LISt Processing, a separate programming language that provides hooks into the IntelliCAD program for customization. LISP is similar to AutoLISP. LISP greatly extends the commands and functionality that are available in IntelliCAD.

LISP Functions

Each LISP command performs a function. For example, LISP functions can:

    • Load other LISP, DCL, or SDS programs and IntelliCAD files.
    • Prompt the user for input or alert the user to a situation.
    • Execute standard IntelliCAD commands.
    • Process alphanumeric strings.
    • Perform mathematical calculations.
    • Store values for later use.
    • Read and write files.
    • Test for given conditions and respond accordingly.
    • Select entities in a drawing.
    • Modify entities in a drawing.
    • Print information to the screen or to a file.

By writing programs that combine various LISP functions, you can create custom solutions that extend the CAD tools in IntelliCAD, integrate your drawings with other applications, and automate your work. Using LISP in tandem with IntelliCAD, you can enhance your CAD workstation by creating high-powered add-on applications for any advanced needs appropriate to your specialty, firm, profession, or industry.

NOTE For more information about compatibility between IntelliCAD's implementation of LISP and implementations found in other CAD systems, see LISP Compatibility.

LISP Symbols

Integer Numbers

An integer is a number that lacks the decimal point. For example, the numbers 0, 1, -512, and 9597 are all integers. In LISP, the value of an integer ranges from --2,147,483,648 to +2,147,483,647. When a function causes an integer to exceed that range, it is automatically converted to the opposite sign-i.e., -2,147,483,649 becomes 2,147,483,647. Note that you could think of this as wrapping around, so that when you add -1 to -2,147,483,649, you wrap to a +2,147,483,647, as visualized in the following diagram:

Real Numbers

A real number (also known as a "floating point" number) is a number containing the decimal point. Even though LISP displays a real number with six significant numbers (such as 2.00000), real numbers are stored in double-precision floating-point format. This the same as saying there are 14 significant digits of precision-for example, as in 2.0000000000000.

You will see that very large and very small real numbers are expressed in scientific notation, such as 3.44861E-07, which is the same as 0.000000344861. Real numbers in the range between -1 and 1 must contain a leading zero, such as 0.9, 0.0, and -0.1. LISP predefines pi as a real number with the value of 3.14159. LISP provides many functions for working with and converting real numbers.

NOTE A decimal point must be prefixed by a digit. For example, 0.5 is valid but .5 results in an IntelliCAD error message, "Error: invalid argument list."

Strings

A string is a group of alphanumeric characters surrounded by quotation marks, such as "VPORT" and "Please type your name:". The maximum string IntelliCAD supports is 132 characters long. A string that consists of "" is called empty.

To use control codes (also known as escape codes), use the backslash ( \ ) character as a prefix. For example, \n is the control code for starting a new line. To show a quotation mark within a string, use \", as in "The screw is 1\" long." LISP provides many functions (all those beginning with str, plus numerous others) for manipulating strings.

Entity Names

An entity name is a unique hexadecimal label given to every entity in the drawing, such as <Entity name: 6abc1236> . In LISP, you never work with the actual entity. Rather, you first find out its entity name; then you work with that entity name. LISP uses the term entity rather than object for historical reasons; however, the two words mean the same thing.

Lists

All of LISP consists of lists. A list is comprised of any numbers or text separated by spaces and surrounded by parentheses, such as (1 2 3), (* pi 2), (cen rad), and ("The answer is: " ANS).

A list of two numbers is commonly used as a 2D x,y-coordinates, such as (1.0 2.0). A list of three numbers is commonly used a 3D x,y,z-coordinates, such as (10.0 11.0 12.0). A special kind of list, called the dotted pair, is used to describe entity data, such as (62 . 1). Dotted pair data is very similar to (though not exactly the same as) DXF codes. For example, (62 . 1) means the entity is colored (group code 62) red, color #1. LISP provides many functions (all those beginning with "ent") for examining entity data.

Selection Sets

A selection set is a grouping of one or more entities. LISP provides many functions (all those beginning with the prefix ss) for creating and working with selection sets.

File Descriptors

A file descriptor is a hexadecimal label assigned to a file when it is opened by LISP, such as <File: #82011>. As with entity data, you never refer directly to the file's name; rather, you work with the file descriptor. LISP can open a file for reading, writing, or appending; it can only work with ASCII files (no binary files) and only provides sequential access (no random access).

Tell me about...

Copying Code Examples from the IntelliCAD Programmer’s Reference

Programming Overview of SDS™ (Solutions Development System™)

LISP Compatibility


LISP Compatibility

Functions Unique to IntelliCAD LISP

The following functions are unique to the implementation of LISP included with IntelliCAD:

Function | Comments
Lpad | Pads a text string with spaces to the left.
Rpad | Pads a text string with spaces to the right.
Tan | Returns the tangent.
Trim | Trims spaces from a string.

LISP-Compatible Functions with Enhanced Features

The following LISP functions in IntelliCAD have enhanced features.

Osnap in IntelliCAD supports these additional entity snap modes:

Mode | Meaning
"po" | POint
"pla" | PLAnview (2D intersection)
"vis" | VISible (apparent intersection)

The functions ssget and ssadd in IntelliCAD recognize these additional selection set parameters:

Mode | Meaning | Points | Example
"CC" | Crossing Circle | point1 point2 | (ssget "CC" '(1 1) '(2 2))
"O" | Outside | points-list | (ssget "O" ptlist)
"OC" | Outside Circle | point1 point2 | (ssget "OC" '(1 1) '(2 2))
"OP" | Outside Polygon | points-list | (ssget "OP" ptlist)
"PO" | POint | point1 | (ssget "PO" '(1 1))

Functions Partially Compatible with LISP in Other CAD Systems

The following function is partially compatible with the LISP found in other CAD systems:

Function | Comments
menucmd | IntelliCAD supports P0 (cursor menu) and P1 through P16 (the pulldown menus). IntelliCAD does not support A (aux menus), B (button menus), I (icon menus), M (diesel expressions), S (screen menu), or T (tablet menus).

Functions Not Supported by IntelliCAD

IntelliCAD does not support the following functions found in other CAD systems: arx, arxload, arxunload, autoarxload, entgetx, initdia, ssnamex, and tablet.

Tell me about...

Copying Code Examples from the IntelliCAD Programmer’s Reference

Programming Overview of LISP (LISt Processing) Language


(+ number1 number2 ...)

Add all these numbers together.

This function returns the sum of all numbers. You can use real numbers or integers. Adding all integer numbers returns an integer number. When there is a combination of real numbers and integers, the result is a real number.

Examples

This expression | Returns
(+ 6 7) | 13
(+ 8 7.25) | 15.2500
(+ 12 24 18) | 54
(+) | 0
(+ 2) | 2

Tell me about...

(1- number)

(1+ number)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(- number1 number2 ...)

Subtract all following numbers from the first number.

This function returns the difference between the numbers. When you have only two numbers, the function subtracts number2 from number1. If there are more than two numbers, subtract the sum of the second through the last number (number2 through numbern) from the first, number1.

Examples

This expression | Returns
(- 5 2) | 3
(- 6 [-5]) | 11
(- 9 3 11) | 5
(-) | 0
(- 2) | -2
(- 4 1.0) | 3.00000

Tell me about...

(+ number1 number2 ...)

(1- number)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(* number1 number2 ...)

Multiply all numbers together.

The multiply function returns the product of all numbers. You can use real numbers or integers.

Multiplying all real numbers returns a real number. The same is true for integers; multiplying all integers returns an integer. However, when there is a combination of real numbers and integers, the result is a real number.

Examples

This expression | Returns
(* 7 11) | 77
(* 8 3.2 9) | 230.400
(* 80 3.2 90) | 23040.0
(*) | 0
(* 2) | 2
(* 2 -3) | -6

Tell me about...

(/ number1 number2 ...)

(fix number)

(float number)

(rem number1 number2 [number3 ...])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility


(/ number1 number2 ...)

Divide the first number by the following numbers.

This function returns the quotient between the two numbers. If you have two numbers, divide number1 by the number2. If there are more than two numbers, divide the number1 by the product of all the following numbers.

You can use real numbers or integers. Dividing all real numbers returns a real number. The same is true for integers; dividing all integers returns an integer. However if there is a combination of real numbers and integers, the integers are recognized as real, and the result is a real number.

Examples

This expression | Returns
(/ 8 4) | 2
(/ 6.0 12 5) | 0.100000
(/ 600.0 5) | 120.000
(/ 8 10 5) | 0
(/ 6 -3) | -2
(/) | 0
(/ 0.5) | 0.500000

NOTE A decimal point must be prefixed by a digit. For example, 0.5 is valid but .5 results in the IntelliCAD message, "Error: invalid argument list."

Tell me about...

(* number1 number2 ...)

(fix number)

(float number)

(rem number1 number2 [number3 ...])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(= item1 item2 ...)

Return T if they're the same.

This function tells you whether two (or more) items are equal:

    • If they are equal, the result is a T (true).
    • If not, this function returns nil (false).

If the function contains more than two items, this function returns T (true) when each item to the right is equal to the item on its left. The items can be numbers or strings.

Examples

This expression | Returns
(= 8 8) | T
(= 10 10.0 10) | T
(= "x" "y") | nil
(= "door" "door") | T
(= "door" "door" "door") | T
(= 10) | T

NOTES

    • Don't confuse the = function with the equal function. Here's the difference: The = function compares numbers and strings; the equal function compares lists.
    • Both = and equal perform comparisons; neither performs the "equals" function you might expect from arithmetic, such as 1 + 2 = 3. In LISP, that service is provided by the setq function.

Tell me about...

(/= item1 item2 ...)

(< item1 item2 ...)

(<= item1 item2 ...)

(> item1 item2 ...)

(>= item1 item2 ...)

(cond (statement1 result1 ...) ...)

(eq statement1 statement2)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(~ number)

Apply the 1s compliment.

This function returns the bitwise NOT of a number. The number must be an integer.

Examples

This expression | Returns
(~ 10) | -11
(~ 0) | -1
(~ -25) | 24

Tell me about...

(and expression ...)

(not item)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(/= item1 item2 ...)

The two aren't equal.

This function tells you if two items are not equal:

    • If item1 does not equal item2, this function returns a T (true).
    • If the two items are equal, this function returns nil (false).

When more than two items are given, each item must be different to return a T. The items can be numbers or strings.

Examples

This expression | Returns
(/= 5 4) | T
(/= 8.0 8) | nil
(/= "x" "x" "x") | nil
(/= "x" "x" "y") | nil
(/= "x" "y" "z") | T
(/= 5) | T

NOTE Comparison statements (such as = (equal to operator) and < (less than operator) are typically used together with conditional statements, such as if...then, while, and cond. The comparisons let you test a pair of conditions (for example, does i= 0) to know when to exit the conditional (for example, while i > 0).

Tell me about...

(< item1 item2 ...)

(<= item1 item2 ...)

(= item1 item2 ...)

(> item1 item2 ...)

(>= item1 item2 ...)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(< item1 item2 ...)

The first is less than the others.

The less-than function returns a T (true) or a nil (false):

    • If the item1 is less than item2 (and so on), this function returns a T.
    • If item2 is greater or equal to the first, this function returns nil.

If this function contains more than two items, the function returns T when each item to the right is less than the item on its left. The items can be numbers or strings.

Examples

This expression | Returns
(< 9 11) | T
(< 25 20) | nil
(< 2 6 7) | T
(< 2) | T
(< -2) | T
(< "x" "x") | nil
(< "x" "y" "z") | T

NOTE This function is the opposite of the >=(Greater Than or Equal To operator) function.

Tell me about...

(<= item1 item2 ...)

(= item1 item2 ...)

(> item1 item2 ...)

(>= item1 item2 ...)

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(<= item1 item2 ...)

The first is less than or equal to the others.

This function is the less-than or equal-to operator:

    • If item1 is less than or equal to item2, this function returns a T (true).
    • If item1 is greater than item2, this function returns nil (false).

If this function contains more than two items, the function returns T when each item to the right is less-than or equal to the item on its left. The items can be numbers or strings.

Examples

This expression | Returns
(<= 8 12) | T
(<= 7 16 16) | T
(<= 7) | T
(<= "x" "x" "z") | T
(<= "x" "y" "x") | nil

NOTE This function is the opposite of the > (Greater Than operator) function.

Tell me about...

(/= item1 item2 ...)

(< item1 item2 ...)

(= item1 item2 ...)

(> item1 item2 ...)

(>= item1 item2 ...)

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(> item1 item2 ...)

The first is greater than the others .

The greater-than function displays a T (true) or a nil (false):

    • If the first item is greater than the second item (and so on), this function returns a T.
    • If the second item is less than or equal to the first, this function returns nil.

If this function contains more than two items, the function returns T when each item to the right is greater than the item to its left. The items can be numbers or strings.

Examples

This expression | Returns
(> 6 4.9) | T
(> 7 8) | nil
(> 6 4 4) | nil
(> 6) | T
(> "y" "x") | T

NOTE This function is the opposite of the <= (Less Than or Equal To operator) function.

Tell me about...

(/= item1 item2 ...)

(< item1 item2 ...)

(= item1 item2 ...)

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(>= item1 item2 ...)

The first is greater than or equal to the others.

This function is the greater-than or equal-to operator:

    • If item1 is greater than or equal to item2, this function returns a T (true).
    • If it is less than, this function returns nil (false).

If this function contains more than two items, the function returns T when each item to the right is greater-than or equal to the item on its left. The items can be numbers or strings.

Examples

This expression | Returns
(>= 3.1 3.0) | T
(>= 6 5 5) | T
(>= 6) | T
(>= "x" "y" "z") | nil

NOTE This function is the opposite of the < (Less Than operator) function.

Tell me about...

(/= item1 item2 ...)

(<= item1 item2 ...)

(= item1 item2 ...)

(> item1 item2 ...)

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(1+ number)

Add 1 to the number.

This function adds 1 to the number. You can use a real number or an integer. This function takes exactly one argument.

Examples

This expression | Returns
(1+ 22) | 23
(1+ 5.02) | 6.02000
(1+ -36) | -35

NOTE This function is useful as an increment counter.

Tell me about...

(+ number1 number2 ...)

(1- number)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(1- number)

Subtract 1 from the number.

This function subtracts 1 from the number. You can use a real number or an integer. This function takes exactly one argument.

Examples

This expression | Returns
(1- 8) | 7
(1- 9.75) | 8.75000
(1- -18) | -19

NOTE This function is useful as an decrement counter.

Tell me about...

(- number1 number2 ...)

(1+ number)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(abs number)

Specify that number's distance from 0 (zero), disregarding direction (positive or negative).

This function returns the absolute value of the number. You can use a real number or an integer. This function takes exactly one argument.

Examples

Code | Returns
(abs 56) | 56
(abs -2.3) | 2.30000
(abs -49) | 49

NOTES

    • Use this function to convert a negative number to a positive number, or to ensure the number is positive.
    • When you need to make sure a number is negative, first apply the abs function, and then subtract the number from 0.

Tell me about...

(fix number)

(float number)

(minusp number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(acad_colordlg color-number [flag])

Display the Select Color dialog box.

This function displays the Color dialog box. This function returns the color number that the user selects from the dialog box or nil when the user clicks the Cancel button.

The function accepts two optional arguments:

Argument | Meaning | Example | Range
color-number | Color Number | 1 | 0 - 256
flag | Flag | nil | nil or true (which is the same as not using the flag)

NOTES

    • The color-number argument lets you provide a default color. When clrno is 0, the default is BYBLOCK; when clrno is 256, the default is BYLAYER.
    • When nil, the dialog box disables the BYBLOCK and BYLAYER buttons.

Examples

Code | Result
(acad_colordlg 1) | Displays dialog box with color 1 (red) selected as the default.
(acad_colordlg 1 nil) | Displays dialog box with color 1 (red) selected as the default, and the BYBLOCK and BYLAYER buttons are disabled.

NOTE The first eight color numbers have the following meanings:

Number | Color
1 | Red
2 | Yellow
3 | Green
4 | Cyan (light blue)
5 | Blue
6 | Magenta (pink)
7 | Black
8 | Gray

Tell me about...

(command cmd [arguments] ...)

(getvar sysvar)

(help [filename [topic [flag]]])

(setvar sysvar value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(acad_strlsort list)

Sort strings in alphabetical order.

This function sorts the list of strings in alphabetical order. The list contains one or more strings, which have been previously defined or returned with the quote (') function.

Examples

Code | Returns
(acad_strlsort '("ssg" "hlg" "kng")) | ("hlg" "kng" "ssg")
(setq holiday '("Sun" "Mon" "Sat")) (acad_strlsort holiday) | ("Mon" "Sat" "Sun")

NOTE The ' (quote) prefix is actually a LISP function that prevents another LISP function from evaluating the list.

Tell me about...

(list expression …)

(listp item)

(reverse list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(action_tile key expression)

Respond when the user clicks a dialog box tile.

This function assigns the expression to evaluate when the user selects the tile referenced by key. Both expression and key are strings; key is case-sensitive. Expression is typically another LISP function; key refers to the tile. This function operates on tiles that are user-selectable elements of a dialog box, such as radio buttons, check boxes, or buttons.

The expression refers to the tile, using the following arguments:

Argument | Meaning
$value | Current value
$key | Tile name
$data | Application specific data
$reason | Callback reason
$x | Image x-coordinate
$y | Image y-coordinate

Example

Code | Returns
(action_tile "xpt" x_coord) | nil

NOTES

    • The expression assigned by action_tile overrules the default action of the dialog box (which is assigned via the new_dialog function) and the tile's action attribute.
    • The command function cannot be called by action_tile.

Tell me about...

(client_data_table key data)

LISP Compatibility

Programming Overview of DCL (Dialog Control Language)

Programming Overview of LISP (LISt Processing) Language


(add_list string)

Add some text to an existing dialog box string.

This function adds (or replaces) a string in the currently active dialog box. This function must follow the start_list function, which determines: (1) which string is affected; and (2) whether the string is added to or replaces another string.

Example

See start_list for example usage.

NOTE You also use this function when creating list boxes and drop-down list boxes in DCL. For examples using this function in conjunction with DCL, see list_box and popup_list (drop-down list box).

Tell me about...

(end_list)

LISP Compatibility

Programming Overview of DCL (Dialog Control Language)

Programming Overview of LISP (LISt Processing) Language


(ads)

Check what SDS™ applications are loaded into IntelliCAD.

This function tells you the names of SDS applications currently loaded into IntelliCAD. The name includes the complete path. The names of all SDS applications are strings, forming a list.

Examples

Code | Returns
(ads) | nil (When no SDS apps are loaded.)
(ads) | ("tower" "c:\\intellicad\\endpoint")

Tell me about...

(xload appname [flag])

(xunload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(alert string)

Display this alert for the user.

This function displays a dialog box with your string (a custom message) and the OK button. To display more than one line of text, use the new-line character (\n) in the string. to separate lines of text.

Examples

Code | Returns
(alert "You must select an option") | You must select an option
(alert "Select an option: \n M or F") | Select an option: M or F

NOTE Since all dialog boxes must accommodate small, 640 x 480-pixel displays, it's a good idea to keep the alert text brief and to the point.

Tell me about...

(*error* string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(alloc integer)

Set the memory segment size for LISP.

This function sets the number of segments (a measurement of memory) for LISP operations, as specified by integer. The function returns the amount of memory previously allocated, as shown by the examples below.

Examples

Code | Returns
(alloc 2) | 514
(alloc 0) | 2
(alloc 512) | 0

Tell me about...

(expand integer)

(gc)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(and expression ...)

Apply the logical AND.

This function performs a logical AND to the expression that precedes it. If both statements return T (true), the and function returns T. If either or both of the statements returns nil (false) the and function returns nil.

Examples

Code | Returns
(setq d 9) (and (> d 12) (< d 13)) | nil
(setq d 12.25) (and (> d 12) (< d 13)) | T

Tell me about...

(~ number)

(boole function integer1 integer2 ...)

(not item)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(angle point1 point2)

Determine the angle between these points.

This function returns the angle between point1 and point2 in the current UCS. The first point determines the line parallel to the x-axis. When point2 is plotted and connected to point1, the resulting angle is returned in radians.

Examples

Code | Returns
(angle '(1 1) '(3 3)) | 0.7854
(angle '(2.0 3.3 1.3) '(5.2 8.9 6.0)) | 1.0517

NOTES

  • This function is different from the getangle function. Getangle prompts the user to select two points defining an angle.
  • LISP always measures all angles in radians. Use the following LISP function to convert degrees to radians:

    • (defun dtor (d)

    (* PI (/ d 180.0)

    )

    Tell me about...

    (angtof string [mode])

    (angtos angle [mode [precision]])

    (polar point angle distance)

    (rtos number [mode [precision]])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(angtof string [mode])

Change this angle to a real number.

This function converts a string that contains an angle to a real number in radian format. The optional mode specifies the format of the "number" in the string:

Mode value | String format
0 | Decimal degrees
1 | Degrees-minutes-seconds
2 | Grad
3 | Radian
4 | Surveyor's units

NOTE This command fails if the text of the string is not recognizable as an angle measurement.

Examples

Code | Returns
(angtof "90") | 1.57080
(angtof "90" 0) | 1.57080
(angtof "90d30'10\"") | 1.57957

NOTES

    • The backslash denotes that there is a quote within the string. When LISP sees the second quote, it knows this is the end of the string.
    • The angtof function is the opposite of the angtos function.

Tell me about...

(angle point1 point2)

(getangle [point] [prompt])

(polar point angle distance)

(rtos number [mode [precision]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(angtos angle [mode [precision]])

Convert this absolute angle to a string, relative to angbase.

The angtos function converts the angle in radians to strings. This is similar to the rtos function, but angtos converts angles to strings rather than converting numbers to strings. The optional mode argument (0 through 4) selects the format of the string:

Mode | Description | Example
0 | Decimal degrees | 360d
1 | Deg-min-sec | 47d29'15"
2 | Grad | 132g
3 | Radian | 6.28r
4 | Surveyor's units | N 82d W

NOTE The optional precision argument allows you to select the number of places after the decimal point. The range is from 0 to 15.

Examples

Code | Returns
(angtos 1.570796) | "90"
(angtos 1.570796 2 4) | "100.0000g"
(angtos 0.654932 1 3) | '37d31'29""

Tell me about...

(angle point1 point2)

(angtof string [mode])

(polar point angle distance)

(rtos number [mode [precision]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(append list1 list2 ...)

Add everything in this list to an existing list.

This function adds list2 to list1. The list2 element is a list of a single item. You can append multiple lists.

Examples

Code | Returns
(setq m '(A B C D E F)) | (A B C D E F)
(append m '(G)) | (A B C D E F G)
(setq m (append m '(G H I) (LIST 1 2 3))) | (A B C D E F G H I 1 2 3)
(append) | nil

Tell me about...

(acad_strlsort list)

(length list)

(listp item)

(nth integer list)

(reverse list)

(substr string start [length])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(apply function list)

Make list do what func says.

This function performs a function to the list. The first argument, function, is either a pre-defined or user-defined function with a quote (') preceding it. The second argument must be a list. This function is useful when building a list dynamically.

Examples

Code | Returns
(apply '/ '(10 5)) | 2
(apply '> '(6 7)) | nil

Notice that the following are equivalent to the previous examples:

Code | Returns
(/ 10 5) | 2
(> 6 7) | nil

Tell me about...

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(lambda arguments expression ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ascii string)

Convert the first character of str to ASCII.

This function converts the first character of the string to its numerical ASCII code.

Examples

Code | Returns:
(ascii "X") | 88
(ascii "x") | 120
(ascii "Fun") | 70
(ascii "FUN") | 70

Tell me about...

(angtof string [mode])

(atof string)

(atoi string)

(chr integer)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(assoc item list)

Find the first matching item in the list.

This function finds and returns the first sublist in list whose first element matches the association item. The list may contain dotted pairs from the cons and entget functions.

Examples

Code | Returns
(setq bigl '((a b c)(d)(e f g))) (assoc 'e bigl) | (E F G)
(setq elist (entget (car (entsel "Select entity:")))) (princ (strcat "\nYou selected a " (cdr (assoc 0 elist)))) |

NOTE This function is often used in conjunction with the dotted pairs returned by the cons and entget functions.

Tell me about...

(length list)

(mapcar function list1 [list2 ...])

(member item list)

(nth integer list)

(subst new old list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(atan number1 [number2])

Calculate the arctangent.

This function returns the principle arc tangent of the quotient number1 divided by number2. If number2 is not supplied, it is assumed to be 1.0, thus returning the principle arctan of number1. The value returned is always between -pi/2 and pi/2 radians.

Examples

Code | Returns
(atan 0.25) | 0.24498
(atan -2) | -1.10715
(atan 1.0 0.75) | 0.927295

Tell me about...

(cos angle)

(sin angle)

(tan angle)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(atof string)

Convert the string to a real number.

This function converts a string into a real number. This command returns 0.0 if the text of the string is not recognizable as a number.

Examples

Code | Returns
(atof "59") | 59.0
(atof "213.35") | 213.350
(atof ".1") | 0.100000
(atof "Hello") | 0.000000

Tell me about...

(angtof string [mode])

(ascii string)

(atoi string)

(chr integer)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(atoi string)

Convert the string to an integer.

The atoi function converts a string into an integer. If the string contains numbers after the decimal point, it truncates them. This command returns 0 if the text of the string is not recognizable as a number.

Examples

Code | Returns
(atoi "-25") | -25
(atoi "37.8") | 37
(atoi "Hello") | 0

Tell me about...

(angtof string [mode])

(ascii string)

(atof string)

(chr integer)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(atom item)

Determine whether or not an item is an atom.

Generally, an atom is considered a number or a variable. More specifically, it is anything other than a list. The atom function tests item to see if it is an atom. If item is a list, a nil is returned. If it is not a list, a T is returned.

Examples

Code | Returns
(atom '(1 2 3)) | nil
(atom 5) | T
(atom '5) | T

Tell me about...

(atoms-family format [symbol1 symbol2 ...])

(listp item)

(numberp item)

(type item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(atoms-family format [symbol1 symbol2 ...])

Determine which function names are being used.

This function lists all the pre-defined and user-defined functions in the current session. The format argument specifies how the information is returned. Format is an integer value of 0 or 1.

Format | Meaning
0 | Defined functions are returned as a list.
1 | Defined functions are returned as a list of strings.

The optional argument [symbol1symbol2 ...] is a list of strings representing symbols. It is used to confirm whether the function names are defined in the current session. If symbol1, symbol2, ... are defined, LISP returns the symbols as strings, depending on the format chosen. If one is not defined, a nil is returned in place of the symbol.

Examples

Code | Returns
(setq hi "Greeting 1") |
(setq bye "Greeting 2") |
(atoms-family 0 '("hi" "bye")) | (HI BYE)
(atoms-family 0 '("hi" "hello" "bye")) | (HI nil BYE)
(atoms-family 1 '("hi" "bye")) | ("HI" "BYE")

Tell me about...

(atom item)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(lambda arguments expression ...)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(autoload application list)

Automatically load the LISP application when one of its commands is used.

This function returns associates a list of command names with an application name. Then, when the user types a command name, IntelliCAD searches for and loads the associated LSP file.

Example

Code | Returns
(autoload "routine" '("start" "run" "stop")) | nil

Tell me about...

(autoxload application list)

(load filename [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(autoxload application list)

Automatically load the SDS™ application when one of its commands is used.

This function returns associates a list of command names with an application name. Then, when the user types a command name, IntelliCAD searches for and loads the associated SDS file.

Example

Code | Returns
(autoxload "routine" '("start" "run" "stop")) | nil

Tell me about...

(abs number)

(xload appname [flag])

(xunload appname [flag])

Programming Overview of LISP (LISt Processing) Language


(boole function integer1 integer2 ...)

Apply the bitwise Boolean function.

This function applies the bitwise Boolean function. The function argument is an integer between 0 and 15; it represents the 16 possible Boolean functions in two variables. Each bit of integer1 is paired with the corresponding bit of integer2.

The following shows the Boolean truth table:

integer1 | integer2 | function
1 | 1 | 1
1 | 0 | 2
0 | 1 | 4
0 | 0 | 8

The following values of function are the AND, XOR, OR, and NOR Boolean operators:

Function | Operation | Resulting bit is 1 when
1 | AND | Both input bits are 1.
6 | XOR | Only one of the two input bits is 1.
7 | OR | Either or both of the input bits are 1.
8 | NOR | Both input bits are 0 (1's complement).

Examples

Code | Returns
Logical AND: (boole 1 10 9) | 8
Logical XOR: (boole 6 10 9) | 3
Logical OR (boole 7 10 9) | 11
Logical NOR: (boole 8 10 9) | -12

Tell me about...

(~ number)

(and expression ...)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(boundp item)

Determine whether an item has a value.

The boundp function determines if item has a corresponding value bound to it. If item does have a value bound to it, LISP returns T. If not, or if item is bound to nil, a nil is returned.

Examples

Code | Returns
(setq x nil y 7) |
(boundp 'x) | nil
(boundp 'y) | T
(boundp 'z) | nil

NOTE The boundp function is the opposite of the null function.

Tell me about...

(atom item)

(atoms-family format [symbol1 symbol2 ...])

(numberp item)

(setq symbol1 statement1 [symbol2 statement2] ...)

(type item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(car list)

Get the first item of the list.

This function takes a list apart and returns the first element of the list. For example, if you had a list of points such as (1.0 2.0 3.0), the car function would return the first element of the list, or 1.0.

Example

Code | Returns
(setq a '("first" "second" "third") | ("first" "second" "third")
(setq b (car a)) | "FIRST"

Tell me about...

(append list1 list2 ...)

(cdr list)

(cons item list)

(last list)

(length list)

(list expression …)

(reverse list)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(cdr list)

Get everything in the list except the first item.

This is the secondary function for taking a list apart. Like the car function, this function returns a portion of the string. This portion includes the second element of the list, along with any remaining elements. For example, if your list contained the points (5.0 3.0 1.0), then using the cdr function would return 3.0 1.0.

Examples

Code | Returns
(setq a '("one" "two" "three" "four") | ("one" "two" "three" "four")
(setq b (cdr a)) | ("TWO" "THREE" "FOUR")

NOTE The a of car and the d of cdr can be combined to create a whole host of cadr possibilities:

caaaar | cadaar | cdaaar | cddaar
caaadr | cadadr | cdaadr | cddadr
caaar | cadar | cdaar | cddar
caadar | caddar | cdadar | cdddar
caaddr | cadddr | cdaddr | cddddr
caadr | caddr | cdadr | cdddr
caar | cadr | cdar | cddr

Tell me about...

(append list1 list2 ...)

(cons item list)

(last list)

(length list)

(list expression …)

(reverse list)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(chr integer)

Convert this integer to ASCII.

The chr function converts an ASCII code into the corresponding character. The ASCII code is an integer.

Examples

Code | Returns
(chr 88) | "X"
(chr 120) | "x"
(chr 0) | ""
(chr 2) | "/002"

(ascii string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(client_data_table key data)

Associate data with a dialog box tile.

This function associates user-defined data with a dialog box tile. The key specifies the tile; key is a case-sensitive string. The data is a string that specifies the data, which can be referred as $data.

Tell me about...

(action_tile key expression)

(dimx_tile key)

(dimy_tile key)

(get_attr key attribute)

(get_tile key)

(mode_tile key mode)

(set_tile key value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(close file-descriptor)

Close an open file.

This function closes access to a file that has been previously opened with the open function. Strictly speaking, it is not necessary to close files, since IntelliCAD does that when it exits. However, for good housekeeping, it's a good idea to use the close function.

The file-descriptor argument represents the file descriptor assigned when the file was opened using the open function. The file descriptor remains after the file is closed but is not valid.

Example

Code | Returns
(close fil) | nil

NOTE The file-descriptor must be assigned to a symbol using setq , so the symbol must be used with the close function as the file-descriptor.

Tell me about...

(print [expression [file-descriptor]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(command cmd [arguments] ...)

Carry out this IntelliCAD command.

With this function, you can use any IntelliCAD command within a LISP program. Any of the arguments that follow will be used for that command. Any input needed should be stored as variables using setq. Points should be assigned to variables after using the function getpoint.

Some commands continue past the points you have specified. To exit from a command, type a space within quotes to represent an Enter, thus ending the command.

Examples

Code | Results
(command "arc" '(0 0) '(2 4) '(8 20)) | Using preset points.
(command "arc" p1 p2 p3) | Using preset variables.
(command "line" p1 p2 p3 " ") | Space to end the command.

Tell me about...

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(help [filename [topic [flag]]])

(menucmd string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(cond (statement1 result1 ...) ...)

Do it, if it's true.

This function is a commonly used conditional in LISP. If statement1 evaluates to true, any functions that follow within that block are performed, and the result of the last function is returned.

    • If statement1 evaluates to nil, LISP continues to statement2. If true, it follows the same procedure.
    • If false (or nil), LISP continues to search for a true statement.
    • If no true statements are found, a nil is returned.
    • If there are no result functions in the block, the result of the condition is returned.

Examples

Code | Results
(cond ((zerop x) 0) | (T nil))

In the previous example, the cond function looks at ( zerop x) and decides if it is not nil. If so, it returns zero (0). If not, it moves to the second test, (T nil). This test is already true (T) and would return a nil. Look at the following setqs of actual examples of the above condition.

Code | Results
(setq x 8) | nil
(setq x 0) | 0

In the next example, if d is set to 5, LISP returns the string "Equal to." If set to 6, it returns "Greater than."

Code
(cond ((< d 5) "Less than")
((= d 5) "Equal to")
((> d 5) "Greater than")
)

Tell me about...

(if test statement1 [statement2])

(repeat number statement1 [statement2 ...])

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(cons item list)

Add this item to the beginning of the list.

This function constructs a new list using separate elements. This function also enables you to create a dotted pair, used by IntelliCAD to access entity data. A dotted-pair is created only when the function is used to join two individual items together in the form (cons item item).

The first argument, item, is the item which will be added to the beginning of the list. The item may be a list itself, but will still be treated in the list as a single item.

Examples

Code | Returns
(cons 'a '(b c d)) | (A B C D)
(cons 'a 'b) | (A . B) (Dotted pair)
(cons '(a b) '(c d)) | ((A B) C D)

Tell me about...

(append list1 list2 ...)

(length list)

(member item list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(cos angle)

Calculate the cosine.

This function returns the cosine of an angle. The angle must be in radian form, and the result is a real number.

Examples

Code | Returns
(cos pi) | -1.000000
(cos 1.5) | 0.0707372
(cos (/ pi 2)) | 0.000000

Tell me about...

(atan number1 [number2])

(sin angle)

(tan angle)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(cvunit value from to)

Convert this unit to that unit.

This function converts the value from one type of measurement to another. The value is the number you want to convert. The from and to arguments convert from one unit to another.

For example, (cvunit 10 "hour" "day") converts from hours to days). If the two units of measurement are incompatible, a nil is returned.

The units of measurements are found in the icad.unt file. For more information on customizing this file, see Chapter 17, "Customizing IntelliCAD," in the IntelliCAD User's Guide.

Examples

Code | Returns
(cvunit 1 "day" "second") | 86400.0
(cvunit 2 "meter" "yard") | 2.1872
(cvunit '(2 3) "mile" "feet") | (10560.0 15840.0)

NOTE Points (or lists of numbers) can be converted, too, as shown by the above examples.

Tell me about...

(angtof string [mode])

(angtos angle [mode [precision]])

(ascii string)

(atof string)

(atoi string)

(chr integer)

(distof string [mode])

(fix number)

(float number)

(itoa integer)

(rtos number [mode [precision]])

(strcase string [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

Create a LISP function.

When you write a LISP file, the file itself is not actually the function. Rather, one LISP file contains one or more functions (or programs) that are all available when the file is loaded with the load function.

The name of a function must be defined in the first statement using the defun function. This function is the first actual command within the program. It begins with an open parenthesis, which closes at the end of the program.

The defun function is followed by the name of your function or program. Once a name is selected, you have a few choices:

  • First, you can do nothing by adding ( ). This indicates that any variables used in the program are global, meaning they don't lose their value once the program ends. For example, the variable A defined as 12 would be 12 for any other program in the LISP file as well:

    • (defun newfunc ( )

    ...

    )

  • Another option is to make all variables local to the program. For instance, if you defined N to equal 15, it would be 15 only for this particular program while it is running. To show that the variable is local, precede it with a forward slash (/) after the name of the program:

    • (defun newfunc ( / N)

    ...

    )

  • Sometimes you may want to pass an argument to the program. This means that the variable will be assigned a value from outside of the currently running program. Place these variables before the slash:

    • (defun newfunc (A / N)

    ...

    )

Once your function is defined with all its variables, you can choose to use the C: option. Prefixing the C: to the function name enables the command name to be entered without parenthesis at the command prompt of IntelliCAD. This makes it look like any other IntelliCAD command such as Line, Arc, and Circle.

(defun C:newfunc ( A / N)

...

)

NOTE The C: has nothing to do with your computer's C: drive. In LISP, it is short for "command" and tells IntelliCAD to treat the LISP function like an IntelliCAD command.

Following the lists of variables, the expression that will make up the body of the program must be entered before the closing parenthesis.

Examples

Code | Results:
(defun newfunc ( ) . . .) | May use global variables.
(defun newfunc (var1 var2). . . ) | Newfunc receives two outside values.
(defun newfunc (/ var1 var2). . .) | Newfunc has two local variables.

Tell me about...

(ads)

(atoms-family format [symbol1 symbol2 ...])

(command cmd [arguments] ...)

(menucmd string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(dimx_tile key)

Determine the x-dimension of a dialog box tile.

This function, together with dimy_tile function, returns the dimensions of the tile with the name key. The x,y dimensions are typically used by other dialog box functions, such as vector_image.

Example

Code | Returns
(dimx_tile "pickbox_image") | 20
(dimy_tile "pickbox_image") | 15

NOTES

  • The dimension returned is one less than the size, since the dimension begins at 0. Thus, for the example above, the size of the tile is 16 x 16.
  • The key is a case-sensitive string.

    • Tell me about...

    (fill_image x y width height color)

    (slide_image x y width height slide)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dictadd ename symbol newobj)

Add a nongraphical object to a dictionary.

The dictadd function adds an object (newobj) to a dictionary (ename), where symbol is the key name of the object being added to the dictionary. Each symbol must be a unique name that does not already exist in the dictionary. Each object added to a dictionary must be unique to that dictionary.

    Example

    ; Create an entity list

    (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

    ; Create an entity from entity list

    :(setq xname (entmakex dictionary))

    ; Get the named object dictionary

    (setq nmdict (namedobjdict))

    ; Add a record to dictionary table

    (setq newdict (dictadd nmdict "MY_DICTIONARY" xname))

    ; Create an entity list

    (setq datalist (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) '((1 . "MY_DATA") (10 1. 2. 3.) (70 . 33))))

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record and return the entity name of the object added to the dictionary.

    (dictadd newdict "DATA_RECORD" xname)

    Tell me about...

    (dictnext)

    (dictremove)

    (dictrename)

    (dictsearch)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dictnext ename [rewind])

Find the next item in a dictionary.

The dictnext function searches a dictionary (ename) to find the next item in the dictionary. If the parameter rewind is present and is not nil, the dictionary is rewound and the first entry in it is retrieved.

    Example

    ; Create an entity list

    (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

    ; Create an entity from entity list

    (setq xname (entmakex dictionary))

    ; Get the named object dictionary

    (setq nmdict (namedobjdict))

    ; Add a record to dictionary table and returns the entity name of the object added

    (setq newdict (dictadd nmdict "MY_DICTIONARY" xname))

    ; Create an entity list

    (setq datalist (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) '((1 . "MY_DATA") (10 1. 2. 3.) (70 . 33))))

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record to dictionary table and returns the entity name of the object added

    (dictadd newdict "FIRST_DATA_RECORD" xname)

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record to dictionary table.

    (dictadd newdict "SECOND_DATA_RECORD" xname)

    ; Returns entity name of FIRST_DATA_RECORD

    (cdr (car (dictnext newdict)))

    ; Returns entity name of SECOND_DATA_RECORD

    (cdr (car (dictnext newdict)))

    ; Returns nil as there are no more records

    (cdr (car (dictnext newdict)))

    ; Rewinds and so returns entity name of FIRST_DATA_RECORD

    (cdr (car (dictnext newdict T)))

    Tell me about...

    (dictadd)

    (dictremove)

    (dictrename)

    (dictsearch)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dictremove ename symbol)

Remove an item from a dictionary.

The dictremove function searches a dictionary (ename) to remove an item symbol.

    Example

    ; Create an entity list

    (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

    ; Create an entity from entity list

    (setq xname (entmakex dictionary))

    ; Get the named object dictionary

    (setq nmdict (namedobjdict))

    ; Add a record to dictionary table and returns the entity name of the object added

    (setq newdict (dictadd nmdict "MY_DICTIONARY" xname))

    ; Create an entity list

    (setq datalist (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) '((1 . "MY_DATA") (10 1. 2. 3.) (70 . 33))))

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record and returns the entity name of the object added to the dictionary.

    (dictadd newdict "DATA_RECORD" xname)

    ; Removes the record from dictionary and returns the entity name which is removed from dictionary table.

    (dictremove nmdict "MY_DICTIONARY")

    Tell me about...

    (dictadd)

    (dictnext)

    (dictrename)

    (dictsearch)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dictrename ename oldsym newsym)

Rename a dictionary entry.

The dictrename function renames an item (oldsym) to a new name (newsym) in a dictionary (ename). If either oldsym is not present in the dictionary, or ename is invalid, or newname is invalid, or newsym is already present in the dictionary, dictrename returns nil.

    ; Create an entity list

    (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

    ; Create an entity from entity list

    (setq xname (entmakex dictionary))

    ; Get the named object dictionary

    (setq nmdict (namedobjdict))

    ; Add a record to dictionary table and returns the entity name of the object added

    (setq newdict (dictadd nmdict "MY_DICTIONARY" xname))

    ; Create an entity list

    (setq datalist (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) '((1 . "MY_DATA") (10 1. 2. 3.) (70 . 33))))

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record and returns the entity name of the object added to the dictionary.

    (dictadd newdict "DATA_RECORD" xname)

    ; Renames the record and returns the new name set in the record.

    (dictrename nmdict "MY_DICTIONARY" "MY_NEW_DICTIONARY")

    Tell me about...

    (dictadd)

    (dictnext)

    (dictremove)

    (dictsearch)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dictsearch ename symbol [setnext])

Search a dictionary for an item.

The dictsearch function searches a dictionary (ename) for an item specified by a string (symbol). If the parameter setnext is present and not nil, the dictnext entry counter is adjusted so the following dictnext call returns the entry after the one returned by this dictsearch call.

    ; Create an entity list

    (setq dictionary (list '(0 . "DICTIONARY") '(100 . "AcDbDictionary")))

    ; Create an entity from entity list

    (setq xname (entmakex dictionary))

    ; Get the named object dictionary

    (setq nmdict (namedobjdict))

    ; Add a record to dictionary table and returns the entity name of the object added

    (setq newdict (dictadd nmdict "MY_DICTIONARY" xname))

    ; Create an entity list

    (setq datalist (append (list '(0 . "XRECORD") '(100 . "AcDbXrecord")) '((1 . "MY_DATA") (10 1. 2. 3.) (70 . 33))))

    ; Create an entity from entity list

    (setq xname (entmakex datalist))

    ; Add a record and returns the entity name of the object added to the dictionary.

    (dictadd newdict "DATA_RECORD" xname)

    ; Searches the record and returns the record if found.

    (setq newdictlist (dictsearch nmdict "MY_DICTIONARY"))

    Tell me about...

    (dictadd)

    (dictnext)

    (dictremove)

    (dictrename)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(dimy_tile key)

Determine the y-dimension of a dialog box tile.

This function, together with dimx_tile function, returns the dimensions of the tile with the name key. The x,y dimensions are typically used by other dialog box functions, such as vector_image.

Example

Code | Returns
(dimx_tile "pickbox_image") | 20
(dimy_tile "pickbox_image") | 15

NOTES

  • The dimension returned is one less than the size, since the dimension begins at 0. Thus, for the example above, the size of the tile is 16 x 16.
  • The key is a case-sensitive string.

    • Tell me about...

    (fill_image x y width height color)

    (slide_image x y width height slide)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(distance point1 point2)

Determine the distance between two points.

The distance function returns the distance between two points. Point1 and point2 are the x,y or x,y,z coordinates of the point.

Example

Code | Returns
(setq a '(2 3)) (setq b '(5 1)) (distance a b) | 3.60555

Tell me about...

(angle point1 point2)

(inters point1 point2 point3 point4 [flag])

(polar point angle distance)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(distof string [mode])

"Convert a string to a real number.

This function converts a string that contains a real number to a real number (distof is short for DIStance TO Floating point). The distof is opposite the rtos function. The optional mode specifies a number format, like the rtos function:

Mode | Format
1 | Scientific.
2 | Decimal.
3 | Engineering: feet and decimal inches.
4 | Architectural: feet and fractional inches.
5 | Fractional.

Examples

Code | Returns
(distof "2.3698E001") | 23.698
(distof "2'-5.25\"" 3) | 29.25

NOTE The backslash denotes that there will be a quote within the string. Once LISP sees the second quote, it knows it's the end of the string.

Tell me about...

(atof string)

(atoi string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(done_dialog [flag])

Dismiss that dialog box.

This function terminates a dialog box. It returns the x,y coordinates of the dialog box's position, which can be used by the start_dialog function to place the dialog in the same position.

Flag is an alternative return code that is returned by the start_dialog function; you can use this flag for any purpose you desire. When flag has a value greater than 1, the value is returned by the start_dialog function. Otherwise, the start_dialog function returns as follows:

Returns | Meaning
0 | User clicked Cancel.
1 | User clicked OK.

Example

Code | Returns
(done_dialog) | (0.000000 0.000000)

Tell me about...

(action_tile key expression)

(new_dialog dialog dcl-id [function point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(end_image)

End the creation of a dialog box image.

This function signals the end of the creation of an image in the current dialog box, which was begun by the start_image function.

Example

Code | Returns
(end_image) | nil

Tell me about...

(load_dialog filename)

(new_dialog dialog dcl-id [function point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(end_list)

End the processing of a dialog box list.

This function signals the end of processing a list in the current dialog box, which was begun by the start_list function.

Example

Code | Returns
(end_list) | nil

NOTE You also use this function when creating list boxes and drop-down list boxes in DCL. For examples using this function in conjunction with DCL, see list_box and popup_list (drop-down list box).

Tell me about...

(add_list string)

LISP Compatibility

Programming Overview of DCL (Dialog Control Language)

Programming Overview of LISP (LISt Processing) Language


(entdel entity-name)

Erase that entity from the drawing.

This function deletes an entity (or entity) specified by entity-name if it exists in the drawing. Use the entnext or entget functions to get the entity's entity-name.

If the entity was deleted from the drawing earlier in the current editing session, the entity is restored. In other words, using entdel twice un-deletes the entity. This works until you exit the drawing. Once the drawing is reloaded, you can no longer use entdel to restore entities deleted in the previous drawing session.

Example

Code | Results
(setq a (entnext)) |
(entdel a) | Delete entity.
(entdel a) | Undelete entity.

NOTES

    • Only entities can be deleted with entdel, not attributes or polyline vertices. To delete attributes and polyline vertices, use the command function with the AttEdit and PEdit commands.
    • Entities within blocks may not be deleted. To delete entities within a block, use entmake to redefine the block without the entities you want erased.

Tell me about...

(entget entity-name [application-list])

(entlast)

(entmod entity-list)

(entsel [prompt])

(entupd entity-name)

(nentsel [prompt])

(nentselp [prompt] [point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entget entity-name [application-list])

Determine the DXF data of an entity.

This function retrieves the entity list from the drawing database. The list is assigned to a variable, and then is taken apart, using functions like car , cdr,and assoc .

The entity list returned is composed of element pairs called dotted pairs because a dot separates each half. In each pair, the first number represents the code number for a characteristic of the element; the second number is the data associated with the code.

Example

As an example, let's draw a line and assign it the following variable values:

:Line

>Start point: 0,0

>Close/Undo/<Next point>: 5,5

:Change

Select entities: Pick line

Properties/<Change point>: P

(Color/Elev/LAyer/LType/ltScale/Thickness)? C

New color <BYLAYER>: 5

New Layer <0>: Electric

New Linetype <BYLAYER>: Continuous

Using the settings above, the following example applies:

Function | Returns | Code
(setq myline (entget (entlast))) | ((-1 . <Entity name: | 1fe0558>)
 | (0 . "LINE") | 0=Entity type
 | (5 . "2B") | 5=Handle
 | (100 . "AcDbEntity") |
 | (8 . "Electric") | 8=Layer name
 | (62 . 5) | 62=Color number
 | (6 . "CONTINUOUS") | 6=Linetype name
 | (100 . "AcDbLine") |
 | (10 0.0 0.0 0.0) | 10=x,y,z-coords
 | (11 5.0 5.0 0.0) | 11=Other x,y,z-coords
 | (210 0.0 0.0 1.0)) | 210=x,y,z-extrusion

NOTES

    • Entget does not return all information about an entity. Missing is dotted pair data about the entity's properties when they do not differ from default values: color, linetype, thickness, attributes-follow flag, and the entity handle.
    • While the data returned by entget is very similar to DXF format, there is one primary difference: x,y,z coordinates are returned by entget as a single value, rather than the separate values in DXF. Thus, you only see group code 10 with entget, instead of DXF group codes 10 (x-coordinate), 20 (y-coordinate), and 30 (z-coordinate).

Tell me about...

(entdel entity-name)

(entlast)

(entmake [entity-list])

(entmod entity-list)

(entsel [prompt])

(entupd entity-name)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entlast)

Get the last entity in the drawing.

This function retrieves the name of the last non-deleted entity in your database. This is useful if you want to use the last entity drawn.

Example

Code | Returns
(entlast) | <Entity name: bebb12f4>

NOTES

    • The entity does not need to be currently on screen, unthawed, or unlocked to be selected. This behavior differs from the Last selection set option.
    • To find the first entity in the database, use the entnext function with no arguments.

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entmake [entity-list])

(entmod entity-list)

(entsel [prompt])

(nentsel [prompt])

(nentselp [prompt] [point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entmake [entity-list])

Add an entity to the drawing.

This function allows you to write the entity-list to the database. The entity-list must be in the dotted pair format, as shown by the entget function. Without a valid entity-list, entmake doesn't make the entity and returns nil.

Example

Code | Meaning:
(entmake |
'((0 . "CIRCLE") | Entity = circle
(62 . 5) | Color = blue
(10 1.2 3.4 0.0) | Center point = 1.2,3.4
(40 . 5.6) | Radius = 5.6
) |
) |

NOTES

    • This function is similar to entmod. The difference is that entmake allows you to write a new list that was not previously in the database; entmod creates a new entity by modifying an existing entity.
    • Entmake does not require that you provide all information about the entity. Not required are dotted pair data about the entity's properties when they do not differ from default values: color, linetype, thickness, attributes-follow flag, and the entity handle.
    • While the data specified by entmake is very similar to DXF format, there is one primary difference: x,y,z coordinates are specified by entmake as a single value, rather than the separate values in DXF. Thus, you specify group code 10 with entmake, instead of DXF group codes 10 (x-coordinate), 20 (y-coordinate), and 30 (z-coordinate).

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entlast)

(entmod entity-list)

(entsel [prompt])

(entupd entity-name)

(nentsel [prompt])

(nentselp [prompt] [point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entmakex [entity-list])

(entmake [elist])

Makes a new object or entity, gives it a handle and entity name, and returns the new entity name.

This function allows you to define new entities -- both graphical and nongraphical -- where elist is a list of the information necessary to define the entity. If any required definition data is omitted, entmakex returns nil and the entity is rejected. If you omit optional definition data (such as the layer), entmakex uses the default value. If successful, entmakex returns the name of the entity created. If entmakex is unable to create the entity, the function returns nil.

Objects and entities without owners are not written out to DWG or DXF files. Be sure to set an owner at some point after using entmakex. You can use dictadd to set a dictionary to own an object.

Tell me about...

(entmake)

(dictadd)

(dictnext)

(dictremove)

(dictrename)

(dictsearch)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entmod entity-list)

Modify the entity in that drawing.

This function changes the entity defined by entity-list in the drawing database. You may have made changes to entity-list that you retrieved using entget, so the function entmod writes the changed list permanently into the database.

Example

Use the following LISP code example as a pattern to change any property of any entity:

Code | Meaning
(setq en (entnext)) | Get the entity name of the first entity in the drawing.
(setq en1 (entget en)) | Get the entity data from the entity name.
(setq en1 (subst (cons 62 5) |
(assoc 62 en1) | Change the color to blue (color #5).
en1)) |
(entmod en1) | Modify the color of entity en1

NOTES

    • Entmod checks that the following parameters are valid for every entity: layer name, linetype name, and color name or number.
    • Entmod automatically creates a layer if it does not already exist.

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entlast)

(entmake [entity-list])

(entsel [prompt])

(entupd entity-name)

(nentsel [prompt])

(nentselp [prompt] [point])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entnext [entity-name])

Get the next entity in the drawing.

This function returns the name of the first non-deleted entity in the database if no arguments are supplied. If an entity name is supplied, entnext returns the next entity following the given entity-name. When there is no next entity in the database, entnext returns nil.

Examples

Code | Returns
(setq a (entnext)) | <Entity name: 1fe0540>
(setq b (entnext a)) | Entity name following entity a

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entlast)

(entmake [entity-list])

(entmod entity-list)

(entsel [prompt])

(entupd entity-name)

(nentsel [prompt])

(nentselp [prompt] [point])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entsel [prompt])

Ask the user to select an entity.

The entsel function selects a single entity using a point-click, and then returns a list containing the entity name and the coordinates of the point used to select it. Any prior entity snap settings have no effect unless specifically requested during the function.

If a prompt is supplied, the user will be asked to select the entity with the wording of that prompt. If no prompt is supplied, the default prompt "Select Entity:" is displayed.

Examples

Code | Returns
(entsel) [pick an entity] | Select entity: (<Entity name: 1ff0548> (5.0 5.0 0.0))
(setq b (entsel "Select an line:")) [pick a line] | Select an entity: (<Entity name: 1ff0564> (1.0 2.0 3.0))

NOTE The function entsel works only with top-level entities. To select entities that belong to a block or a polyline, use nentsel .

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entlast)

(entmake [entity-list])

(entmod entity-list)

(entupd entity-name)

(nentselp [prompt] [point])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(entupd entity-name)

Redraw the entity.

This function redraws the entity on the screen. After you modify a block attribute or polyline vertex, the block or polyline is not updated automatically because recalculating and displaying a multitude of changes might take a long time.

Instead, you force an update of complex entities on the screen after the computations are done using entupd. The entity-name of an entity within the block or polyline updates the whole entity group.

Example

Code | Meaning
(setq a (entnext)) | Assigns the entity-name to a.
. . . | Change entity-see the entmod function.
(entupd a) | Regenerates entity group, which contains a.

NOTE You can ensure that all entities on the screen are updated with the ( command "regen") function.

Tell me about...

(entdel entity-name)

(entget entity-name [application-list])

(entlast)

(entmake [entity-list])

(entsel [prompt])

(nentsel [prompt])

(nentselp [prompt] [point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(eq statement1 statement2)

Determine whether two expressions are bound to the same symbol.

This function determines whether two expressions are bound to the same symbol. If so, eq returns T; if not, eq returns nil.

Examples

Code | Comments
(setq s1 '(1 2 3)) | Create symbol s1.
(setq s2 '(1 2 3)) | Create symbol s2.
(setq s3 s2) | Bind s2 to s3.
(eq s1 s3) | nil because s1 and s3 are not the same list.
(eq s3 s2) | T because s3 and s2 are the same list.

NOTE The eq function is not the same as the = (equal to operator) and equal(equal statement1 statement2 [tolerance])(IDR_166)functions. The = function returns T when two numbers or strings are equal. The equal function returns T when two expressions are equal. The eq function returns T when two expressions are bound to the same symbol.

Tell me about...

(boundp item)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(equal statement1 statement2 [tolerance])

Determine whether two statements are the same.

This function compares statement1 and statement2. If they are equal, LISP returns a T; if not, a nil is returned. Whereas the equal function compares lists, the = (equal to operator) function compares numbers and strings.

Examples

Code | Returns
(setq x '(1 2 3 4)) |
(setq y x) |
(equal x y) | T
(equal y '(1 2 3 4)) | T

The tolerance is the amount that the two expressions are allowed to differ, which is very important when comparing real numbers (which tend to suffer from rounding error). In the following example, the two statements can differ by 0.01:

Code | Returns
(equal 5.6789 5.67 0.01) | T

NOTE The equal function is not the same as the = (equal to operator) and eq functions. The = function returns T when two numbers or strings are equal. The equal function returns T when two expressions are equal. The eq function returns T when two expressions are bound to the same symbol.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(eval statement)

Evaluate the statement.

The eval function evaluates statement.

Examples

Code | Returns
(setq w 98) |
(setq x 'w) |
(setq y '(+ 5 6)) |
(setq z 'y) |
(eval w) | 98
(eval x) | 98
(eval y) | 11
(eval 'y) | (+ 5 6)
(eval z) | (+ 5 6)

Tell me about...

(apply function list)

(progn statement1 statement2 ...)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(*error* string)

Display an error message.

This function allows you to define an error within your LISP routine. Errors can be caused by the programmer, or by user input. You need to be able to either test for these errors, or "trap" them when they occur.

Trapping Errors

Trapping an error refers to the process of looking at the error message and attempting to give the user feedback on why the error occurred, and what it means. The *error* function allows you to trap the errors that have occurred, and gives you an opportunity to handle them, and exit your program gracefully.

You may have only one *error* function in your program. However, because one function can be assigned to another with the setq function, you can have as many error handling functions in your program as you desire. Then to activate the error function you want, you set the *error* function to your error trap routine. Because there is only one active *error* function, you need to be kind to other programs or global settings. Before changing the *error* function, you should save the current error trap function in a temporary variable so that you may re-assign that function when you are done processing.

Defining the *error* Function

The definition of the *error* function is very specific. The function must be called *error* (or be set to *error* with a setq), and it must have one argument passing variable. You can name this variable whatever you like.

Examples

The following is an example of a simple error handling function:

(defun *error* (msg)

(princ (strcat "\nAn error has occurred in the program: " msg)

)

In the above example, when the error occurred, the error message is passed to the *error* function in the msg variable. The function then prints, "An error has occurred in the program:" followed by the error message.

Here is a more in-depth example of an error handling function in a real scenario. Notice that first we save the current *error* function in temperror before pointing it to our error handler routine. Then at the end of the myslope program, we return the *error* function to the previously saved function in temperror. It is important to notice that the last line of the myerror function also returns the *error* function to one we previously saved in temperror.

Code | Comments
(defun c:myslope ( ) | Defining the program "myslope".
(setq temperror *error*) | Saving current error function to variable.
(setq *error* myerror) | Setting *error* to the error handling routine.
(setq p1 (getpoint "Select 1st point: ")) | Setting p1 to the user specified point.
(setq p2 (getpoint p1 "Select 2nd point: ")) | Setting p2 to the user specified point.
(setq slope (/ (-(cadr p2) (cadr p1)) | Setting slope to the slope formula using p1 and p2.
(-(car p2) (car p1)))) |
(princ (strcat "Slope equals " | Printing what slope equals to two decimal places onto the screen.
(rtos slope 2 2))) |
(setq *error* temperror) | Returning the error function to the variable.
) |

The error handler:

Code | Comments
(defun myerror (msg) | Define the error handler "myerror".
(if (= msg "divide by zero") | If the passing variable msg is the same as "divide by zero",
(prompt "\n The line is vertical.") | then show this prompt,
(prompt (strcat "\n" msg) | else show this prompt
) |
(setq *error* temperror) | Return the error function to the variable.
) |

Tell me about...

(alert string)

(command cmd [arguments] ...)

(exit)

(quit)

(setq symbol1 statement1 [symbol2 statement2] ...)

(trace function . . .)

(untrace function ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(exit)

Terminate.

This function forces the current application to quit. IntelliCAD displays the : prompt.

Example

Code | Returns
(exit) | error: quit/exit abort

Tell me about...

(*error* string)

(alert string)

(quit)

(trace function . . .)

(untrace function ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(exp number)

Calculate the natural exponent.

The exp returns the natural exponent (the inverse of the natural logarithmic function) raised to the power of the number (ex), where e = 2.71828. The result is a real number.

Examples

Code | Returns
(exp 0) | 1.00000
(exp 2) | 7.38906
(exp -3.2) | 0.0407622
(exp pi) | 23.1407

Tell me about...

(expt base power)

(log number)

(log10 number)

(sqrt number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(expand integer)

Expand the memory space.

This function expands the amount of node space (a form of memory used by LISP) by integer number of segments.

Example

Code | Returns
(expand 10) | 10

Tell me about...

(alloc integer)

(mem)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(expt base power)

Calculate the exponential.

This function returns the base raised to the power. When both the base and power are integers, the result is an integer. If either is a real number, the result is a real number.

Examples

Code | Returns
(expt 5 2) | 25
(expt 2.2 6) | 113.3800

Tell me about...

(exp number)

(log number)

(log10 number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(fill_image x y width height color)

Fill a dialog box's rectangle with color.

This function draws a rectangle (or square), and then fills it with a color. This function must be used between the start_image and end_image functions.

The x and y arguments specify the upper-left corner of the rectangle. The width and height arguments indicate the relative distance to the lower-right corner; these two arguments must be positive.

If you obtained the lower-right coordinates from the dimx_tile and dimy_tile functions, then the origin (0,0) is the upper-left corner.

The color argument is an IntelliCAD color number or a logical color number:

Color number | Description
-2 | Current background of the IntelliCAD graphics screen.
-15 | Current dialog box background color.
-16 | Current dialog box foreground color.
-18 | Current dialog box line color.

Example

Code | Returns
(fill_image 0 0 20 27 -2) | nil

Tell me about...

(slide_image x y width height slide)

(vector_image x1 y1 x2 y2 color)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(findfile filename)

Find that file.

This function searches your computer for the location of a file. This is important because if you specify the name of a file in your LISP program that doesn't exist, you crash the program. When the file exists, its path and filename are returned; if it doesn't, the function returns nil.

Examples

Code | Returns
(findfile "sampledwg.dwg") | "c:\\icad\\sample\\sampledwg.dwg"
(findfile "junk.$$$") | nil

Tell me about...

(getfiled title filename ext flags)

(load filename [flag])

(open filename mode)

(startapp appname [filename])

(xload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(fix number)

Convert that real number into an integer.

This function changes the number to an integer. Real numbers are changed to integers by truncating everything after the decimal point; no attempt is made to round off the number.

Examples

Code | Returns
(fix 3) | 3
(fix pi) | 3
(fix 7.999) | 7

Tell me about...

(atof string)

(atoi string)

(float number)

(itoa integer)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(float number)

Convert that integer into a real number.

This function changes the number to a real number. An integer is changed to a real number by adding a decimal point, followed by zeroes.

Examples

Code | Returns
(float 2) | 2.00000
(float 8.65) | 8.65000

NOTE This function is the opposite of the fix function.

Tell me about...

(atof string)

(atoi string)

(itoa integer)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(foreach variable list expression ...)

Apply the expression to every item in the list.

This function performs an expression on each of the elements of the list. The first argument for foreach is variable. This is a temporary variable where the changed elements are stored. Next is the list argument, containing the elements to be affected. Following the list are one or more expressions, detailing the action to be performed on the list elements. The foreach function returns the result of the last evaluation.

Example

Code

(setq sample '(1.0 1.5 2.0 2.5))

(foreach var sample (progn

(setq var (* 2.0 var))

(princ (strcat "\nTwice the value is " (rtos var)))))

(princ)

Result

    Twice the value is 2.0000
    Twice the value is 3.0000
    Twice the value is 4.0000
    Twice the value is 5.0000

Tell me about...

(mapcar function list1 [list2 ...])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(gc)

Collect the garbage in memory.

This function frees up memory no longer being used (short for Garbage Collection). This function always returns nil.

Example

Code | Returns
(gc) | nil

Don't do this:

(defunc func ()

(setq var "hi")

.

.

.

(setq var nil)

)

Do this instead:

(defunc func (/var) <= automatically frees memory

(setq var "hi")

.

.

.

)

Tell me about...

(alloc integer)

(exp number)

(mem)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(gcd integer1 integer2)

Calculate the greatest common denominator.

This function returns the greatest common denominator between integer1 and integer2. Both numbers must be integers. Use the fix function to create integers out of real numbers.

Examples

Code | Returns
(gcd 39 45) | 3
(gcd 40 45) | 5

Tell me about...

(max number1 number2 …)

(min number1 number2 …)

(rem number1 number2 [number3 ...])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(get_attr key attribute)

Determine the attribute of a dialog box's key.

This function returns the value of the dialog box attribute. Note that this value changes due to user input, as well as by calls made by the set_tile function. The key argument specifies the dialog box tile; key is a string and is case-sensitive.

Example

Code | Returns
(get_attr "pdsize_label" "Units") | "Units"

Tell me about...

(get_tile key)

LISP Compatibility


(get_tile key)

Determine the value of a dialog box's tile.

This function returns the value of the tile referenced by key; key is a string and is case-sensitive.

Example

Code | Returns
(get_tile "pdsize") | "pdsize"

Tell me about...

(get_attr key attribute)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getangle [point] [prompt])

Ask the user to specify an angle.

This function prompts the user to enter an angle in the current angle units format, which is returned in radians. If a point (2D first point) is provided, getangle determines the angle between the current zero direction (as set in the ANGBASE variable) and the guide line; the angle increases in the counterclockwise direction.

When transforming the entered angle into radians, getangle ignores the ANGDIR variable and measures counterclockwise, with zero radians being the current setting of ANGBASE.

A prompt may be supplied to request a point or angle from the user.

The user cannot enter another LISP expression in reply to the getangle function.

Examples

Code | Returns
(getangle) [pick point] | Second point: 0.262427
(getangle "Rotation angle: ") [pick point] | Rotation angle: 0.25553
(getangle '(5.0 2.0)) [pick point] | no response 2.1588
(getangle '(1.0 3.5) "Rotation angle: ") [pick point] | Rotation angle: 1.33221

NOTE The getangle function measures the angle from the 0-angle as defined by the Units command. To measure the angle from the absolute x-axis (0 = East), use the getorient function instead.

Tell me about...

(angle point1 point2)

(getdist [point] [prompt])

(getpoint [point] [prompt])

(polar point angle distance)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getcfg parameter)

Determine the value of the parameter.

This function returns data from the ITC/IntelliCAD/User section of the system registry. The parameter is a string with the following format:

"AppData/appname/sname/parameter" where:

Cfg Name | Means
AppData | The [AppData] section.
appname | The name of the application.
sname | The section name.
parameter | The parameter name.

Example

Code | Returns
(getcfg "appdata/appname/sname/parameter") | 56

Tell me about...

(getenv variable)

(setcfg parameter value)

(setenv variable value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getcname [ _ ]command-name)

Determine the localized command name.

This function returns the equivalent command name, depending on the presence of the underscore (_) prefix:

    • When prefixed by _, the localized command name is returned.
    • When not prefixed, the English command name is returned.

Examples

Code | Returns
(getcname "_zoom") | "zoom"
(getcname "zoom") | "_zoom"

Tell me about...

(command cmd [arguments] ...)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(menucmd string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getcorner point [prompt])

Ask the user to specify the second corner of a rectangle.

This function prompts the user to pick the second corner of a rectangle. The first corner argument (point) is required; the rectangle is drawn from that point as the user drags the cursor across the screen. Very often, this point is obtained from another function, such as getpoint.

The prompt is optional; it may be used to prompt the user for the corner point. Another LISP expression cannot be used in response to this prompt.

Examples

Code | Returns
(getcorner '(1.0 1.0)) [pick point] | no response 13.30 7.50 0.0
(getcorner '(2.0 1.5) "Select corner: ") [pick point] | Select corner: 7.50 8.19 0

NOTE The base point is based on the current UCS. Any z-coordinate entered is ignored, and the current elevation is used.

Tell me about...

(getangle [point] [prompt])

(getdist [point] [prompt])

(getpoint [point] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getdist [point] [prompt])

Ask the user to specify two points.

This function prompts the user to enter a distance, or to pick one or two points to specify the distance. The distance returned is a real number, regardless of the current distance format specified by the Units command. You can specify a prompt string to be displayed, asking the user for input. Another LISP expression cannot be entered in response to getdist.

Examples

The examples in this section demonstrate the two ways to use the getdist function.

  1. Two-point method: leave out the point argument. The getpoint function prompts the user for two points. The prompt for the first point is specified by prompt; IntelliCAD prompts, "Second point:" for the second pick point. A guide line stretches from the first point to the target to visually help in picking the second point.

Code Returns
(getdist)
[pick first point]
[pick second point] 		no prompt
Second point:
7.2
(getdist "Length of street: ")
[pick first point]
[pick second point] 		Length of street:
Second point:
10.5

2. One-point method: include the point argument. The getpoint function prompts the user for one point. The prompt for the second point is specified by prompt. A guide line stretches from the first point to the target to visually help in picking the second point.

Code | Returns
(getdist '(7.0 2.0)) [pick point] | no prompt 5.3
(getdist '(3.0 2.0) "Length of pipe: ")) [pick point] | Length of pipe: 2.8

NOTE For more information, see the initget function.

Tell me about...

(getangle [point] [prompt])

(getcorner point [prompt])

(getpoint [point] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getenv variable)

Determine the value of the operating system variable.

This function returns the value of a specified operating system environment variable-for example, as stored by the DOS PATH variable. If the variable exists, its value is returned as a string; if it does not exist, nil is returned.

Examples

Code | Returns
(getenv "PATH") | C:\\;C:\\WIN95;C:\\ICAD
(getenv "junk") | nil

Tell me about...

(getcfg parameter)

(getvar sysvar)

(setenv variable value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getfiled title filename ext flags)

Display the Select File dialog box.

This function displays the operating system's file dialog box, which allows the user to select a file.

The title argument is the title of the file dialog box; this appears on the title bar. To create a blank titlebar, type " ", but you cannot leave the argument blank.

The filename argument is the default filename that appears highlighted in the File name portion of the dialog box. For no filename, type " ", but you cannot leave the argument blank.

The ext argument specifies the filetype, such as "dwg", "txt", or "lsp". When the argument is " " , no filetype is specified. To specify all filetypes, use "*" for the argument.

The flags argument is a bitcode that specifies options for getfiled.

Bit code | Meaning
1 | Warn user about overwriting an existing file.
2 | Disable "Type It" button.
4 | The user can change the extension.
8 | Use the IntelliCAD search path and only the name of the file, not the path spec.

You can sum the bits to specify more than one option. For example, bit code 5 is equal to the bits 1 and 4 added together, meaning the user will be warned about overwriting an existing file and is allowed to change the extension.

Examples

(getfiled "Drawing Files" " " "DWG" 2)

(getfiled "Lisp Files" "sample.lsp" "LSP" 6)

(getfiled "Hey! Pick a File:" "ICAD" "LSP" 4)

Tell me about...

(alert string)

(findfile filename)

(load filename [flag])

(open filename mode)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getint [prompt])

Ask the user to specify an integer.

This function asks the user to input an integer, and returns that integer. You can include a prompt argument to ask for the integer. The valid integer range is from -2,147,483,648 to +2,147,483,647.

Examples

Code | Returns
(getint) | 7.0
(getint "Enter a number: ") | 7.0

Tell me about...

(getkword [prompt])

(getreal [prompt])

(getstring [flag] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getkword [prompt])

Ask the user to type a word.

This function works along with (equal statement1 statement2 [tolerance])(IDR_166)(initget [bits] [string])(IDR_205) to prompt for a response with restricted answers that you define ahead of time. For example, you may want the user to reply only "yes" or "no". Or, you may want to restrict the range of numbers that the user types to fall between 0 and 15.

Using this function is a two-step process: (1) first, use initget to set the valid response keywords; and (2) then, use getkword to prompt for input. IntelliCAD displays a dialog box listing the valid responses set by initget, as well as the Cancel option.

If the input does not match the predetermined criteria, the function tells the user that the input is invalid with "Try again:" and cycles back to try again. If the input is null (the user pressed the Enter key), getkword returns nil unless a null input is not allowed.

If no keywords are preset with initget, nil is returned.

Example

Code | Returns
(initget 2 "Yes No") (getkword "Are you sure? ") | Displays dialog box.

Tell me about...

(getstring [flag] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getorient [pt] [prompt])

Ask the user to specify an angle.

This function is very much like getangle, except that the angle returned by getorient is independent of the variables ANGDIR and ANGBASE. The base is always at the zero-radian direction towards the right (or east). The angles increase in a counterclockwise direction. Angles returned by getortient are shown as radians.

This function is better used for absolute angles (orientation), rather than relative angles (rotation amount).

Another LISP expression may not be used as a response to a getorient request.

Examples

Code Returns
(getorient)
[pick first point]
[pick second point] 		no response
Second point:
2.58172
(getorient '(3.5 2.0))
[pick point] 		no response
0.430034
(getorient "Real Angle: ")
[pick first point]
[pick second point] 		Real Angle:
Second point:
0.3222
(getorient '(7.0 2.0) "Real Angle: ")
[pick point] 		Real Angle:
1.58751

Tell me about...

(angle point1 point2)

(getangle [point] [prompt])

(getdist [point] [prompt])

(polar point angle distance)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getpoint [point] [prompt])

Ask the user to specify a point.

This function waits for the user to input a point. You can use the point argument to specify a beginning point from which a guide line will be drawn, extending to the target. The user can either enter a coordinate or pick a point manually.

You can also include a prompt to prompt the user for the point.

Examples

Code | Returns
(getpoint) [pick point] | no response 11.40 7.05 0.0
(getpoint "Select a point: ") [pick point] | Select a point: 2.05 3.55
(getpoint '(5.0 5.0) "Next point: ") [pick point] | Next point: 6.70 7.30

Tell me about...

(getint [prompt])

(getreal [prompt])

(inters point1 point2 point3 point4 [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getreal [prompt])

Ask the user to specify a real number.

This function waits for user input of a real number and returns that real number. You can supply a prompt argument asking the user to enter a number.

Examples

Code | Returns
(getreal) [type -5] | no response -5.0
(getreal "Scale factor: ") [type 5 | Scale factor 5.0

Tell me about...

(getint [prompt])

(getpoint [point] [prompt])

(getstring [flag] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getstring [flag] [prompt])

Ask the user to input some text.

Use this function to wait for user input of a string, and then to return it. Only the first 132 characters of a string are returned.

Set flag to a non-nil value to allow spaces in the string. If flag is non-nil (typically, T is used), the user must terminate the string using the Enter key. If flag is nil or absent, the input string is terminated at the first press of the spacebar or the Enter key.

Because the text entered in a string is taken literally, the user cannot enter another LISP expression as a response to getstring.

Examples

Code | Returns
(getstring "Enter street address: ") | "1244"
(getstring T "Enter street address: ") | "1244 E. Main"

NOTE If you want the user to enter one of several pre-defined words, use the getkword function instead.

Tell me about...

(getreal [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(getvar sysvar)

Determine the value of that system variable.

The getvar function retrieves and displays the current settings for IntelliCAD system variables. Use the setvar function to change the value of a system variable.

Example

Code | Returns
(getvar "blipmode") | 0

Tell me about...

(getcfg parameter)

(getenv variable)

(setvar sysvar value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(graphscr)

Switch to the graphics window.

This function returns to the graphics window from the Prompt History window. This function has no effect if you are already in the graphics screen. It's a good idea to put this function at the beginning of your program to be sure the LISP program begins on the graphics screen.

Example

Code | Result
(graphscr) | Switches to the graphic window.

Tell me about...

(grclear)

(textscr)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(grclear)

Clear the viewport.

This function temporarily blanks out the graphic window of the current viewport. The redraw function brings the graphics back. The grclear function always returns nil.

Example

Code | Result
(grclear) (redraw) | Clears the graphics window. Returns the graphics.

Tell me about...

(grdraw point1 point2 color [highlight])

(redraw [ename [mode]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(grdraw point1 point2 color [highlight])

Draw a line.

This function draws a vector between two points in the current viewport. The first two arguments, pint1 and point2, represent 2-D or 3-D endpoints for the vector in terms of the current UCS. These are written as lists of real numbers. If the vector extends beyond the screen, IntelliCAD automatically clips it.

The vector is drawn in the color specified, using the integer color argument. The integer -1 signifies the color XOR, which changes its color to complement whatever it draws over, or erases itself when overdrawn.

The highlight argument is optional. If provided, the vector will be drawn using the current highlighting method. If highlight is not provided or is set to zero, the normal display mode is used. The value must be an integer.

Examples

Code | Results
(grdraw '(0 0) '(4 8) -1) | Draws an XOR vector from 0,0 to 4,8
(grdraw '(3.5 3.0) '(10.2 7.8) 3 1) | Draws a highlighted vector in color 3 from 3.5, 3.0 to 10.2, 7.8

NOTE Use grvecs to draw multiple vectors.

Tell me about...

(grvecs vector-lists [trans])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(grread [flag] [bits [cursor]])

Read the data coming in from the input devices.

This function is another method to get user input. It reads successive input via input method. The flag option lets you obtain the user's coordinates. When flag is non-nil, it follows the movements of the mouse or pointer and records the coordinates dynamically, which can generate a great amount of data.

The optional bits argument specifies the following:

Bits | Meaning
1 | Returns the coordinates dynamically in the form of a list. The list consists of the value and the 3-D coordinate.
2 | Returns keystrokes but does not move the cursor. Returns all key values, including cursor and function key codes.
4 | Turn this on if you are going to choose a cursor type.
8 | Turns off the error message "console break" when you cancel out of the loop.

Add the bits above to obtain a combination if desired.

The cursor argument is an integer that corresponds to a cursor type:

Cursor | Meaning
0 | Normal cursor-crosshairs.
1 | No cursor.
2 | Selection cursor-box.

The following chart describes how the information is returned. For example, if you entered the letter, l (keyboard input), the value 2 and the character code would be returned (2 108) in a list.

Type of Input | Returned Value (Definition)
Keyboard | 2 (Character code)
Selected Point | 3 (3-dimensional point)
Mouse (other pointer) | 5 (3-dimensional point)

Example

(defun c:b ()

(while (print (grread 1 5 2)))

)

Explanation

In the above example, when you move the mouse, a list displays similar to (5 (2.3659 9.2846 0.0)), where the 5 represents the type of input (mouse) and where the coordinates are the exact coordinates of the mouse location. This changes dynamically as you move the mouse. When you select a point, a possible return would be (3 (2.3659 9.2846 0.0)), where 3 designates the type of input (selected point). When you entered a letter, let's say p, your return would be (2 112), where 2 denotes keyboard input, and 112 stands for the character code.

Tell me about...

(getint [prompt])

(getpoint [point] [prompt])

(getreal [prompt])

(getstring [flag] [prompt])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(grtext [flag text])

Write text on the status line.

This function allows you to put text in the status line or the coordinate status area. The flag determines where the text is placed:

Flag | Meaning
-1 | Status Line
-2 | Coordinate Status Line

The text is a string. If the string is too long for the space provided, it is truncated.

If coordinate status is turned on (the Coords command is set to 1 or 2), the text previously entered into this field is overwritten with new coordinates as soon as the mouse is moved.

You can use the grtext function without any arguments to remove the text from the coordinate status line field when COORDS is turned off or from the status line field.

Examples

Code | Returns
(grtext -2 "This is mode -2") | This is mode -2 Places text in coordinate area.
(grtext) | nil Clears text from status line

Tell me about...

(grdraw point1 point2 color [highlight])

(grvecs vector-lists [trans])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(grvecs vector-lists [trans])

Draw one or more lines.

This function is like grdraw, except that it draws more than one vector at a time in the current viewport. These are temporary vectors that disappear with any command that refreshes the viewport.

The argument vector-lists represents lists for drawing vectors, complete with from and to points and color. The points must be passed as pairs, in two successive point lists:

'([color] from1 to1

[color] from2 to2

...

)

The color portion of the vector list must be within the range of 0-255. If the value is greater than 255, the color becomes XOR ink, which complements anything it draws over. If the color is less than 0, the vector becomes highlighted:

Color | Meaning
-1 | Highlight ink.
0 - 255 | Standard IntelliCAD colors.
256 | XOR ink.

Examples

Code | Returns | Draws
(grvecs '( 2 (1.0 1.0) (3.0 6.0))) | nil | 2 = Yellow vector.
(grvecs '( 1 (3.0 6.0) (6.5 10.5) | nil | 1 = Red vector.
4 (0.0 0.0) (3.0 5.0))) |  | 4 = Cyan vector.

Tell me about...

(grclear)

(grdraw point1 point2 color [highlight])

(redraw [ename [mode]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(handent handle)

Determine the entity name of that handle.

This function retrieves the entity name of an entity with a specific handle. Unlike the entity name, the handle name remains constant throughout the editing process.

Example

Assuming that the handle of the desired entity is "2D", we could perform the following example:

Code | Returns
(handent "2D") | <Entity name: 1fe0568>

Tell me about...

(entget entity-name [application-list])

(tblsearch table-name symbol [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(help [filename [topic [flag]]])

Display the Help dialog box.

This function displays the IntelliCAD help window. The optional arguments have the following effects:

    • filename is the name of the HLP (help) file, such as lcad.hlp and aliases.hlp. When this argument is missing, IntelliCAD loads the lcad.hlp file as the default.
    • topic is the name of a topic within the help file, such as a command name. When this argument is missing, IntelliCAD displays the first topic of the help file.
    • flag displays one of the following:

    Flag | Meaning
help_contents | Display the initial topic in the HLP file.
help_helponhelp | Display help on using help.
help_partialkey | Display the Search dialog box using topic as the search text.

    Example

    Code | Result
(help "icadprog.hlp") | Displays the IntelliCAD Programmer's Reference (Help) window.

    Tell me about...

    (*error* string)

    (acad_colordlg color-number [flag])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(if test statement1 [statement2])

If it is true, do it; otherwise, do something else.

This function lets you test two conditions: if test is true, then perform statement1, else perform statement2. (Statement2 is optional.) If test is true, then LISP returns the value of statement1. If test is not true, then LISP returns the value of statement2.

Examples

Code | Returns
(setq d 9) |
(if (>= d 10) "Greater") | nil
(if (>= d 8) "Greater") | "Greater"
(if (and (> d 12) (< d 13)) "In range" "Out of range") | "Out of range"

NOTE The if function only allows a single statement for statement1 and statement2. If you want a multi-line statement, surround them by the progn function, as in the following example:

(if (> x 15)

(progn (

(setq window 20.0 door 32.0)

(command "color" 1)

) ; end progn

) ; end then

) ; end if

Tell me about...

(cond (statement1 result1 ...) ...)

(repeat number statement1 [statement2 ...])

(setq symbol1 statement1 [symbol2 statement2] ...)

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(initget [bits] [string])

Establish keywords.

This function helps you to restrict the user's choices when responding to LISP expressions, such as the getkwordfunction.

The options for initget are specified with the bits argument. Use the sum-the-bits technique for specifying more than one error-checking option: simply add bits together to combine options. For example, a flag of 36 is a sum of 32 + 4, which uses dashed lines with drawing the guide line and does not allow negative values.

The following table describes the possible meanings for the bits argument:

Bits | Meaning
1 | Do not allow null input (user not allowed to press Enter).
2 | Do not allow zero values.
4 | Do not allow negative values.
8 | Do not check drawing limits, regardless of LIMCHECK setting.
16 | reserved for future use
32 | Use dashed lines when drawing rubber band lines and boxes.
64 | For getdist only: do not allow input of a z-coordinate.
128 | Ignore above settings, allow any input.

For example, if you want to limit the user's input to only positive numbers (non-negative and non-zero), and draw a rubber-band line with dashes, you add 4 + 2 + 32 to get a value of 38 for the accept variable.

Once the bit code is set, you use string to determine the values that the user is limited to entering in response to the prompt displayed by the following function. This string is a list of keywords to be accepted by the next command. In essence, initget lets you define keywords. If keywords are not to be used, argument keys should be null or an empty string (""). The function always returns nil.

When defining your list of keywords, separate each keyword with a space. Show allowable abbreviations by capitalizing the required letter(s). When the entire word is in capital letters, the user is required to enter the entire word. Keywords may contain letters, numbers, and dashes. Here is an example of a list of keywords:

"One Two THree Four"

Given this, the user can type "three" or just "th" for three.

An alternative method of listing keywords is to write each word in all-capital letters, followed by a comma and the abbreviation for the word, as in the following example:

"ONE,O TWO,T THREE,TH FOUR,F"

This is usually used with (human) languages that do not use upper- and lower-case letters.

"~A B C _F _G ~_H"

The ~ prefix causes the keyword that follows to not be displayed in the popup menu. Use ~~ if you need to have ~ appear as a keyword. Entering a single ~ as a keyword will insert a separator between menu entries.

The first underscore prefix indicates that the remaining keywords are globalized forms of the preceding keywords. The first keyword ("A" in this example) will match the first globalized keyword ("F" in this example), the second keyword will match the next globalized keyword ("B" will match "G" in the example), and so on. The user can enter either the localized or globalized keyword; the globalized keyword will be returned in either case. Only the first globalized keyword is required to have the underscore prefix.

This function can be used with many LISP functions, but not all bits make sense. The functions and their possible bits are as follows:

Function | Bit
(getint) | 1, 2, 4, 128
(getreal) | 1, 2, 4, 128
(getdist) | 1, 2, 4, 32, 64, 128
(getangle) | 1, 2, 32, 128
(getorient) | 1, 2, 32, 128
(getpoint) | 1, 8, 32, 128
(getcorner) | 1, 8, 32, 128
(getkword) | 1, 128
(getstring) | none
(entsel) | none
(nentsel) | none
(nentselp) | none

Examples

Code | Returns
(initget 1) | nil
(initget 6 "red blue green") | nil

Tell me about...

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(inters point1 point2 point3 point4 [flag])

Find the intersection.

This function returns the intersection of two lines. Point1 and point2 represent the endpoints of the first line; point3 and point4 represent the endpoints of the second line. When the two lines intersect, the point of intersection is returned. If they do not intersect, nil is returned.

Flag is optional: if flag is not nil (T is typically used), the inters function performs as explained above. When flag is nil, the lines defined by the four points are considered infinite. Inters returns the point at which they eventually cross (unless they are parallel lines, in which case nil is returned).

Examples

Code | Returns
(inters '(2 3) '(2 -4) '(4 1) '(0 1)) | (2 1)
(inters '(2 3) '(2 -4) '(4 1) '(3 1)) | nil
(inters '(2 3) '(2 -4) '(4 1) '(3 1) nil) | (2 1)
(inters '(2 3) '(2 -4) '(4 1) '(3 1) T) | nil
(inters '(1 1) '(3 1) '(1 0) '(3 0) nil) | nil

Tell me about...

(getpoint [point] [prompt])

(osnap point mode)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(itoa integer)

Convert that integer into ASCII.

This function converts the integerinto a string. When integer is a real number, LISP complains, "Error: bad argument type."

Examples

Code | Returns
(itoa 3) | "3"
(itoa -66) | "-66"

Tell me about...

(ascii string)

(atoi string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(lambda arguments expression ...)

Create a temporary, unnamed LISP function.

This function creates another function on-the-fly. It is used when setting all the overhead for a new function is unnecessary. The lambda function usually occurs in the middle of another function, and is often used with apply or mapcar to perform a function on a list.

Example

Code | Returns
(apply '(lambda (a b c) (+ a (* b c))) '( 5 2 3)) | 11

Tell me about...

(command cmd [arguments] ...)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(progn statement1 statement2 ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(last list)

Determine the last item in that list.

This function returns the last element in a list. The element is not returned in a list, unless the last element is a list, as shown by the examples below.

Examples

Code | Returns
(setq b ' ( 1 2 3 4)) | (1 2 3 4)
(last b) | 4
(last '("first" "second" ("third" "fourth"))) | ("third" "fourth")

NOTE This function should be used with caution. For example, you may want a function to retrieve the z-coordinate of a point. However, there are some cases in which the point contains only the x- and y-coordinates. Your function would accidentally get the y-coordinate. For this reason, it is sometimes a better idea to use a mixture of the car and cdr functions.

Tell me about...

(length list)

(nth integer list)

(reverse list)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(length list)

Determine how many items are in that list.

This function returns number of items in list. The number returned is an integer.

Example

Code | Returns
(setq b ' ( 1 2 3 4)) | (1 2 3 4)
(length b) | 4

Tell me about...

(car list)

(cdr list)

(last list)

(nth integer list)

(reverse list)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(list expression …)

(list expression ...)

Make it a list.

This function creates a list from the expressions specified. You may also create the list literally by using the ' (quote) function, as shown in the last example below. Rather than use elements already defined as a list, you may need to create your own list. This list will become a variable, with its values preceded by the command list.

Examples

Code | Returns
(setq b (list 1 2)) | (1 2)
(setq c (list "string1" "string2")) | ("string1" "string2")
(setq a (list (car b) (car c))) | (1 "string2")
(setq d '(1 2 "buckle my shoe")) | (1 2 "buckle my shoe")

Tell me about...

(cons item list)

(length list)

(listp item)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(listp item)

Determine whether an item is a list.

This function tests if item is a list. If the item following listp is a list, the function returns T. If not, nil is returned.

Examples

Code | Returns
(listp '("one" "two" "three")) | T
(listp "one") | nil
(listp 1.00) | nil

Tell me about...

(list expression …)

(numberp item)

(reverse list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(load filename [flag])

Load that LISP file.

LISP program files must be loaded into IntelliCAD before they can be run. The load function must be enclosed in parentheses, or IntelliCAD will try to load a text or shape file.

The filename argument represents the name of the LSP file to load. You need not enter the file type .lsp, since this is assumed. The filename can also include the directory path. If one is not included, IntelliCAD searches the environmental paths specified in the configuration.

If the LSP file is found and loaded, the last expression in the program is returned to the command line. If the file is not found, the program displays an error message indicating that the load failed.

You may want to have the program display some other specified string, represented by the optional flag argument.

Examples

The following examples assume that invalid.lsp does not exist and valid.lsp does. The last expression in valid.lsp is LST-FUNCT.

Code | Returns
(load "valid") | LST-FUNCT
(load "\\sample\\valid") | LST-FUNCT
(load "invalid") | Load failed error
(load "invalid" "Does not exist.") | "Does not exist."

Tell me about...

(atoms-family format [symbol1 symbol2 ...])

(command cmd [arguments] ...)

(load_dialog filename)

(menucmd string)

(xload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(load_dialog filename)

Load that dialog box definition file.

This function loads a DCLdialog control file. DCL files must be loaded before a custom dialog box can be displayed by IntelliCAD. The filename argument is the name of the DCL file.

This function returns the following codes:

Return Code | Meaning
1 | DCL was successfully loaded.
-1 | DCL file was not found.

Examples

Code | Returns
(load_dialog "basicdcl") | 1
(load_dialog "junkdcl") | -1

NOTE The order of calling a dialog box is as follows:

  1. load_dialog
  2. new_dialog
  3. action_tile, start_image, start_list, etc (perform all dialog box initialization, such as associating an action with a tiles, creating an image, and making the lists for list boxes)
  4. start_dialog

    5. Tell me about...

    (unload_dialog dcl_id)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(log number)

Calculate the natural logarithm.

This function returns the natural logarithm, even though "ln" is usually considered the natural log in mathematics. This function cannot take a negative number. The result is a real number.

Examples

Code | Returns
(log 0) | 1.000000
(log 9) | 2.19722
(log 10) | 2.30239
(log 2.30239) | 0.834035

NOTE The exp function is the opposite of the log function.

Tell me about...

(expt base power)

(log10 number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(log10 number)

Calculate the common logarithm.

This function returns the common logarithm with base 10 (log10 x). This function cannot take a negative number. The result is a real number.

Examples

Code | Returns
(log10 100) | 2.0
(log10 50.65) | 1.70458

NOTE The expt function is the opposite of the log10 function.

Tell me about...

(exp number)

(log number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(logand integer1 integer2 …)

(logand integer1 integer2 ...)

Determine what is the logical AND.

This is a logic function using the Boolean AND. The result is generated via manipulating bits. If a bit is "on," it is denoted by a 1; if it is "off," it shows a 0. When the first bit AND the second bit (in the column) are on, then that bit is on. If the first bit is off AND the second is off, then that bit is off. The AND function requires that all bits in a column be on.

Examples

Code | Returns
(logand 5 7 37) | 5
(logand 13 2) | 0
(logand 27 31 43) | 11

Tell me about...

(~ number)

(and expression ...)

(boole function integer1 integer2 ...)

(logior integer1 integer2 …)

(lsh integer1 integer2)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(logior integer1 integer2 …)

(logior integer1 integer2 ...)

Determine what is the logical OR.

This is a logic function using the Boolean OR. The result is generated via bits, similar to the logand function. If a bit is "on," it is denoted by a 1; if it is "off," a 0 is displayed. If the first bit OR the second bit (in the column) are on, then that bit is on. The OR function requires that at least one bit in a column be on.

Examples

Code | Returns
(logior 5 7 37) | 39
(logior 17 5) | 21

Tell me about...

(~ number)

(and expression ...)

(boole function integer1 integer2 ...)

(lsh integer1 integer2)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(lpad string integer)

Pad that string with spaces on the left.

This function controls the length and spacing of the string when it is printed. The integer argument represents the number of characters or spaces the string should have.

When the number is less than the total number of characters in the string, the string is truncated to allow only the specified number of characters. When the number is greater than the number of characters in the string, additional spaces are added to the beginning (or left side) of the string.

NOTE Use rpad to perform the same operations on the end (or right side) of the string.

Examples

Code | Returns
(lpad "Planet X" 4) | "Plan"
(lpad "Planet X" 15) | "Planet X"
(setq a "Planet X") |
(lpad a 6) | "Planet"

Tell me about...

(rpad string integer)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(lsh integer1 integer2)

Do a bitwise shift.

This function performs a logical shift of bits. Integer1 denotes the number, while integer2 denotes the number of bits to shift integer1. When integer2 is positive, it shifts to the left; negative shifts to the right.

lsh works with integers only. The 1 signifies the bit is on; the 0 signifies it is off.

Examples

Code | Returns
(lsh 12 1) | 24
(lsh 8 -1) | 4
(lsh 24 3) | 192

Tell me about...

(~ number)

(and expression ...)

(boole function integer1 integer2 ...)

(logand integer1 integer2 …)

(logior integer1 integer2 …)

(or statement ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(mapcar function list1 [list2 ...])

Apply the function to the list.

This function is one of the most powerful tools for handling large lists. Mapcar performs a function on each of the elements of a list, and then returns a second list. There can be multiple lists, but each list must have the correct number of items for the function to affect all the lists at one time.

Example

Code | Returns
(mapcar '* '(5 3 2) '(2 2 2)) | (10 6 4)

Tell me about...

(apply function list)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(eval statement)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(max number1 number2 …)

(max number1 number2 ...)

Determine which is the biggest number.

The max function chooses the greatest number (real number or integers) from the list. If all the numbers are real, the result is real. If all the numbers are integers, the result is an integer. The combination of real numbers and integers results in a real number.

Examples

Code | Returns
(max 22 56) | 56
(max -9 -60) | 9
(max 25 19.9) | 25.0000
(max 2) | 2
(max) | 0

Tell me about...

(fix number)

(gcd integer1 integer2)

(min number1 number2 …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(mem)

Display the status of the LISP memory.

This function reports on the status of the memory being used by LISP. The parameters reported by mem have the following meanings:

mem | Meaning
Nodes | Total number of nodes allocated to LISP.
Free nodes | Number of nodes freed by garbage collection.
Segments | Number of segments allocated.
Allocate | Size of the segment.
Collections | Number of garbage collections.

Example

Code | Returns
(mem) | Nodes: 33934 Free nodes: 1744 Segments: 40 Allocate: 514 Collections: 24

NOTE A node is 12 bytes.

The default size of a segment is 514 nodes. Use the alloc function to change the size of the segment. Use the expand function to change the number of segments.

Tell me about...

(gc)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(member item list)

Identify the first occurrence of an item in the list.

This function identifies the first occurrence of an item in a list. A list is returned, beginning with the first occurrence of the item and containing any items following it. This is useful if you need to make a change to a particular item in the list, but you aren't sure exactly where the item is.

Examples

Code | Returns
(setq a '(1 2 3 4 3 2 1)) | (1 2 3 4 3 2 1)
(member 3 a) | (3 4 3 2 1)
(- (length a) (length (member 3 a))) | 2

Tell me about...

(length list)

(list expression …)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(menucmd string)

Execute that menu command.

This function executes a command in the menu bar (cursor menu and pull-down menus). The string parameter uses the following formats:

"menu=value"

"menu=*"

The menu parameter has two parts-for example (menucmd "P1.2=*). In this case, the "P1" refers to the first pull-down menu (usually the File menu). the ".2" refers to the first item on the menu (usually the Open item). The first values of menu permitted in IntelliCAD are:

Menu | Meaning
P0 | Cursor menu
P1 - P16 | Pull-down menus 1-16

The value parameter has the following meanings:

Value | Meaning
? | What is status of the menu item?
* | Display the menu.
~ | Disable the menu item (grayed out).
!. | Prefix menu item with a check mark.
 | (blank) Remove properties.
name | Load the menu name.

Examples

Code | Meaning
(menucmd "P3=*") | Display menu #3 (the View menu).
(menucmd "P3.1=~") | Disable menu #3, item #1 (the View | Redraw menu item).
(menucmd "P3.1=") | Re enable the View | Redraw item.

Tell me about...

(command cmd [arguments] ...)

(menugroup name)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(menugroup name)

Determine whether a menu group is loaded.

This function checks to see if a menu group is loaded. The name argument specifies the name of the menu group. When name matches the name of a loaded menu group, the menugroup function returns the group's name; otherwise, it returns nil.

Examples

Code | Returns
(menugroup "view") | "view"
(menugroup "junk") | nil

Tell me about...

(ads)

(atoms-family format [symbol1 symbol2 ...])

(command cmd [arguments] ...)

(menucmd string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(min number1 number2 …)

(min number1 number2 ...)

Determine which is the smallest number.

This function chooses the smallest or minimum number. When all the numbers are integers, then the result is also an integer. Any other combination results in a real number.

Examples

Code | Returns
(min 85 63) | 63
(min 34.0 18) | 18.0000
(min -6.9 -7) | -7.00000
(min 3) | 3
(min) | 0

Tell me about...

(fix number)

(max number1 number2 …)

(rem number1 number2 [number3 ...])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(minusp number)

Determine whether a value is a negative number.

This function determines negative numbers. If number is an integer or a real number and it has a negative value, the minusp function returns a T. Otherwise it returns a nil.

Examples

Code | Returns
(minusp -2.4) | T
(minusp 8.5) | nil
(minusp -26) | T

Tell me about...

(listp item)

(numberp item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(mode_tile key mode)

Set the mode of the dialog box's tile.

This function sets the mode of the tile identified by key. The mode argument takes one of the following integers:

Mode | Meaning
0 | Enable tile.
1 | Disable tile.
2 | Set the focus to the tile.
3 | Select the contents of an edit box.
4 | Change image highlighting between on and off.

Example

(mode_tile pt1 2)

Tell me about...

(get_attr key attribute)

(get_tile key)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(namedobjdict)

Return the entity name of the current drawing's named object dictionary, which is the root of all nongraphical objects in the drawing

This function enables an application can access the nongraphical objects in the drawing.

Example

; Get the named object dictionary and sets it in nmdict

(setq nmdict (namedobjdict))

Tell me about...

(dictadd)

(dictnext)

(dictremove)

(dictrename)

(dictsearch)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(nentsel [prompt])

Ask the user to select an entity.

This function works just like entsel, except nentsel lets you to pick an entity and return its name, even when the entity belongs to a block or a polyline. The prompt argument is an optional prompt you can present to the user.

Example

Code | Returns
(setq n (nentsel "Select a polyline: ")) [pick entity] | Select a polyline: (<Entity name: 890158> (5.0 5.0 0.0))

Tell me about...

(initget [bits] [string])

(nentselp [prompt] [point])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(nentselp [prompt] [point])

Return a point, without necessarily asking the user.

This function works just like nentsel, except nentselp does not need the user to pick a point. The prompt argument is an optional prompt you can present to the user. When you include the point argument, you do not need to prompt the user for a point.

Example

Code | Returns
(setq abc '(1 2 3)) |
(setq n (nentselp abc)) | (<Entity name: 890158> (5.0 5.0 0.0))

Tell me about...

(entsel [prompt])

(initget [bits] [string])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(new_dialog dialog dcl-id [function point])

Display a dialog box.

This is the function you use to display a dialog box. The dialog box is identified by dialog within the DCL file named dcl-id. The string dialog is obtained from the load_dialog function.

The new_dialog function optionally executes the LISP routine named function. To ignore this argument, use " "; you have to use the " " when you want to specify the point coordinates but not execute a function.

The optional point argument specifies the x,y coordinates of the upper-left corner. When point consists of negative coordinates, such as '(-1 -1), the dialog box appears at the default location, which is usually the center of the IntelliCAD window.

When the new_dialog function is successful, it returns T; otherwise, it returns nil.

Examples

Code | Returns
(new_dialog "basicdcl" "sampler" "insert" '(1 2)) | T
(new_dialog "basicdcl" "sampler" " " '(-1 -1)) | T

NOTE The order of calling a dialog box is as follows:

  1. load_dialog
  2. new_dialog
  3. action_tile, start_image, start_list, etc (perform all dialog box initialization, such as associating an action with a tiles, creating an image, and making the lists for list boxes)
  4. start_dialog

Tell me about...

(unload_dialog dcl_id)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(not item)

Determine whether an item is nil.

This function determines whether item is nil. If it is nil, a T is returned. If it is not nil, nil is returned.

Examples

Code | Returns
(not "Yes!") | nil
(not (> 5 6)) | T

NOTE The not and the null functions are very similar. The difference is that null checks whether the item is bound to nil. Null is meant for testing for empty lists.

Tell me about...

(numberp item)

(type item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(nth integer list)

Determine the nth item in the list.

Like car and cdr, the function nth is used to separate an element from a list. This function is much easier to use in long lists to isolate a single element.

The argument integer represents the number of the item to isolate. Remember that the first item in the list is numbered 0, so that when you want the third item you use 2. When integer is larger than the number of items (actually, number - 1 items) in the list, the nth function returns nil.

Examples

Code | Returns
(setq b '(1 2 3 4 5 4 3 2 1)) | (1 2 3 4 5 4 3 2 1)
(nth 4 b) | 5
(setq c '("one" "two" "three" "four")) | (one two three four)
(nth 2 c) | three
(nth 5 c) | nil

Tell me about...

(last list)

(length list)

(reverse list)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(null item)

Determine whether the item is bound to nil.

The null function confirms that your item is bound to nil. If it is nil, a T is returned. If it is not nil, nil is returned.

Examples

Code | Returns
(null "Yes!") | nil
(null (> 5 6)) | T

NOTES

    • The null function is the opposite of the boundp function.
    • The not and the null functions are very similar. The difference is that not checks whether the item is nil. Null is meant for testing for empty lists.

    Tell me about...

    (numberp item)

    (type item)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(numberp item)

Determine whether an item is a number.

This function tests item to see if it is a number-either a real number or an integer. If item is a number, a T is returned. If not, nil is returned.

Examples

Code | Returns
(numberp 8) | T
(numberp 0.2653) | T
(numberp '(5 3.2 6)) | nil
(numberp "Name") | nil

Tell me about...

(not item)

(type item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(open filename mode)

Open that file.

This function makes a file's filename accessible for input and output functions. The filename argument represents the path and filename of the file to open.

The open function returns a file descriptor (an 8-digit hexadecimal number) for the opened file, which should be stored as a variable using the setq function. Once you have the file descriptor, you must refer to the file using the file descriptor-not the filename!

The mode argument has three options, which must be in lowercase:

Mode | Meaning
"r" | Open the file as read-only; returns nil if the file does not exist.
"w" | Open the file for writing; overwrites existing data; creates a new file if non-existent.
"a" | Open the file for writing; append to existing data; creates a new file if non-existent.

Examples

Code | Returns
(setq n (open "existing.txt" "w")) | <File: #2190dec2>
(setq n (open "noexist.lsp" "r")) | nil
(setq n (open "\\sample\\exiting.txt" "a") | <File: #2190c2c3>

NOTES

    • In append mode, new data is added to the end of the existing file.
    • LISP only reads ASCII files (no binary files) using sequential access (no random access).
    • To separate subdirectory names, you use either two backslashes ( \\ ) or a single forward slash ( / ).

    Tell me about...

    (close file-descriptor)

    (read-line [file-descriptor])

    (write-line string [file-descriptor])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(or statement ...)

Calculate the logical OR.

This function performs a logical OR to the statements that precede it. If at least one of the statements is true, LISP returns a T. If all are false, LISP returns nil.

Examples

Code | Returns
(setq x nil) |
(setq y 8) |
(or x y 15.1) | T
(or nil x) | nil

Tell me about...

(and expression ...)

(equal statement1 statement2 [tolerance])

(logior integer1 integer2 …)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(osnap point mode)

Determine the 3-D coordinates of an entity snap.

This function uses the IntelliCAD entity snap modes to find a point. You specify which entity snap mode to use with the mode argument. You can assign multiple modes simultaneously.

Mode | Meaning
"nea" | NEArest
"end" | ENDpoint
"mid" | MIDpoint
"cen" | CENter
"per" | PERpendicular
"tan" | TANgent
"qua" | QUAdrant
"ins" | INSertion
"po" | POint
"int" | INTersection (3D intersection)
"pla" | PLAnview (2D intersection)
"vis" | VISible (apparent intersection)
"off" | Off

Using the point argument, you specify a point near the entity where the snap attaches to. If no point is found that specifies the mode requirements, the function returns nil.

Examples

Code | Returns
(osnap '(1 5) "center") | (5.0 5.0 0.0)
(osnap p1 "midp,endp,center") | (2.5 3.0 0.0)

NOTE The distance allowable between the starting point and the entity is determined by the system variable APERTURE, which ranges from 1 to 50 pixels.

Tell me about...

(getpoint [point] [prompt])

(inters point1 point2 point3 point4 [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


pi

Pi is 3.14159265...

Pi is not a function, but rather a constant value commonly used in programming IntelliCAD with LISP. The value of pi is approximately equal to 3.14159265.

Examples

Code | Returns
!pi | 3.14159

WARNING It is possible to lose the value of pi. For example, the following code causes pi to take on the value of 2.0:

Code | Returns
(setq pi 2.0) | 2.0
!pi | 2.0

Tell me about...

(atan number1 [number2])

(cos angle)

(sin angle)

(tan angle)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(polar point angle distance)

Find a point using polar coordinates.

This function returns a 3-D point at an angle and distance from another point. The given point is rotated by the angle specified in radians, then moved the specified distance from the point.

Examples

Code | Returns
(polar '(1 2) 1.570796 2) | (1 4)
(polar '(3.13397 1) 0.523598775 1 | (4 1.5)

NOTE The angle is measured in radians relative to the x-axis with radians increasing counterclockwise.

Tell me about...

(angle point1 point2)

(distance point1 point2)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(prin1 [expression [file-descriptor]])

Print it exactly the way it looks.

This function prints data to the screen or to a file. When a file-descriptor is provided, LISP prints to a file; when the file-descriptor is missing, LISP prints to the IntelliCAD Prompt History window.

When you are printing to a file, the file must previously have been opened with the open function in write "w" or append "a" mode.

The argument expression represents the expression to be printed. It can be any expression, not just a string. Only the expression is printed, no new line or space is included.

The prin1 function can be used with no arguments to return a null string, in which case an empty file is printed.

Examples

Code | Prints | Returns
(setq v1 222) |  |
(prin1 v1) | 222 | 222
(prin1 'v1) | V1 | V1
(prin1 "Thank You") | "Thank you" | "Thank you"
(prin1 "Sample" f) | "Sample"(to file f) | "Sample"
(prin1 "\nName:") | "\nName:" | "\nName:"

NOTES

    • Use the prin1 function at the end of a LISP routine to suppress the display of nil when the routine finishes running:

    (prin1)
    • The difference between the prin1 function and LISP's other print-related functions (for example, princ and print) is that prin1 treats control characters literally.
    • IntelliCAD does not support Unicode.

    Tell me about...

    (prompt string)

    (setq symbol1 statement1 [symbol2 statement2] ...)

    (terpri)

    (write-line string [file-descriptor])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(princ [expression [file-descriptor]])

Print, taking into account control characters.

This function prints to a file or to the screen. When a file-descriptor is provided, LISP prints to a file; when the file-descriptor is missing, LISP prints to the Prompt History window.

    • When you are printing to a file, the file must previously have been opened with the open function in write "w" or append "a" mode.

    The argument expression represents the expression to be printed. It can be any expression, not just a string. The expression is printed, as well as a new line.

    Unlike print and prin1, the princ function activates any control characters present within the expression. You can use the following control characters within the expression:

    Control Character | Meaning
\\ | \ backslash character
\" | " quote character
\e | Escape
\n | Newline
\r | Return
\t | Tab
\nnn | Octal code nnn

    Examples

    Code | Prints | Returns
(princ "\nName:") | (new line) Name: | "\n Name:"
(setq a "Address: ") |  |
(princ a) | Address: | "Address: "
(princ 'a) | A | A
(princ "Telephone: " f) | Telephone: (to file f) | "Telephone: "

    NOTE The difference between the princ function and LISP's other print-related functions (for example, print and prin1) is that princ acts upon control characters.

    Tell me about...

    (prompt string)

    (setq symbol1 statement1 [symbol2 statement2] ...)

    (terpri)

    (write-line string [file-descriptor])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(print [expression [file-descriptor]])

Print, using formatted printing.

    • This function prints the same way as prin1, with the exception of adding an new-line character before expression and a space after it. Like prin1, the print function treats control characters literally (does not activate them).

    Examples

    Code | Prints | Returns
(print "First pt: ") | New line. "First pt:Space." | "First pt:"
(print "\nCompany\005: ") | New line. | "\nCompany\005: "
 | "\nCompany\005:Space." |

    NOTE The difference between the print function and LISP's other print-related functions (for example, prin1 and princ is that print automatically includes a new-line character before expression and adds a space after expression).

    Tell me about...

    (prompt string)

    (terpri)

    (write-line string [file-descriptor])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(progn statement1 statement2 ...)

Evaluate the statement.

This function evaluates all the statements and returns the value of the last statement.

Generally, the progn function works in conjunction with the if function, since the if function is limited to a single if and then statement. Each if function can have only one then statement and an else statement. The progn allows you to have multiple statements evaluated. The value of the last statement is returned.

Example

Code | Returns
(setq a 9) (if (>= a 8) (progn (setq b a) (setq (1+ b) ) ) | 10

Tell me about...

(apply function list)

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(prompt string)

Print the message on the command line.

This function prints the string to the command line and the Prompt History window. The prompt function acts upon control characters.

Examples

Code | Returns
(prompt "56") | 56nil
(prompt "This is text.\n") | This is text. nil

NOTE The difference between the prompt function and LISP's other print-related functions (for example, princ, print, and prin1) is that prompt only prints to the Prompt History window and not to a file.

Tell me about...

(terpri)

(write-line string [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(quit)

Quit the current LISP routine.

This function forces the current LISP routine to quit. An error message is returned.

Example

Code | Returns
(quit) | error: quit / exit abort

Tell me about...

(*error* string)

(end_image)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(quote statement)

Create a list.

When you want LISP to treat the statement literally, you use the quote function. Quote prevents LISP from evaluating the statement. The single quote symbol (') is used as a shortcut for the quote function; the two are interchangeable.

Examples

Code | Returns
(quote a) | A
(setq x '(1 2 3 4)) | (1 2 3 4)
(setq x (quote (1 2 3 4))) | (1 2 3 4)

Tell me about...

(lambda arguments expression ...)

(list expression …)

(setq symbol1 statement1 [symbol2 statement2] ...)

(type item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(read string)

Determine the first item in a string.

This function returns the first list item or atom in the string. Spaces may not be used within the string argument unless they are within a list or string.

Examples

Code | Returns | Type
(read "one" ) | ONE | Atom.
(read "one two" ) | ONE | Atom.
(read " (1 2 3) (1) " ) | (1 2 3) | List.
(read " (one two) " ) | (ONE TWO) | List.
(read "12") | 12 | Integer.
(read "\"First Name:\"") | "First Name:" | String.

Tell me about...

(car list)

(cdr list)

(last list)

(print [expression [file-descriptor]])

(read-char [file-descriptor])

(write-line string [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(read-char [file-descriptor])

Read a single character.

This function reads a single character from the file or keyboard. When a file-descriptor is included (as assigned by the openfunction), read-char reads from a file. When file-descriptor is missing, read-char reads from the keyboard. ]

The read-char function doesn't actually return the letter, rather it returns the ASCII code of that letter. To actually see the letter, you must convert the ASCII code using the chr function.

Examples

For the following example, assume the file sample.lsp exists, and the first line is "C:\Sample\First.txt".

Code | Returns
(setq file (open "sample.lsp" "r")) |
(setq c (read-char file)) | 67
(setq a (chr c)) | "C"
(read-char) [press A] | Waits for you to press a key. 65

Tell me about...

(read-line [file-descriptor])

(setq symbol1 statement1 [symbol2 statement2] ...)

(write-char character [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(read-line [file-descriptor])

Read a whole line.

The read-line function is similar to the read-char function, but is generally much more practical and efficient to use. Anything can be read from a file, since the format is a string. The file is specified by the file-desc, assigned by the open(open filename mode)(IDR_237) function.

Example

For the following example, assume the file sample.lsp exists, the first line is "C:\Sample\First.txt", and the second line is "Second Line".

Code | Returns
(setq file (open "sample.lsp" "r")) |
(setq c (read-line file)) | "C:\\Sample\\First.txt"
(setq d (read-line file)) | "Second Line"

NOTES

  • The read-line function automatically moves to the next line in the file; it returns the next line from the file.
  • When read-line reaches the end of the file, it returns nil.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(write-line string [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(redraw [ename [mode]])

Redraw the viewport or just a single entity.

This function redraws (or refreshes) the entire graphic display screen, or a single entity. Any temporary graphics present (such as those drawn with the grdraw function) disappear with this function.

If an ename (short for entity name) argument is entered, that entity is displayed differently, depending on the value specified in the mode argument:

Mode | Meaning
1 | Perform a standard redraw.
2 | Blank the entity from the screen (a reverse redraw).
3 | Highlight redraw (system variable HIGHLIGHT).
4 | Do not highlight.

When these values are entered as negative numbers, the function affects only the main part of a complex element (for example, a block or polyline). The sub-elements are not affected. This function always returns nil.

Examples

Code | Result
(redraw) | Redraws entire screen.
(redraw en1) | Redraws selected entity.
(redraw en1 2) | Blanks out the selected entity.

Tell me about...

(graphscr)

(grclear)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(regapp appname)

Register the application.

This function adds the application name to the drawing's list of registered applications. You can register as many applications as you like in each drawing. This application name is registered in the APPID symbol table and is used for grouping together extended entity data assigned to entities. This allows individual applications to recognize their own extended entity data.

The application name itself can be up to 31 characters long, and can contain letters, digits, and special characters. It cannot contain spaces. If the application name already exists, nil is returned.

Examples

Code | Returns
(regapp "AM/FM.DESIGNER") | "AM/FM.DESIGNER"
(regapp "INTELLICAD-DEPT.52") | "INTELLICAD-DEPT.52")

Tell me about...

(ads)

(setfunhelp "c:filename" [helpfile [topic [command-name]]]])

(xload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(rem number1 number2 [number3 ...])

Determine the remainder of this division operation.

This function returns the remainder when number1 is divided by number2. You can use integers or real numbers. When there are more than two numbers, this function first finds the remainder of number1 divided by number2. Use that remainder and divide by number3 and continue the process.

Examples

Code | Returns
(rem 40 13) | 1
(rem 8 8) | 0
(rem 25 7.0) | 4.0
(rem 2 -8 9.0) | 2.0
(rem 2 -8) | 2
(rem 2 9.0) | 2.0
(rem -36 13.0 6) | -4.0
(rem -36 13.0) | -10.0
(rem -10.0 6) | -4.0
(rem 0 0) | error: divide by zero

Tell me about...

(/= item1 item2 ...)

(fix number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(repeat number statement1 [statement2 ...])

Repeat it.

This function repeats the statements by number of times, where number is a positive integer.

Example

Code | Returns
(setq x 2) |
(setq y 12) |
(repeat 3 | 1500
(setq x (* x 5) | x is now set to 250.
(setq y (* y 5) | y is now set to 1500.
) |

Tell me about...

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(setq symbol1 statement1 [symbol2 statement2] ...)

(while text statement …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(reverse list)

Reverse that list.

This function reverses the order of the items in a list.

Examples

Code | Returns
(setq v '("first" "second" "third")) | (first second third)
(reverse v) | (third second first)
(reverse '(1 2 3 4 5)) | (5 4 3 2 1)

Tell me about...

(acad_strlsort list)

(last list)

(length list)

(listp item)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(rpad string integer)

Pad that string with spaces on the right.

This function controls the length and spacing of a string when it is printed. The integer argument represents the number of characters or spaces the string should have. When the number is less than the total number of characters in the string, the string is truncated to allow only the specified number of characters. When the number is greater than the number of characters in the string, additional spaces are added to the end (or right side) of the string.

NOTE Use lpad to handle the same operations on the beginning (or left side) of the string.

Examples

Code | Returns
(rpad "Einstein" 4) | "Eins"
(rpad "Einstein" 15) | "Einstein "
(setq a "Einstein") |
(rpad a 6) | "Einste"

Tell me about...

(lpad string integer)

(setq symbol1 statement1 [symbol2 statement2] ...)

(trim string [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(rtos number [mode [precision]])

Convert that real number to a string.

This function converts a real number to a string. The argument number is the real number you want to convert.

Mode and precision arguments are optional arguments. The mode (1 through 5) selects the format of the string:

Mode | Meaning
1 | Scientific
2 | Decimal
3 | Engineering
4 | Architectural
5 | Fractional

The precision argument allows you to select the number of places after the decimal point. The range is 0 to 8.

Examples

Code | Returns | Format
(rtos 15.35 1 4) | "1.5350E+001" | Scientific.
(rtos 15.35 2 4) | "15.3500" | Decimal.
(rtos 15.35 3 4) | "1'-3.3500" | Engineering.
(rtos 15.35 4 4) | "1'-3 1/4" | Architectural.
(rtos 15.35 5 4) | "15 3/8" | Fractional.

NOTE When you leave them out, the mode and precision arguments read the settings of system variables LUNITS (default = decimal units) and LUPREC (default = 4 decimal places). Thus, to automatically use the current system settings, simply leave out mode and precision.

Tell me about...

(atof string)

(atoi string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(set ‘symbol statement)

(set 'symbol statement)

Assign the statement to the symbol.

This function is an assignment function, similar to the setq function. Set assigns the statement argument to symbol. The symbol should be quoted. When left unquoted, it changes the values of previously assigned symbols.

Examples

Code | Returns
(set 'x 56) | 56
(set 'y "Hello") | "Hello"
(set 'z '(a b c d)) | (A B C D)

NOTE The difference between the set function and the setq function is that set evaluates the symbol. The following are equivalent expressions:

(set 'i "Me")

(setq i "Me")

Tell me about...

(quote statement)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(set_tile key value)

Set the value of the dialog box tile.

This function sets the value of a dialog box tile.

The key argument is a case-sensitive string that specifies the tile. The value attribute is a string that assigns the new value to the tile.

Example

(set_tile tile1 val1)

Tell me about...

(get_tile key)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setcfg parameter value)

Set the parameter to the value.

This function changes data in the [AppData] section of the Icad.Cfg file, if it exists. The value can be any text or number. The parameter is a string with the following format:

"AppData/appname/sname/parameter"

where:

Cfg Name | Meaning
AppData | The [AppData] section.
appname | The name of the application.
sname | The section name.
parameter | The parameter name.

Example

Code | Returns
(setcfg "appdata/appname/sname/parameter" "56") | "56"

Tell me about...

(getcfg parameter)

(setenv variable value)

(setvar sysvar value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setenv variable value)

Set the operating system variable to that value.

This function sets the value of a specified operating system environment variable-for example, as stored by the DOS PATH variable.

NOTES

  • If you give setenv a non-existent variable name, it creates that, and sets it. You can see the new variable name from within IntelliCAD's "shell" DOS window (created by the Shell command) but not from the Windows DOS window. Setenv creates the variable within IntelliCAD's application space.
  • When you enter ICAD or ACAD as the environment variable you want to set, the setenv function changes that to the SEARCHPATH variable and uses it normally.

Example

Code | Returns
(setenv "PATH" "C:\\;C:\\WIN95;C:\\ICAD") | "C:\\;C:\\WIN95;C:\\ICAD"

Tell me about...

(getenv variable)

(setcfg parameter value)

(setvar sysvar value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setfunhelp "c:filename" [helpfile [topic [command-name]]]])

Register the command with that Help file.

This function registers your user-defined command-name with the Help facility. This ensures that the correct helpfile and topic are displayed when the user requests help on that command-name. The setfunhelp function returns the string passes as "c:filename" when successful; otherwise, it returns nil.

  1. The c:filename argument is your user-defined command; it must include the C: prefix and must be a quoted string.
  2. The helpfile argument is the name of the HLP file. Presumably, you have created a custom HLP file for your application.
  3. The topic argument is a topic name within the HLP file.
  4. The command-name argument is the same as the filename, but without the C: prefix.

Example

Code | Returns
(setfunhelp "c:stair" "stair.hlp" "raisers" "stair") | "c:stair"

Tell me about...

(help [filename [topic [flag]]])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setq symbol1 statement1 [symbol2 statement2] ...)

Set the symbol to the statement.

This function is LISP's most commonly-used assignment function. This function assigns statement1 to symbol1. For example:

(setq x 16)

sets the value of 16 to the symbol x.

NOTE Don't confuse this with the equals function (=. The = function doesn't assign.

Symbol1 is the variable that receives the value, where as statement1 is the value that is assigned to symbol1. Statement1 can be a variable representing a value, a numeric value, or a string.

Examples

Code | Returns
(setq y 10) | 10
(setq x y) | 10 Sets the variable x to the value of y-previously we set y to 10.
(setq myvar "Mom") | "Mom"
(setq pt1 '(5 3)) | (5 3)

NOTE You can set multiple variables at a time with the setq function. The [symbol2 stmt2]... is optional. When assigning multiple variables, the value returned is the last variable's assigned value.

Code | Returns
(setq a 5 b 6) | 6
(setq x 1.0y 2.0 z 3.0) | 3.0

To see the value of any variable, type ! before the variable name:

Code | Returns
!a | 5
!b | 6

Tell me about...

(defun [c:] name ([arg1 arg2 ...] / [local-var1 local-var2 ...]) expression)

(lambda arguments expression ...)

(quote statement)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setvar sysvar value)

Set the system variable to that value.

This function changes the value of IntelliCAD system variables. The sysvar argument is the exact name of the system variable, in string format.

The value is the new value for the system variable. The format of value varies, depending on the system variable; it could be an integer, a real number, a list of x,y or x,y,z-coordinates, or a string-as shown by the examples below.

Examples

Code | Returns
(setvar "cmdecho" 1) | 1
(setvar "gridunit" '(1 1)) | (1.0 1.0)
(setvar "insbase" '(1 2 3)) | (1.0 2.0 3.0)
(setvar "dwgname" "drawing1") | "drawing1"

NOTES

  • The setvar function is identical in nature to the Setvar command, with a single exception: the Angbase system variable accepts degrees with the Setvar command but only accepts radians with the setvar function.
  • Some system variables are read-only, which means their value cannot be changed with setvar. For example, the CDate system variable contains the current date and time. You cannot change that with the setvar function. Instead, you must use the Windows Date & Time Properties dialog box. You can, however, retrieve the value of any system variable with getvar.

Tell me about...

(setcfg parameter value)

(setenv variable value)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(setview view-descriptor [vport])

Create a 3-D viewpoint.

This function changes the 3-D viewpoint of a specified viewport.

The view-descriptor argument is not the simple x,y,z coordinates, such as '(1.0 2.0 3.0), that you might expect from the Viewpoint command. Instead, it requires the view descriptor table as returned by the tblsearch function. The data is in dotted-pair format and looks like the following:

((0 . "VIEW") (2 . "ASDF") (70 . 0) (40 . 7.76066) (10 7.49352 4.5)

(41 . 12.2537) (11 0.0 0.0 1.0) (12 0.0 0.0 0.0) (42 . 50.0) (43 . 0.0)

(44 . 0.0) (50 . 0.0) (71 . 0))

Example

One easy way to create the viewpoint data is with the View Save command. The example code below shows how to create and get this data.

Code | Comments
(command "view" "s" "asdf") | 1. Create a viewpoint named ASDF.
(setq vp (tblsearch "VIEW" "asdf")) | 2. Get the viewpoint data.
(setq cv (getvar "cvport")) | 3. Get the current viewport number.
(setview vp cv) | 4. Set the viewpoint in the viewport.

NOTE The vport argument is an optional integer that specifies the viewport number. When you have a single viewport, the argument is not required; the default value is 2. To get the number of the current viewport, use the Cvport system variable, as in the above example.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(vports)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(sin angle)

Calculate the sine.

This function returns the sine of an angle. The angle is interpreted to be in radians and the result is an real number.

Examples

Code | Returns
(sin pi) | 0.00000
(sin (/ pi 2)) | 1.00000
(sin 1.0) | 0.841471
(sin 0) | 0.00000

Tell me about...

(atan number1 [number2])

(cos angle)

(tan angle)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(slide_image x y width height slide)

Display a slide in the dialog box.

This function displays an image in a dialog box.

The image is positioned at x,y coordinates. These coordinates are the upper-left corner of the image. The width argument specifies the width of the image in the negative x-direction. The height argument specifies the height of the image in the negative y-direction.

The slide argument is the name of the snapshot file, which can be in EMF (enhanced metafile), WMF (Windows metafile), or SLD (slide) format.

Example

Code | Returns
(slide_image 10 10 15 20 "image.sld") | nil

NOTE Use the MSlide command to create an image. For good reproduction, create the snapshot at the same size and aspect ratio (usually 4:3) that you plan to display the image in the dialog box.

Tell me about...

(dimx_tile key)

(dimy_tile key)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(snvalid symbol [flag])

Determine whether the symbol table has valid characters.

This function determines whether the symbol table contains valid characters. The symbol argument is the name of a table, including "LAYER", "LTYPE", "VIEW", "STYLE", "BLOCK", "UCS", "VPORT", "DIMSTYLE", and "APPID".

The flag argument toggles whether the vertical bar ( | ) character is valid:

Flag | Meaning
0 | Vertical bar is not permitted.
1 | Vertical bar is permitted.

Example

Code | Returns
(snvalid "A") | T

Tell me about...

(tblsearch table-name symbol [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(sqrt number)

Calculate the square root.

This function returns the square root of the number. The result is always a real number.

Examples

Code | Returns
(sqrt 49) | 7.00000
(sqrt PI) | 1.77245

Tell me about...

(expt base power)

(log number)

(log10 number)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(ssadd [entity-name [selection-set]])

Add it to the selection set.

This function adds entity entity-name to selection-set or creates a new selection set (when ssadd is used without arguments). The ssadd function works in one of the three ways below:

Code Result
    • (ssadd)
 A new selection set is created with no entitys.
  • (ssadd entity-name)
 A new selection set is created containing entity-name as the only entity.
  • (ssadd entity-name selection-set)
 Adds the entity, entity-name, to an existing selection set, selection-set.

The new or revised selection set name is returned in a format similar to the following:

<Selection set: 26146268>

IntelliCAD can have more than one selection set open at a time.

Examples

Code | Comments
(setq sset1 (ssadd)) | Creates a new selection set called sset1.
(setq ent1 (car (entsel))) | Prompts the user to select the entity to set to ent1
(ssadd ent1 sset1) | Adds ent1 to sset1.
(setq ent2 (entlast)) | Returns last entity in drawing; sets it to ent2.
(ssadd ent2 sset1) | Adds ent2 to sset1.

Tell me about...

(entlast)

(entsel [prompt])

(ssdel entity-name selection-set)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssdel entity-name selection-set)

Erase it from the selection set.

This function deletes the entity, entity-name, from the selection set, selection-set. Unlike the ssadd function, entity-name and selection-set are not optional.

If entity-name is part of the selection set, ssdel deletes it and returns the selection set. If it is not part of the selection set, a nil is returned.

Examples

Code | Comments
(setq sset1 (ssget)) | Creates a new selection set called sset1.
(setq ent1 (entnext)) | Finds the first entity in the drawing and sets it to ent1.
(ssadd ent1 sset1) | Adds ent1 to sset1
(ssdel ent1 sset1) | Deletes ent1 from sset1.
(ssdel ent2 sset1) | Assuming ent2 is set to an entity(not in sset1), a nil would return.

Tell me about...

(entnext [entity-name])

(setq symbol1 statement1 [symbol2 statement2] ...)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssget [mode] [point1 [point2]] [point-list] [filter-list])

Ask the user to select entities.

This function prompts the user to select entities. When all arguments are left out, the ssget function prompts the user with the "Select entities:" prompt. This is the only situation when ssget highlights selected entities. The ssget function returns <Selection set: 26146268>. The selection set does not contain attributes nor polyline vertices.

The mode argument specifies the entity selection method:

Mode | Meaning | Points | Example
 | (none) Single pick point | point1 | (ssget '(10 15)) or (ssget)
"C" | Crossing | point1 point2 | (ssget "C" '(1 1) '(2 2))
"CC" | Crossing Circle | point1 point2 | (ssget "CC" '(1 1) '(2 2))
"CP" | Crossing Polygon | points-list | (ssget "CP" ptlist)
"F" | Fence | points-list | (ssget "F" ptlist)
"I" | Implied | none | (ssget "I")
"L" | Last | none | (ssget "L")
"O" | Outside | points-list | (ssget "O" ptlist)
"OC" | Outside Circle | point1 point2 | (ssget "OC" '(1 1) '(2 2))
"OP" | Outside Polygon | points-list | (ssget "OP" ptlist)
"P" | Previous | none | (ssget "P")
"PO" | POint | point1 | (ssget "PO" '(1 1))
"W" | Window | point1 point2 | (ssget "W" '(1 1) '(2 2))
"WP" | Window Polygon | points-list | (ssget "WP" ptlist)
"X" | All | none | (ssget "X")

The "I" mode creates an "implied" selection set of entities selected while system variable PICKFIRST is on. The "PO" mode selects all closed entities covering the specified point.

The point1 (and many times point2) argument specifies the pick point for the selection mode, as noted in the table above.

The filter-list argument is a list that specifies entity properties in dotted-pair format, such as:

(ssget "X" '((0 . "CIRCLE") (62 . 1)))

which selects all circles colored red (color 1). In addition, the special dotted-pair of -4 lets you include a relational test, such as:

(ssget "X" '((0 . "CIRCLE") (62 . 1) (-4 . "<") (40 . 15.0))

which selects all red circles less than 15 units in radius. For this function, the operators recognized by IntelliCAD are:

Operator | Meaning
"&" | Bitwise AND (integers only).
"&=" | Bitwise masked equals (integers only).
"*" | All.
"=" | Equals.
"!=" | Not equal to.
"/=" | Not equal to.
"<>" | Not equal to.
"<" | Less than.
"<=" | Less than or equal to.
">" | Greater than.
">=" | Greater than or equal to.

These operators are used with integers; the bitwise operators cannot be used with real numbers; the "*" operator is the only that can be used with strings.

NOTES

  • The current entity snap setting is ignored by the ssget function.
  • When the selection set is used in model space, paper space entities are not selected, and vice versa: entities from the space not currently in effect are filtered out.

Tell me about...

(ssdel entity-name selection-set)

(ssgetfirst)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssgetfirst)

Determine which entities are highlighted and/or gripped.

This function reports the number of entities in the drawing that are highlighted (selected) and gripped. Grips are the small squares that surround a selected entity that you can use to manipulate or modify the entity.

The ssgetfirst function returns a list with two elements: the first element is a selection set of entities that are gripped but not selected; the second element is a selection set of entities that are gripped and selected.

Example

Code Comments
    • (ssgetfirst)
 Displays a list of highlighted and gripped entities.

Tell me about...

(ssdel entity-name selection-set)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(sslength selection-set)

Determine how many entities are in the selection set.

This function reports the number of entities in the selection set, selection-set.

NOTE Use the ssget function to create the selection-set.

Example

Code | Comments
(setq sset1 (ssadd)) | Creates a new selection set called sset1.
(setq ent1 (car (entsel))) | Prompts user to select entity to set to ent1.
(ssadd ent1 sset1) | Adds ent1 to sset1.
(sslength sset1) | Returns 1.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(ssdel entity-name selection-set)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssmemb entity-name selection-set)

Determine whether an entity is in the selection set.

This function determines if the entity, entity-name, is in the selection set, selection-set. This function searches through the entities within the selection set to find if entity-name is included. If it is included, the entity's name is returned. If not, nil is returned.

Examples

Code | Comments
(setq sset1 (ssadd)) | Creates a new selection set called sset1.
(ssadd ent1 sset1) | Adds ent1 to sset1.
(ssmemb ent1 sset1) | Asks if ent1 is a member of sset1. Yes, so entity name is returned.
(ssmemb ent2 sset1) | Asks if ent2 is a member of sset1. No, so nil is returned.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(ssadd [entity-name [selection-set]])

(ssdel entity-name selection-set)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssname selection-set index)

Identify the nth entity in the selection set.

This function returns the name of the entity corresponding to the index in the given selection-set. The index refers to the order in which the entities were placed in the selection set starting with 0: index #0 is the first entity, index #1 is the second entity, and so forth.

Examples

Code | Comments
(setq a (ssget)) | Creates new selection set.
(setq part1 (ssname a 0) | Returns the name of the 1st entity.
(setq part2 (ssname a 1) | Returns the name of the 2nd entity.

NOTE The entity names returned aren't actual names like line or arc; they are numeric representations in hexadecimal.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(ssdel entity-name selection-set)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ssnamex selection-set index)

Retrieves information about how a selection set was created.

This function only retrives information about selection sets with entities from the current drawing's model space and paper space. Nongraphical objects or entities in other block definitions are not included.

Examples

Code | Comments
(setq part1 (ssnamex ss1 0)) | Returns entity data. For example: ((1 0 (0 (3.0 5.0 0.0)))) .

Tell me about...

ssname

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(sssetfirst grip-set [pick-set])

Grip these entities.

This function highlights entities in pick-set and places grips around entities in grip-set. (Grips are the small squares that surround a selected entity that you can use to manipulate or modify the entity.)

NOTE Use the ssgetfirst function to create the grip-set and pick-set selection sets.

Example

(sssetfirst ss1)

Tell me about...

(ssdel entity-name selection-set)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(start_dialog)

Start that dialog box.

This function displays a dialog box and accepts clicks the user inputs with the mouse button. It returns the status code passed to it by the done_dialog function:

Code | Meaning
1 | User clicked OK button.
0 | User clicked Cancel button.
-1 | The term_dialog function was used.

Example

Code Returns

(start_dialog)
    • 1

NOTES

  • A dialog box is first initialized by the new_dialog function.
  • The order of calling a dialog box is as follows:
  • load_dialog
  • new_dialog
  • action_tile, start_image, start_list, etc (perform all dialog box initialization, such as associating an action with a tiles, creating an image, and making the lists for list boxes)
  • start_dialog

    • Tell me about...

    (term_dialog)

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(start_image key)

Start creating a dialog box image.

This function signals the start of the image key in a dialog box. This function is used to precede the dialog box drawing functions: fill_image, slide_image, and vector_image.

To end the drawing, use the end_image function.

Example

(start_image kng)

Tell me about...

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(start_list key [operation [index]])

Start processing a list box.

This function signals the start of processing a list key in a dialog box. The optional operation argument describes the list operation to be performed (default = 3):

Operation | Meaning
1 | Change contents of the list.
2 | Append new data to the list.
3 | Replace the list with a new one (default).

The optional index argument is used only when operation = 1. It indicates the item # to be changed; the first item is #0; the second item is #1, and so on.

Examples

Code | Comments
(start_list ssg) | Replace list with new list.
(start_list ssg 3) | Same action as above.
(start_list ssg 1 4) | Change the fifth item on the list.
(start_list ssg 2) | Add data to the list.

NOTE You also use this function when creating list boxes and drop-down list boxes in DCL. For examples using this function in conjunction with DCL, see list_box and popup_list (drop-down list box).

Tell me about...

(add_list string)

(end_list)

LISP Compatibility

Programming Overview of DCL (Dialog Control Language)

Programming Overview of LISP (LISt Processing) Language


(startapp appname [filename])

Launch this Windows application.

This function starts any other Windows application appname. Optionally, it also loads a filename into that application. When successful, the startapp function returns an integer greater than 2; when unsuccessful, it returns 2.

Examples

Code | Returns
(startapp "wordpad" "basedcl.dcl") | 31679
(startapp "junk") | 2

Tell me about...

(help [filename [topic [flag]]])

(load filename [flag])

(xload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(strcase string [flag])

Convert this string to all upper- or all lower-case.

This function converts text in a string to all upper-case or all lower-case (when flag is non-nil).

The case to be converted is specified by the flag argument. When omitted or set to nil, all characters are converted to upper-case. When not nil (T is typically used), all alphabetic characters are converted to lower-case.

Examples

Code | Returns
(strcase "Yes") | YES
(strcase "NO" T) | "no"
(setq var (strcase var)) | Permanently changes variable.
(if (= (strcase var) "YES") (...) | Temporarily checks variable.

NOTE LISP functions that check and compare text tend to be case-sensitive. For example, (if (= "Y" ans) ...) only works with a capital "Y"; a lowercase "y" is not considered the same. For this reason, it is useful to apply the strcase function to the user's response, as follows:

(setq ans (getchar))

(setq ans (strcase ans))

(if (= "Y" ans)

...

)

Tell me about...

(atof string)

(atoi string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(strcat string1 [string2] …)

(strcat string1 [string2] ...)

Make one big string out of all these little strings.

This function joins together strings, an operation also known as concatenation.

Examples

Code | Returns
(setq a "Jack and Jill") | "Jack and Jill"
(setq b " went up the hill") | "went up the hill"
(strcat a b ) | "Jack and Jill went up the hill"
(setq rad (rtos 7.0)) |
(strcat "The radius is " rad) | "The radius is 7.0000"

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(strlen [string1] [string2] …)

(substr string start [length])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(strlen [string1] [string2] …)

(strlen [string1] [string2] ...)

Determine how many characters are in a string.

This function counts the number of characters in a string, or series of strings. It returns the amount as an integer. If an empty string exists or no string is provided, the value is zero.

Examples

Code | Returns
(strlen "How many?") | 9
(strlen "one" "two" "three") | 11
(strlen "") | 0
(strlen) | 0

Tell me about...

(substr string start [length])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(subst new old list)

Substitute this for that in a list.

This function is much like the search-and-replace function in a word processor. The difference is that subst works with lists, not strings.

The subst function replaces every occurrence of old with new in list. You can use this function together with the assoc function to manipulate dotted-pair entity data.

Example

Code | Returns
(subst '"a" '"b" '("a" "b" "c")) | (a a c)

Tell me about...

(length list)

(member item list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(substr string start [length])

Give me part of that string.

This function takes apart strings. It takes out a sub-string from the original string, which you can then assign to a variable or use as any other string.

The argument start indicates which character in the string to start from. Unlike other functions that deal with elements of a list, substr considers the first character in the string as number one (not #0). When the start position is greater than the length of the string, substr returns "" (non-nil).

The length argument represents the number of characters to include in the sub-string; this value must be a positive integer. If this argument is not provided, the sub-string extends to the end of the original string. When the integer is larger than the number of characters available, the entire list from the specified first character to the end will be returned with no error.

Examples

Code | Returns
(substr "California" 4 3 ) | "ifo"
(substr "Texas" 3 ) | "xas"
(substr "New Mexico" 12 ) | ""

Tell me about...

(strcat string1 [string2] …)

(strlen [string1] [string2] …)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(tan angle)

Determine the tangent of an angle.

This function returns the tangent of an angle. The angle must be in radians. The result is a real number.

Examples

Code | Returns
(tan 0) | 0.00000
(tan (/ pi 4)) | 1.00000
(tan pi) | 0.00000

Tell me about...

(atan number1 [number2])

(cos angle)

(sin angle)

LISP Compatibility

pi

Programming Overview of LISP (LISt Processing) Language


(tblnext table-name [flag])

Get me the next item in the table.

This function finds the first (or next, depending on the flag) instance of a symbol type in the drawing table. The argument table-name represents the name of symbol type to search for. Valid table-names are:

Table-name | Meaning
"appid" | Application identification.
"block" | Block names.
"dimstyle" | Dimension style names.
"layer" | Layer names.
"ltype" | Linetype names.
"style" | Text style names.
"ucs" | UCS names.
"view" | View names.
"vport" | Viewport names.

First, the tblnext function returns the first specified symbol in the table. When the symbol is found, it is returned as a list of dotted pairs. Used repeatedly, the next symbol is returned in order. When no more symbols exist in the list, nil is returned.

When the flag argument is supplied (typically as T), the search begins from the top of the table.

Example

Code | Comments
(tblnext "block" T) | Gets first block.
((0 . "BLOCK") | Symbol type.
(2 . "MYBLOCK") | Block name.
(70 . 0) | Flags.
(10 0.0 0.0 0.0) | Insertion point.
(-2 . <Entity name: 1ff0558>)) | Entity Name.

Tell me about...

(entget entity-name [application-list])

(tblobjname table-name symbol)

(tblsearch table-name symbol [flag])

(vports)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(tblobjname table-name symbol)

Determine the name of the entity associated with that symbol.

This function returns the entity name of a specified symbol table entry. The tblobjname function searches the symbol table table-name for symbol. It returns the entity name of that symbol table entry. Valid table-names are:

Table-name | Meaning
"appid" | Application identification.
"block" | Block names.
"dimstyle" | Dimension style names.
"layer" | Layer names.
"ltype" | Linetype names.
"style" | Text style names.
"view" | View names.
"ucs" | UCS names.
"vport" | Viewport names.

Default symbol names are:

Symbol | Meaning
"CONTINUOUS" | Default linetype.
"0" | Default layer.
"STANDARD" | Default text style.
"STANDARD" | Default dimension style.

Example

Code | Returns
(tblobjname "VIEW" "ASDF") | <Entity name: be6b44>

NOTE The entity name returned by tblobjname is useful for the entget and entmod functions.

Tell me about...

(tblnext table-name [flag])

(tblsearch table-name symbol [flag])

(vports)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(tblsearch table-name symbol [flag])

Search the table for a symbol.

This function obtains information about a known symbol from a drawing table-name. After entering in the table-name argument and the known symbol name, a list is returned containing dotted pairs for the symbol.

The flag (when set non-nil, such as T) lets the tblnext function retrieve the next item in the table:

(tblsearch "layer" "0" T)

(tblnext "LAYER")

The list returned is exactly like that returned from tblnext.

Example

Code | Result
(tblsearch "layer" "0") | ((0 . "LAYER") (2 . "0") (70 . 0) (62 . 7) (6 . "CONTINUOUS"))

Tell me about...

(entget entity-name [application-list])

(tblobjname table-name symbol)

(vports)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(term_dialog)

Terminate all dialog boxes.

This function terminates all dialog boxes. This function is especially useful for closing several nested dialog boxes all at once.

Example

Code | Returns
(term_dialog) | nil

Tell me about...

(unload_dialog dcl_id)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(terpri)

Print a carriage return.

This function prints a new line to the command prompt area, and returns nil.

Example

Code | Returns:
(terpri) | Carriage return. nil

NOTE Do not use this function to print a new line in a file. For that, use print or princ instead.

Tell me about...

(prompt string)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(textbox entity-list)

Determine the x,y,z dimensions of that text entity.

This function returns the 3-D coordinates of a box that encloses a text entity. The lower-left corner is always (0,0). The argument entity-list must refer to a text entity but not text in dimensions and blocks.

Example

Code | Returns
(setq txt (entlast)) | Entity name.
(setq txt1 (entget txt)) | Dotted-pair list.
(textbox txt1) | ((0.0 0.0 0.0)(1.8 0.2 0.0))

Tell me about...

(command cmd [arguments] ...)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(textpage)

Switch to the Text window and clear it.

This function is the same as textscr, except the Prompt History window is cleared. This gives you an entire empty page.

Example

Code | Returns
(textpage) | nil

Tell me about...

(grtext [flag text])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(textscr)

Switch to the Prompt History window.

The textscr function is the opposite of graphscr. If you are already in the textscr, the function has no effect.

Example

Code | Comment
(textscr) | Brings up the Prompt History window.

Tell me about...

(textpage)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(trace function . . .)

Turn on debug mode.

Used for debugging, this function sets a trace debug aid for the specified function. Each time the function is run, the trace appears and prints the result of the function.

NOTE Use untrace to turn off the trace debugging aid.

Example

Code | Returns
(trace fname) | FNAME Sets trace aid for FNAME function.

Tell me about...

(untrace function ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(trans point from to [flag])

Translate that point from one coordinate system to another.

This function translates (moves) a point from one to another coordinate system.

The point argument is a 3-D point in list format. The meaning of this argument depends on the setting of flag.

    • The from argument describes the current coordinate system:
    Code | Coordinate system
0 | World coordinate system (WCS).
1 | Current user-defined coordinate system (UCS).
2 | Display coordinate system ( DCS) of current viewport-with code 0 or 1
 | DCS of current model space viewport-with code 3.
3 | Paper space DCS.

      • The to argument describes the destination coordinate system, using the same codes as the argument from.
      • The flag argument determines the meaning of point:

      Flag | Meaning
T | 3D displacement.
nil | 3D point.

      Examples

      Code | Returns
(setq pt1 (getpoint)) | (6.85268 3.94705 0.0)
(trans pt1 0 1) | (-2.05459 -4.40897 6.23523)
(trans pt1 0 1 T) | (-4.36405 -5.28773 3.94124)

      Tell me about...

      (setq symbol1 statement1 [symbol2 statement2] ...)

      LISP Compatibility

      Programming Overview of LISP (LISt Processing) Language


(trim string [flag])

Erase blank spaces in a string.

This function trims spaces from the specified string.

The optional flag argument represents the options for stripping spaces:

Flag | Meaning
none | Strip all spaces from beginning and end.
"B" | Strip spaces from beginning of string.
"M" | Strip spaces from middle of string.
"E" | Strip spaces from end of string.
"BE" | Strip spaces from beginning and end of string.
"ME" | Strip spaces from middle and end of string.
"BM" | Strip spaces from beginning and middle of string.

Examples

Code | Returns
(setq a " Green Beans " ) |
(trim a "B" ) | "Green Beans "
(trim a "M" ) | " GreenBeans "
(trim a "be") | "Green Beans"
(trim a) | "Green Beans"

Tell me about...

(lpad string integer)

(rpad string integer)

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(type item)

Determine the type (for example, file, integer, string, and so forth) of an item.

This function returns the type (such as real number, integer, list, entity name, and so forth) of the item. The following table lists the various types and their meanings.

Types | Meaning
ENAME | Entity name.
EXSUBR | External subroutines: SDS functions.
FILE | File descriptor.
INT | Integer number.
LIST | List and user-defined function.
PAGETB | Function paging table.
PICKSET | Selection set.
REAL | Real number.
STR | String.
SUBR | Subroutines: LISP functions.
SYM | Symbol.

Examples

Code | Returns
(type 2) | INT
(type 2.0) | REAL
(type '(5 6 7)) | LIST
(type "Street") | STR
(type setq) | SUBR
(setq x (open "C:\\my.fil" "w")) |
(type x) | FILE
(type 'x) | SYM
(setq entinfo (entsel)) (type entinfo) ENAME | Could Return: <Entity name: 208055>
(setq ourset (ssget)) | <Selection set: 2>
(type ourset) | PICKSET

Tell me about...

(atom item)

(boundp item)

(listp item)

(not item)

(null item)

(numberp item)

(setq symbol1 statement1 [symbol2 statement2] ...)

(ssget [mode] [point1 [point2]] [point-list] [filter-list])

(zerop number)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(unload_dialog dcl_id)

Unload that dialog box.

This function unloads a dialog box identified as dcl_id.

Example

Code | Returns
(unload_dialog hlg) | nil

Tell me about...

(load_dialog filename)

(new_dialog dialog dcl-id [function point])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(untrace function ...)

Turn off debug mode.

This function turns off the trace debugging aid for the selected function, which was set using trace. The last function name is returned.

Example

Code | Returns
(untrace fname) | FNAME Clears trace aid for FNAME function.

Tell me about...

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(vector_image x1 y1 x2 y2 color)

"Draw a vector in the dialog box."

This function draws a vector of a specified color in a dialog box. The vector is drawn from x1,y1 to x2,y2. The origin (0,0) of the dialog box tile is at the upper-left corner.

The color argument can take one of these special meanings:

Color | Mnemonic | Meaning
-2 | BGLCOLOR | Current background of the IntelliCAD graphics screen.
-15 | DBGLCOLOR | Current dialog box background color.
-16 | DFGLCOLOR | Current dialog box foreground color of text.
-18 | LINELCOLOR | Current dialog box line color.

Example

Code | Returns
(vector_image 1 2 3 4 -1) | nil

Tell me about...

(dimx_tile key)

(dimy_tile key)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(ver)

Determine the version number of this LISP.

This function returns the version number of the LISP programming language included with IntelliCAD.

Example

Code | Returns
(ver) | "LISP Release 1.0"

Tell me about...

(getenv variable)

(getvar sysvar)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(vmon)

Turn on virtual memory.

This obsolete function turns on the virtual memory manager. This function is no longer required; it is included with LISP for compatibility reasons.

Example

Code | Returns
(vmon) | nil

Tell me about...

(mem)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(vports)

Get information about this viewport.

This function returns a description of all current viewports. The description returned by the vports function is a list that includes the viewport identification number, followed by viewport coordinates. These coordinates vary, depending on the setting of Tilemode:

  • When TileMode = 1, the list consists of the viewports created with the VPorts command - coordinates of the viewport's corners ranging from (0.0, 0.0) for the lower-left corner, to (1.0, 1.0) for the upper-right corner.corners are described by paper space coordinates.
  • When TileMode = 0, the list consists of the viewports created with the MView command. The corners are described by paper space coordinates.

NOTE In model space, the first viewport number is #2; viewport #1 is paper space when Tilemode = 0. The current viewport is listed first.

Tell me about...

(tblsearch table-name symbol [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(wcmatch string pattern)

Search that string.

This function finds internal string matches. You can see if a certain string is found, or match it with another string.

For example, if you had a string variable called MYVAR which contained the string "SUPERCALIFRAGILISTIC123\##" and you wanted to see if the characters "FRAG" were anywhere in the string you could use the wcmatch function, as follows:

    • (wcmatch MYVAR "*FRAG*")

    If a match is found, wcmatch returns T. If no match is found, nil is returned. The wcmatch function is case-sensitive. To find a match, you should use strcase to change everything to uppercase if necessary.

    You can use several wildcards for wcmatch:

    Wildcard | Definition
~ | (tilde) Pattern not found in string.
* | Standard wildcard; can be used anywhere.
? | Matches for a space held by a character or number; number of question marks (?) must exactly match number of characters or numbers in the string.
# | (pound) Matches any single number.
@@ | Matches any single character; may not be a number.
. | (period) Matches any single non-alphanumeric character.
 | (space) Matches one or more spaces.
[ ] | Matches for any of the characters enclosed in the brackets.
[~ ] | True only if there are extra characters not included in the brackets.
[ - ] | (hyphen) Searches within a predefined range pattern.
, | (comma) The "or" option.
' | (reverse quote) Read next character literally; use for special characters.

    Examples

    Code | Returns | Comments
(setq N "11234 TROPICANA AVE.#@") |  |
(wcmatch N "~345") | T | "345" is not found in the pattern.
(wcmatch N "*opic*" ) | T | "opic" is found with anything before and after.
(wcmatch N "?????????????????????") | T | There are 21 characters, numbers and spaces in this string.
(wmatch N "#####*") | T | Matches 5 digits, followed by anything.

    Tell me about...

    (setq symbol1 statement1 [symbol2 statement2] ...)

    (substr string start [length])

    LISP Compatibility

    Programming Overview of LISP (LISt Processing) Language


(while text statement …)

(while text statement ...)

Keep doing it while it's still true.

This function is a common loop in LISP. The statement controls whether the loop continues or breaks. When statement is true, the loop continues. When statement is nil, the loop breaks. The last statement before the nil is displayed.

Example

Code | Returns
(setq x 25) |
(while (/= x 20) |
(setq x (1- x) |
) | 20

Tell me about...

(cond (statement1 result1 ...) ...)

(if test statement1 [statement2])

(repeat number statement1 [statement2 ...])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(write-char character [file-descriptor])

Write that character to a file.

This function write a character to a file. The file is specified by the file-descriptor, assigned by the open function. This function writes characters that are in ASCII code. You convert a letter to its ASCII code with the (equal statement1 statement2 [tolerance])(IDR_166)(ascii string)(IDR_128) function. When the file-descriptor is left out, the character is written to the command line and Prompt History window.

NOTE The write-line, function, whose format argument is a string, is often more practical and efficient to use than the write-char function.

Example

Code | Returns | Prints in File
(setq fil (open "sample.lsp" "w")) (write-char (ascii "b") fil)) | 98 | b

Tell me about...

(chr integer)

(read-char [file-descriptor])

(write-line string [file-descriptor])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(write-line string [file-descriptor])

Write that string to a file.

This function is more practical and efficient to use than the write-char function. Anything can be written into a file, since the format is a string. The file is specified by the file-descriptor, assigned by the open function. When the file-descriptor is left out, the string is written to the command line and Prompt History window.

Examples

Code | Returns | Prints to File
(setq fil (open "sample.lsp" "w")) |  |
(write-line "Name:" fil) | "Name:" | Name:
(write-line "Address:" fil) | "Address:" | Address:

Tell me about...

(read-line [file-descriptor])

(setq symbol1 statement1 [symbol2 statement2] ...)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(xdroom entity-name)

Determine how much xdata space is still available for an entity.

This function reports the amount of xdata (short for extended entity data) space still free in the entity identified by entity-name. All entities in IntelliCAD have 16KB (actually, 16,383 bytes) each to store any kind of user-defined data. This function tells you how many bytes are still remaining.

Example

Code | Returns
(setq txt (entlast)) | <Entity name: abc123d4>
(xdroom txt) | 16383

NOTE Use this function before you add xdata to the entity to verify whether or not the entity still has xdata room.

Tell me about...

(entlast)

(setq symbol1 statement1 [symbol2 statement2] ...)

(xdsize list)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(xdsize list)

Determine how much space a list takes up as xdata.

This function returns the size (in bytes) that a list occupies as extended entity data. The list argument is a list of extended data that contain an application name registered with the regapp function. When the application name is unregistered, IntelliCAD displays the error message, "Invalid application name in 1001 group nil."

Example

Code | Returns
(xdsize lst) | 38

NOTE An invalid list creates an error message that is stored via an error code in system variable ERRNO.

Tell me about...

(xdroom entity-name)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(xload appname [flag])

Load that SDS application.

This function loads the SDS application (a DLL file) specified by appname. Once the application is loaded, you have access to all the commands it registers.

The optional flag argument is only used when an error occurs during loading. The xload function returns the value of this flag upon failure; when flag is missing, an error message is displayed instead.

When the application you are attempting to xload is already loaded, you see a message to that effect. It will not be loaded a second time.

Examples

Code | Returns
(xload "goodapp") | Loads the application "goodapp".
(xload "badapp") | Error loading application: Could not find badapp.dll.
(xload "badapp" "Uh-oh!") | Error loading application: Could not find badapp.dll. "Uh-oh!"
(xload "badapp" (xload "goodapp")) | Loads the application "goodapp". Error loading application: Could not find badapp.dll
(xload "loadedapp") | Application "C:loadedapp.dll" is already loaded.
(xload "loadedapp") | Can't open "loadedapp" for execution. error: XLOAD failed *Cancel* "loadedapp"

Tell me about...

(ads)

(load filename [flag])

(xunload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(xunload appname [flag])

Unload that SDS application.

This function unloads any SDS application that is currently loaded. IntelliCAD tells the application to clean up any allocated memory and end itself, then unloads the application and unregisters its commands.

The optional flag argument is only used when an error occurs during loading. The xunload function returns the value of this flag upon failure; when flag is missing, an error message is displayed instead.

If the application you are attempting to xunload is not currently loaded, you see a message to that effect and the request will be ignored.

Examples

Code | Returns
(xunload "goodapp") | Unloads the application "goodapp".
(xunload "badapp") | Error unloading application: Could not find badapp.dll.
(xunload "badapp" "Uh-oh!") | Error loading application: Could not find badapp.dll. "Uh-oh!"
(xunload "badapp") | Unloads the application "goodapp". Error loading application: Could not find badapp.dll
(xunload "notloaded") | Error loading application: Could not find notloaded.dll Application "notloaded" not loaded error: XUNLOAD failed
(xunload "notloaded") | *Cancel* "notloaded"

Tell me about...

(ads)

(load filename [flag])

(xload appname [flag])

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


(zerop number)

Determine whether this number is zero.

If number is a real number or an integer and it is a zero value, the zerop function returns a T. Otherwise, it returns a nil.

Examples

Code | Returns
(zerop 0) | T
(zerop 0.5) | nil
(zerop 0.0000) | T

Tell me about...

(atom item)

(boundp item)

(listp item)

(not item)

(null item)

(numberp item)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language


Programming Overview of DCL (Dialog Control Language)

DCL is an acronym for Dialog Control Language, a separate programming language that you can use with IntelliCAD to create custom dialog boxes. In creating dialog boxes with DCL, you work with elements called tiles, cluster tiles (or clusters), and attributes. The following sections describe each type of element and the basic syntax used to express it.

Tiles

A tile is a dialog box element, such as a button, a text box, a list box, an image, or a piece of text. Tiles are typically expressed via the following syntax:

: toggle { }

Note the colon prefix, followed by a space. That signifies that you are redefining (temporarily) the attributes of a tile. A tile name appearing without the colon prefix indicates that it has already been defined elsewhere (earlier in the DCL file or in another DCL file). The braces contain the tile's attributes (if any), characteristics such as color, associated action, or label.

Tiles are also categorized by function:

    • Active tiles (for example, : button { ... }, : toggle { ... }) (check box), and : list_box { ... }) define dialog box controls that receive user input and/or carry out commands and actions.
    • Text tiles (for example, : text { ...} and : text_part { ... }) manipulate strings in a dialog box.
    • Error handler tiles (for example, errtile; and ok_cancel_help;) take care of displaying error messages to the user and standard confirmation buttons such as OK, Cancel, and Help.
    • Decorator tiles (for example, : image { ... } and : spacer { ... } handle graphical elements and spacing within a dialog box.

NOTE

    • There are no tiles for creating tabbed dialog boxes.
    • Your DCL file must not use the following tiles: cluster, tiles, cancel_button, help_button, info_button, and ok_button.

Cluster Tiles

A cluster is a group of tiles, such as a group of related radio buttons (also called option buttons) or a group of check boxes (also called toggles). Clusters are usually (but not always) surrounded by a rectangular outline. The individual tile elements within a cluster are called the cluster's children.

Clusters are a form of tile, and typically take the following syntax:

: boxed_column { }

Again, note the colon prefix, followed by a space. The braces contain the cluster's attributes and tiles. Radio buttons have their own clusters since, by definition, there must be at least two radio buttons in a cluster.

Attributes

In DCL, the term attribute refers to a characteristic of a tile, such as its color, the action it performs, its label, and so forth. The program's DCL includes a number of predefined Predefined Attributes(IDR_2) (for example, color, multiple_select, and typeface).

A tile can have many attributes or none at all. When a tile has no attributes, it assumes the default values of the attributes.

A typical attribute takes the following syntax:

label = "Pick a viewpoint: ";

Note the semicolon terminator. Not all attributes apply to all tiles. In fact, some attributes change their meaning, depending on the tile with which they are used.

Tiles and Attributes Unique to IntelliCAD's Implementation of DCL

The program's DCL has one unique tile and several attributes that are not found in other implementations of DCL. The following table describes the tile unique to IntelliCAD's implementation of DCL:

Tile | Meaning
: multi_edit_box { } | Creates a multi-line edit box.

The following table summarizes the attributes that are unique to IntelliCAD's implementation of DCL:

Attribute | Meaning
lower_only = flag; | Read all input text as lower case.
pointsize = int; | Point size of text displayed by the dialog box.
read_only - flag; | Text in edit box is non-editable.
typeface = "string"; | TrueType typeface displayed by the dialog box.
upper_only = flag; | Read all input text as upper case.

The DCL File Format

A DCL file is in ASCII format, so you can use any text editor (such as Microsoft® NotePad or Microsoft® Word) to write and edit DCL files.

Syntax for Comments in DCL Code

Line comments are prefixed with //, as follows:

// A comment line.

To embed comments in the DCL code, use /* and */, as follows:

plotdlg : dialog { /* The Plot dialog box*/

Referencing Tile Definitions in DCL Code

The DCL file can reference tile definitions in anther DCL file through the use of the include directive:

@include filename

Tell me about...

About Predefined Attributes

Copying Code Examples from the IntelliCAD Programmer’s Reference


About Predefined Attributes

The program's DCL includes many predefined attributes for tiles. The attributes use three types of values: numeric, strings, and reserved values. The valid attributes for each tile varies.

NOTE Do not use the horizontal_margin, vertical_margin, and type attributes in a DCL file.

Numeric Values

Numeric values are integers and/or real numbers, depending on the attribute. A real number between -1 and 1 must have a leading zero, such as 0.1 and not .1. Examples include:

max_value = 16;

aspect_ratio=0.0;

Strings

A string consists of alphanumeric characters within a pair of quotation marks ("text") and is case sensitive. Examples include:

key = "R2";

action = "(function)";

You can use the following control characters within strings:

Control Character | Meaning
\" | Quotation mark. (embedded)
\\ | Backslash.
\n | New-line (carriage return).
\t | Tab.

Reserved Values

Some text is used without quotation marks. These are reserved values, which include flags (true and false), color names, and positions, such as left and top. Examples include:

allow_accept = true;

color = blue;

alignment = centered;

Tell me about...

Programming Overview of DCL (Dialog Control Language)

Copying Code Examples from the IntelliCAD Programmer’s Reference


action = "(

action = "(string)";

Execute this LISP function.

This attribute is a callback that executes a LISP function when the user clicks a given tile.

For string, specify the name of a LISP function.

Example

action = "(function)";

NOTE

    • Note that the tile action, known as a callback function, is more usually specified by the controlling program using the action_tile function. If an action is defined by the calling program, the DCL-specifed action is ignored.
    • The action attribute cannot call an SDS function.
    • A tile can have only one action assigned to it, and action_tile overrides action if assigned by the program.
    • Do not include the sds_command function in the action function.

Valid Tiles

button

popup_list

edit_box

multi_edit_box

radio_button

image_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes

Programming Overview of LISP (LISt Processing) Language


alignment =

alignment = position;

Align this tile horizontally or vertically.

This attribute aligns the tiles within a cluster.

For position, you can specify the alignment of a row or column as follows:

    • For a column, position: left (default), right, centered.
    • For a row, position: top, centered (default), bottom.

Example

alignment = centered;

Valid Tiles

all tiles

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


allow_accept =

allow_accept = flag;

Activate the default button.

This attribute accepts the input when the user presses [Enter] or double-clicks a given tile.

flag: true or false (default).

Example

allow_accept = true;

Valid Tiles

edit_box

multi_edit_box

image_button

list_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


aspect_ratio =

aspect_ratio = real;

Specify an image's aspect ratio.

This attribute specifies the ratio of an image's width divided by its height. A common aspect ratio is 1.33, where width = 4 and height = 3.

To create images with the correct aspect ratio, create a paperspace viewport that is 1.333 units wide and 1 unit high, and then scale up as desired. Switch to modelspace to properly center the image, using Pan and Zoom, and create a slide. Note that slide libraries are not supported.

For real, specify a real number. When real = 0.0, the image tile is expands to fit to image size. The default = (none).

Example

aspect_ratio = 0.0;

NOTE The aspect_ratio attribute is used with the height or width attribute. You do not use the aspect_ratio attribute when you use both height and width.

Valid Tiles

image

image_button

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


big_increment =

big_increment = int;

Move the slider this much per click.

This attribute specifies how much a slider increments when the user clicks the central portion of the slider. The default amount is 1/10 of the total range between the minimum value (specified by the min_value attribute) and the maximum value, specified by the max_value attribute.

For int, specify an integer in the range between min_value and max_value.

Example

min_value = -16;

max_value = 16;

small_increment = 1;

big_increment = 10;

NOTE

    • The default value of min_value is 0; the minimum value is -2,147,483,648. The default value of max_value is 10,000; the maximum value is 2,147,483,647.
    • Horizontal sliders increase in value from left to right; vertical sliders increase value from top to bottom.

Valid Tile

slider

Tell me about...

small_increment = int;

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


children_alignment =

children_alignment = position;

Align the cluster's children.

This attribute defines the default alignment of the children tiles within a cluster. When a child tile has its own alignment attribute, it overrules this children_alignment attribute.

For position, you can specify the alignment children tiles as follows:

    • For columns, position: left (default), right, or centered.
    • For rows, position: top, bottom, or centered (default).

Example

children_alignment = centered;

Valid Tiles

row

column

radio_row

radio_column

boxed_row

boxed_column

boxed_radio_row

boxed_radio_column

Tell me about...

About Predefined Attributes

Programming Overview of DCL (Dialog Control Language)


children_fixed_height =

children_fixed_height = flag;

Assign a fixed height to a cluster's children.

This attribute determines whether all tiles in a cluster have a fixed height. Since this can lead to crowding problems, it is probably best to never use this attribute. When a child tile has its own height attribute, it overrules this children_fixed_height attribute.

flag: true or false (default).

Example

children_fixed_height = true;

Valid Tiles

row

column

radio_row

radio_column

boxed_row

boxed_column

boxed_radio_row

boxed_radio_column

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


children_fixed_width =

children_fixed_width = flag;

Assign a fixed width to a cluster's children.

This attribute determines whether all tiles in a cluster have a fixed width. Since this can lead to crowding problems, it is probably best to never use this attribute. When a child tile has its own width attribute, it overrules this children_fixed_width attribute.

flag: true or false (default).

Example

children_fixed_width = true;

Valid Tiles

row

column

radio_row

radio_column

boxed_row

boxed_column

boxed_radio_row

boxed_radio_column

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


color =

color = clr;

Assign this background color for an image.

This attribute specifies the fill color for background of an image tile.

clr: name of the color (default = white).

The following table shows the valid values for clr:

Clr | Meaning
black | Color #0
red | Color #1
yellow | Color #2
green | Color #3
cyan | Color #4; light blue.
blue | Color #5
magenta | Color #6; pink.
white | Color #7; the default color.
dialog_line | Current dialog box line color.
dialog_foreground | Current dialog box text color.
dialog_background | Current dialog background color.
graphics_background | IntelliCAD graphics screen color.
graphics_foreground | White or black.

NOTE Black (color #0) appears white on a black background, and white (color #7) appears black on a light background.

Example

color = blue;

Valid Tiles

image

image_button

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


edit_limit =

edit_limit = int;

Define the maximum number of characters the user can type in an edit box.

This attribute specifies the maximum number of characters that the user is allowed to type in an edit box tile.

int: an integer; default = 132 characters; maximum = 256.

Example

edit_limit = 100;

Valid Tiles

edit_box

multi_edit_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


edit_width =

edit_width = number;

Define the width of the input section of an edit box.

This attribute specifies the width (in characters) of the text entry portion in an edit box. The text entry box is right-justified.

For number, use a real number or an integer.

NOTE Typically, the edit_width attribute is different from the value of the edit_limit attribute, which sets the maximum number of characters the user can type in an edit box. Setting the value of edit_limit to be larger than that of edit_width allows the user to type additional characters beyond what the width of the edit_box accommodates. In that case, not all characters in the input string are necessarily displayed all at once. The horizontal direction arrows allow scrolling to the beginning or end of the input.

Example

edit_width = 0;

NOTE The default value of the edit_width attribute is 0.0, which stretches the dialog box to fit the required space.

Valid Tiles

edit_box

multi_edit_box

popup_list

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


fixed_height =

fixed_height = flag;

Define a fixed height for a tile.

This attribute determines whether height of a tile is allowed to fill the available space. When flag = true, the tile's size is fixed; when flag = false, the tile changes its size to fit the height available.

flag: true or false (default).

Example

fixed_height = true;

Valid Tiles

all tiles

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


fixed_width =

fixed_width = flag;

Define a fixed width for a tile.

This attribute determines whether width of a tile is allowed to fill the available space. When flag = true, the tile's size is fixed; when flag = false, the tile changes its size to fit the width available.

flag: true or false (default).

Example

fixed_width = true;

Valid Tiles

all tiles

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


fixed_width_font =

fixed_width_font = flag;

Display the text of a list box or drop-down list in a fixed-width font.

This attribute determines whether a list_box or popup_list (drop-down list box) displays text in a fixed pitch font, such as Courier. Using this attribute makes it easier to line up text in columns.

flag: true or false (default).

Example

fixed_width_font = true;

Valid Tiles

list_box

popup_list

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


height =

height = number;

Define the height of a tile.

This attribute determines the minimum height of a tile, unless the height is fixed by a fixed_xxx attribute, such as fixed_height. There is usually no need to use this attribute, unless you need to improve the appearance of the dialog box.

number: a real number or an integer that specifies the height in units of character height (the maximum height of a line of screen characters, including the interline spacing).

Example

height = 12.0;

NOTE The aspect_ratio attribute is used with either the height or width attribute. You do not use the aspect_ratio attribute when you use both height and width.

Valid Tiles

all tiles

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


initial_focus = "

initial_focus = "string ";

Specify where the initial focus is.

This attribute specifies the tile that receives the initial focus. The "focus" is the active control in the dialog box-for example, an edit box, a button, or a check box. This attribute is useful for directing the user to the most logical starting point for parameter entry.

string: the tile's key.

Valid Tile

dialog

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


is_bold =

is_bold = flag;

Display the text in boldface.

This attribute causes text to be displayed in boldface.

flag: true or false (default).

Example

is_bold = true;

Valid Tile

text

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


is_cancel =

is_cancel = flag;

Activate this button when [ESC] is pressed.

This attribute selects a button when the user presses the [Esc] key. Only one button in a dialog box is permitted to have the is_cancel attribute set to true. Typically, you use the is_cancel attribute for the Cancel button.

flag: true or false (default).

Example

is_cancel = true;

action = ("done_dialog");

NOTE When a button has the is_cancel attribute, you should have the action attribute call the LISP done_dialog function. If you don't, IntelliCAD automatically terminates the dialog box when the DIASTAT system variable is set to 0.

Valid Tile

button

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


is_default =

is_default = flag;

Activate this button when [Enter] is pressed.

This attribute specifies that a given button is considered the default button when the user presses [Enter]. Only one button in the dialog box is permitted to have the is_default attribute set to true. Typically, you use the is_default attribute for the OK or Apply button.

flag: true or false (default).

Example

is_default = true;

NOTE

    • The is_default attribute does not apply while another button has the focus.
    • Setting the initial_focus to the OK button ensures that is_default applies and allows the user to exit the dialog box quickly.

Valid Tile

button

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


is_enabled =

is_enabled = flag;

Enable or disable a tile.

This attribute determines whether a button is initially unavailable to the user (with the button usually appearing as grayed out). When flag = true, the button is available; when flag = false, the button is unavailable to the user.

flag: true (default) or false.

Example

is_enabled = false;

Valid Tiles

button

popup_list

edit_box

multi_edit_box

radio_button

image_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


is_tab_stop =

is_tab_stop = flag;

When the user presses [Tab], the focus jumps here.

This attribute determines which tiles receive focus when the user presses the [Tab] key. When flag = true (the default), pressing the [Tab] key causes focus to move to the tile. When flag = false, the tile is skipped over for the next tile. A disabled tile is always skipped, regardless of this attribute setting.

More than one tile in a dialog box may have this is_tab_stop attribute. By default, all tiles are set for "tab stopping."

flag: true (default) or false.

Example

is_tab_stop = false;

Valid Tiles

button

popup_list

edit_box

multi_edit_box

radio_button

image_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


key = "

key = "string";

Specify the name of a tile, as used by a LISP or SDS function.

This attribute specifies the name by which a LISP or SDS program refers to a tile. Each key must be unique within the dialog box. The string is case-sensitive.

string: a string.

Example

key = "R2";

Valid Tiles

button

popup_list

edit_box

multi_edit_box

radio_button

image_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


label = "

label = "string";

Specify a tile's label.

This attribute specifies the text of a tile's title; optionally, it specifies the tile's mnemonic. The position of the label depends on the type of tile; you cannot control its location. For no label, use " " as the string.

string: a string. The & (ampersand) prefix determines the mnemonic.

Examples

label = "Select a Viewport";

label = "&Open";

NOTE

    • The & (ampersand) prefix specifies the character that becomes the mnemonic. The mnemonic changes the focus but does not select a tile.
    • You can also use the mnemonic attribute to specify the mnemonic character.

Valid Tiles

boxed_row

boxed_column

boxed_radio_row

boxed_radio_column

button

dialog

edit_box

multi_edit_box

list_box

popup_list

radio_button

text

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


layout =

layout = position;

Determine whether the slider is horizontal or vertical.

This attribute determines the orientation of a slider: vertical or horizontal (the default).

position: horizontal (default) or vertical.

Example

layout = vertical;

NOTE Horizontal sliders increase in value from left to right; vertical sliders increase value from bottom to top.

Valid Tile

slider

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


list = "

list = "string";

Specify the initial values displayed by a list.

This attribute specifies the default text for a list_box or a popup_list (drop-down list box).

string: a string. Use the \n (new-line) character to separate lines.

Example

list = "North\nSouth\nEast\nWest";

NOTE You may use the \t (tab) character to space text into columns.

Valid Tiles

list_box

popup_list

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


lower_only =

lower_only = flag;

Force all input text to be lower-case.

When flag = true, this attribute converts the text that a user types to lowercase. When flag = false (the default), the text is not converted.

flag: true or false (default).

The lower_only attribute is unique to the implementation of DCL included with IntelliCAD.

Example

lower_only = true;

Valid Tiles

edit_box

multi_edit_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


max_value =

max_value = int;

Specify the maximum value of a slider.

This attribute specifies the maximum value that a slider tile returns.

int: a 32-bit integer; default = 10000 and maximum = 2,147,483,647.

Example

min_value = -16;

max_value = 16;

small_increment = 1;

big_increment = 10;

NOTE Horizontal sliders increase in value from left to right; vertical sliders increase in value from top to bottom.

The big_increment and small_increment attributes specify how much the slider increments when the user clicks the slider.

Valid Tile

slider

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


min_value =

min_value = int;

Specify the minimum value of a slider.

This attribute specifies the minimum value that a slider tile returns.

int: a 32-bit integer; default = 0 and minimum = -2,147,483,648.

Example

min_value = -16;

max_value = 16;

small_increment = 1;

big_increment = 10;

NOTE Horizontal sliders increase in value from left to right; vertical sliders increase value from top to bottom.

The big_increment and small_increment attributes specify how much the slider increments when the user clicks on slider.

Valid Tile

slider

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


mnemonic = "

mnemonic = "char";

Specify which tile has the focus when the user presses a key.

This attribute determines which tile receives the focus when the user presses a key. The character specified by the mnemonic attribute must exactly match a letter found in the tile's label attribute, including capitalization, as shown in the examples below. However, the user may enter either upper- or lower-case letters when using mnemonics. The mnemonic character need not be unique in the dialog box, allow the user to cycle through tiles with similar functions.

char: a character in the label of the tile.

Examples:

label = "3D View";

mnemonic = "3";

label = "Line";

mnemonic = "L";

label = "Donut";

mnemonic = "o";

Valid Tiles

button

popup_list

edit_box

multi_edit_box

radio_button

image_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


multiple_select =

multiple_select = flag;

Allow the user to select multiple items from the list box.

When flag = true, this attribute allows the user to select more than one item from a list box. When the user picks more than one item, each is highlighted.

flag: true or false (default).

Example

multiple_select = true;

Valid Tile

list_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


password_char = "

password_char = "char";

Display this character, instead of what the user is typing.

This attribute specifies the character to be displayed as the password character. Typically, you use the * (asterisk) character.

char: any single character.

Example

password_char = "*";

Valid Tiles

edit_box

multi_edit_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


pointsize =

pointsize = int;

Display text at this point size.

This attribute specifies the point size for text displayed by a dialog box. The point size affects both text displayed by the dialog box and the text typed by the user. Note that the pointsize attribute controls all text in a dialog box, but only if the typeface attribute has been set as well.

int: an integer in the range from -2,147,483,648 to +2,147,483,647. A larger number represents larger text.

The pointsize attribute is unique to the implementation of DCL included with IntelliCAD.

Example

pointsize = 10;

NOTE A point is 1/72 of an inch. More accurately, there are 72.72 points per inch. Typical point sizes used for dialog box text ranges between 8 (smaller text) and 12 (larger text) points. Do not use a large point size; doing so causes the dialog box to become too large for the screen, especiallyfor a 640- x 480-pixel screen.

Valid Tile

dialog

Tell me about...

typeface = "string";

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


read_only =

read_only = flag;

Prevent the user from editing the text.

When flag = true, this attribute prevents the user from modifying text displayed in a dialog box. This lets you display text in an otherwise editable edit box.

flag: true or false (default).

The read_only attribute is unique to the implementation of DCL included with IntelliCAD.

Example

read_only = true;

Valid Tiles

edit_box

multi_edit_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


small_increment =

small_increment = int;

Move the slider this much per click.

This attribute specifies how much a slider increments when the user clicks the end arrows of the slider.

int: an integer in the range of min_value and max_value . The default value is 1/100 of the total range.

Example

min_value = -16;

max_value = 16;

small_increment = 1;

big_increment = 10;

NOTE

    • The default value of min_value is 0; the minimum value is -2,147,483,648. The default value of max_value is 10000; the maximum value is 2,147,483,647.
    • Horizontal sliders increase in value from left to right; vertical sliders increase value from top to bottom.

Valid Tile

slider

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


tabs = "

tabs = "string";

Set up these tab stops.

This attribute specifies tab spacing, which is useful for creating vertical columns of text.

string: a string of real numbers or integers, each separated by a space.

Example

tabs = "5 10 15 20 25 30 35 40";

Valid Tiles

list_box

popup_list

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


tab_truncate =

tab_truncate = flag;

Cut off any text longer than the related tab stop.

This attribute specifies whether the text in a list_box or popup_list (drop-down list box) is truncated when it is longer than the related tab stop. Use this attribute to prevent text from going beyond the next tab stop.

flag: true or false (default).

Example

tab_truncate = true;

Valid Tiles

list_box

popup_list

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


typeface = "

typeface = "string";

Display text in this TrueType font.

This attribute specifies the name of the TrueType font to display throughout a dialog box. The font affects both text displayed by the dialog box and the text typed by the user.

string: name of a TrueType font.

The typeface attribute is unique to the implementation of DCL included with IntelliCAD.

Example

typeface = "Arial";

NOTE Do not specify fonts on another system. The three TrueType fonts safest to use and available on almost all Windows systems are: Arial, Times New Roman, and Courier New.

Valid Tile

dialog

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


upper_only =

upper_only = flag;

Force input text to be upper-case.

When flag = true, this attribute converts user typed text to upper-case. When flag = false (the default), the text is not converted.

flag: true or false (default).

The upper_only attribute is unique to the implementation of DCL included with IntelliCAD.

Example

upper_only = true;

Valid Tiles

edit_box

multi_edit_box

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


value = "

value = "string";

Specify the default value of a tile.

This attribute specifies the default value of a tile. The value depends on the type of tile.

string: a string; no default.

The following table summarizes the default value for each type of tile:

Tile Type | Default Value
boxed_radio_column | Key of the selected radio button.
boxed_radio_row | Key of the selected radio button.
dialog | Optional text for the dialog box's title bar.
edit_box | Default text seen by the user in the edit box.
image | Default image seen in the image box.
list_box | Lists items that are initially highlighted.
popup_list | Lists items that are initially highlighted.
radio_button | "1" = button is on; "0" = button is off.
radio_column | Key of the selected radio button.
radio_row | Key of the selected radio button.
slider | Default value of the slider.
text | Text displayed by the tile.
toggle | "1" = checked or on; "0" = unchecked or off.

Example

value = "1";

Valid Tiles

text

popup_list

edit_box

multi_edit_box

radio_button

slider

list_box

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


width =

width = number;

Specify the width of a tile.

This attribute specifies the minimum width of a tile. The width is automatically changed by the program unless established by the fixed_width attribute.

In general, use the width attribute with the image and image_button tiles. For other tiles, do not use this attribute unless you need to improve the appearance of the dialog box.

number: any real number or integer in units of character width. The "character width unit" is the lessor of either:

    • the width of the screen divided by 80,
    • or, the average width of all uppercase and lowercase characters (A - Z, a - z).

Example

width = 40;

NOTE The aspect_ratio attribute is used with either the height or width attribute. Do not use the aspect_ratio attribute when using both height and width.

Valid Tiles

all tiles

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: boxed_column

Place a border around a column of tiles, with an optional title. DCL Cluster Tile

This cluster tile places a rectangular border around a column of tiles (except radio buttons). As an option, you can include a title for the column. The border appears with no title when the label attribute is missing or is a null string: label = "";

NOTE

    • For a column of tiles without a border or title, use the column cluster.
    • To surround a column of radio buttons with a border, use the radio_button cluster.

Valid Attributes

: boxed_column {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

width = number;

}

Example

: boxed_column {

label = "Snap Setting";

width = 22;

}

Related DCL Tiles

dialog

column

row

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: boxed_radio_column

Place a rectangle around a column of radio buttons, with an optional title. DCL Cluster Tile

This cluster tile places a border around a column of radio buttons. When the label attribute is missing or a null string ("") is used, the border appears with no title.

NOTE

    • For a column of radio buttons without a border or title, use the radio_column cluster.
    • To place a border around a column of other tiles, use the boxed_column cluster.

Valid Attributes

: boxed _radio_column {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

value = "string";

width = number;

}

Example

: boxed_radio_column {

label="Edit Object;

width=40;

: radio_button {

action = "(trimlsp)";

key = "R3";

label = "Trim";

}

: radio_button {

action = "(extendlsp)";

key = "R4";

label = "Extend";

}

}

NOTE The value attribute indicates which radio button is currently selected by default, via the value of "1":

value = "1"

Related DCL Tiles

dialog

column

row

boxed_column

boxed_row

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: boxed_radio_row

Place a rectangle around a row of radio buttons, with an optional title. DCL Cluster Tile

This cluster tile places a border around a row of radio buttons. When the label attribute is missing or a null string ("") is used, the border appears without a title.

NOTE

    • For a row of radio buttons without a border or title, use the radio_row cluster.
    • To place a border around a row of other (non-radio button) tiles, use the boxed_row cluster.
    • The value attribute indicates which radio button is currently selected by default, via the value of "1":

value = "1"

Valid Attributes

: boxed_radio_row {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

value = "string";

width = number;

}

Example

: boxed_radio_row {

label="Edit Corner"

: radio_button {

action = "(chamferlsp)";

key = "R5";

label = "Chamfer";

}

: radio_button {

action = "(filletlsp)";

key = "R6";

label = "Fillet";

}

}

Related DCL Tiles

dialog

column

row

boxed_column

boxed_row

boxed_radio_column

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: boxed_row

Place a rectangle around a row of tiles, with an optional title. DCL Cluster Tile

This cluster tile places a border around a row of tiles (except radio buttons). The border appears without a title when the label attribute is missing or a null string ("") is used.

NOTE

    • For a row of tiles without a border or title, use the row cluster.
    • To place a border around a row of radio buttons, use the boxed_radio_row cluster.

Valid Attributes

: boxed_row {

alignment = position;

children_alignment = flag;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

width = number;

}

Example

: boxed_row {

label="Select Objects";

: button {

action = "(linelsp)";

key = "BB";

label = "Line";

}

: button {

action = "(circlelsp)";

key = "BW";

label = "Circle";

}

}

Related DCL Tiles

dialog

column

row

boxed_column

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: button

Create a button with or without a label. DCL Active Tile

This active tile creates a button, with or without a superimposed label. A button is generally used to exit a dialog box or to display another box ("tunneling dialog boxes"). Every dialog box must have at least one button, which is connected to the LISP function done_dialog; otherwise the program hangs.

: button {

action = "(done_dialog)";

label = "OK";

}

NOTE Several predefined tiles provide the most common button clusters, including the ok_only attribute, ok_cancel, and ok_cancel_help tiles.

Valid Attributes

: button {

action = "(string)";

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

is_cancel = flag;

is_default = flag;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

mnemonic = "char";

width = number;

}

Example

: button {

action = "(convdxf)";

label="Convert to DXF";

mnemonic="C";

key="BC";

}

NOTE The label attribute indicates the text on the button-for example:

label = "Sync Grid to Snap"

Related DCL Tiles

edit_box

image_button

list_box

popup_list

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: column

Position a column of tiles, with an optional title. DCL Cluster Tile

This cluster tile positions a series of tiles in a vertical column without a border. The column cluster can hold any tile except a individual radio_button. To place a box around the column of tiles, use the boxed_column cluster.

NOTE Columns do not have titles unless they are boxed.

Valid Attributes

: column {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

width = number;

}

Example

: column {

: button {

action = "(linecmd)";

key = "BL";

label = "Line";

}

: button {

action = "(arccmd)";

key = "BA";

label = "Arc";

}

}

Related DCL Tiles

dialog

row

boxed_column

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: concatenation

Concatenate one or more text_part tiles. DCL Text Tile

This text tile joins one or more text strings together. The strings are defined in the text_part tile, which places no margins around the text; however, a margin does exist around the entire concatenation.

NOTE By contrast, the paragraph cluster tile stacks text vertically.

Valid Attributes

none

Example

: concatenation {

text_part {label = "This";}

text_part {label = " is";}

text_part {label = " text.";}

}

Related DCL Tiles

paragraph

text

text_part

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: edit_box

Let the user type a line of text. DCL Active Tile

This active tile displays an edit box tile that prompts the user to type a number or text. Text in the edit box is left-justified. The program appends the null character (\0) to the end of the string the user types. If an edit_limit is specified, and the specified character count is reached, all user entry other than backspace and delete are ignored.

Valid Attributes

: edit_box {

action = "(string)";

alignment = position;

allow_accept = flag;

edit_limit = int;

edit_width = number;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

lower_only = flag;

mnemonic = "char";

password_char = "char";

read_only = flag;

upper_only = flag;

value = "string";

width = number;

}

Example

: edit_box {

action = "(texted)";

allow_accept = true;

edit_limit = 31;

key = "EB";

label = "File name: ";

mnemonic = "F";

value = "drawing";

}

NOTE

    • The label attribute defines the edit box's title; it is left-justified.
    • The value attribute holds the initial text displayed by the edit box; it is left-justified.
    • The following attributes are unique to the implementation of DCL included with IntelliCAD: lower_only, read_only, and upper_only.

Related DCL Tiles

button

image_button

list_box

popup_list

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


errtile;

Display an error message at the bottom of a dialog box. DCL Error Handler Tile

This error handler tile displays a brief error message at the bottom of a dialog box. You can display a message in an errtile by setting the value of the tile that has the key "error." The errtile tile is blank by default.

Notice that the format of this tile differs from most other tiles. There is no : (colon) prefix nor brace ({}) suffix.

Valid Attributes

none

Example

errtile;

Related DCL Tiles

ok_only

ok_cancel

ok_cancel_help

ok_cancel_help_errtile

ok_cancel_help_info

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: image

Display an image. DCL Decorator Tile

This decorator tile displays an image created by LISP or SDS functions that draw vector images. The image can consist of a solid color, an icon, or other images.

For this tile, you must specify both the height and width attributes, or specify the aspect_ratio attribute along with either height or width (but not with both attributes).

Valid Attributes

: image {

action = "(string)";

alignment = position;

aspect_ratio = real;

color = clr;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

mnemonic = "char";

value = "string";

width = number;

}

Example

: image {

action = "(dimvars)";

height = 24;

key = "DB";

width = 36;

}

Related DCL Tiles

image_button

spacer

spacer_0

spacer_1

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: image_button

Display an image on a button. DCL Active Tile

This active tile displays an image on a button. This function returns the x,y coordinates of the user's pick point.

For this tile, you must specify both the height and width attributes, or specify the aspect_ratio attribute along with either height or width (but not with both attributes).

Valid Attributes

: image_button {

action = "(string)";

alignment = position;

allow_accept = flag;

aspect_ratio = real;

color = clr;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

mnemonic = "char";

width = number;

}

Example

: image_button {

aspect_ratio = 1.33;

height = 2;

action = "(fontlsp)";

key = "FN";

}

Related DCL Tiles

button

edit_box

list_box

popup_list

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: list_box

Display a vertical list of text, with optional scrollbar and title. DCL Active Tile

This active tile displays a list box. When the user selects an item, it is highlighted. A scroll bar appears automatically when there are more items than the list_box tile is able to display.

Creating and Modifying a List Box with LISP Functions

To create and modify the list displayed by the list_box tile, use these LISP functions:

  • ( start_list "key" int1 int2)
    • The start_list function takes three arguments. The key argument identifies the name of the list_box tile. The int1 argument specifies the action to take:

int1 | Meaning
1 | Change one item in the list.
2 | Add an item to the end of the list.
3 | Create a new list; the default.

    The int2 argument specifies the item # to change (the first item in the list is #0); int2 is only used when int1 is 1. For example:

    (start_list "L1" 1 3 ; changes the fourth item in the list.

  • ( add_list "string")
    • To make the change, use the add_list function. The string argument specifies the text to be added or replaced in the list:

    (start_list "L1" 1 3 ; Changes the fourth item in the list.

    (add_list "New item")
    When start_list is in change mode (int1 = 1), each call to the add_list changes the same item. When start_list is in add mode (int1 = 2), each call to the add_list adds another item to the end of the list.

  • ( end_list )
    • To end the list processing, call the end_list function as follows:

    (start_list "L1" 1 3 ; changes the fourth item in the list.

    (add_list "New item")

    (end_list)

NOTE There are no LISP functions for inserting an item in the middle of the list nor for deleting an item from the list.

Valid Attributes

: list_box {

action = "(string)";

allow_accept = flag;

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

list = "string";

mnemonic = "char";

multiple_select = flag;

tabs = "string";

value = "string";

width = number;

}

Example

: list_box {

action = "(subdir)";

label = "Select a color:";

list = "Red\nGreen\nBlue";

value = "0";

}

NOTE

    • Use the \n (new-line) character within the list attribute to separate lines.
    • The label attribute displays the text above the list box.
    • The value attribute determines which items on the list are initially selected or highlighted. The attribute consists of a string of integers separated by spaces, as in the following:

    value = "0 2 5";

    • The first item is #0. A null string "" means no items are highlighted. When the multiple_select attribute is false, the value attribute must contain a single integer.

Related DCL Tiles

button

edit_box

image_button

popup_list

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: multi_edit_box

Display an edit box with more than one line. DCL Active Tile

This active tile displays a multiline edit box tile, which allows the user to type additional lines of text. Text in the multi_edit_box tile is left-justified. The program appends the null character (\0) to the end of the string.

The multi_edit_box tile is unique to the implementation of DCL included with IntelliCAD.

Valid Attributes

: multi_edit_box {

action = "(string)";

alignment = position;

allow_accept = flag;

edit_limit = int;

edit_width = number;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

lower_only = flag;

mnemonic = "char";

password_char = "char";

read_only = flag;

upper_only = flag;

value = "string";

width = number;

}

Example

: multi_edit_box {

action = "(texted)";

edit_limit = 40;

key = "EB";

label = "Type text: ";

mnemonic = "T";

}

NOTE

    • The label attribute is the multiline edit box's title; it is left-justified.
    • The value attribute holds the initial text displayed by the multiline edit box; is left-justified.
    • The following attributes are unique to the implementation of DCL included with IntelliCAD: lower_only, read_only, and upper_only.

Related DCL Tiles

button

image_button

list_box

popup_list

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


IDR_DCL_B50

name : dialog

Create a dialog box. DCL Cluster Tile

This cluster tile defines a dialog box. The name prefix defines the case-sensitive name of the dialog box. This name is required to identify the dialog box within the DCL file.

To access the dialog box within LISP, use the load_dialog (to load the DCL file) and the new_dialog (to display the dialog box) functions, as in the following example:

(setq dlg (load_dialog "dclfile"))

(new_dialog "name" dlg)

NOTE When both the label and value attributes are defined, value takes precedence over label.

Valid Attributes

name : dialog {

initial_focus = "string";

label = "string";

pointsize = int;

typeface = "string";

value = "string";

}

Example

objext : dialog {

initial_focus = "OK"

label = "Object Extraction"

: boxed_row {

label="Select Objects";

: button {

action = "(linelsp)";

key = "BB";

label = "Line";

}

: button {

action = "(circlelsp)";

key = "BW";

label = "Circle";

}

}

}

Related DCL Tiles

column

row

boxed_column

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


ok_cancel;

Display OK and Cancel buttons. DCL Error Handler Tile

This error handler tile displays the OK and Cancel buttons.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

The program pre-assigns a key to each button, as follows:

Button | Key
OK | "accept"
Cancel | "cancel"

NOTE To display only the OK button in a dialog box (for example, in a message or alert box), use the ok_only.

Valid Attributes

none

Example

ok_cancel;

Related DCL Tiles

errtile

ok_only

ok_cancel_help

ok_cancel_help_errtile

ok_cancel_help_info

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


ok_cancel_help;

Display the OK, Cancel, and Help buttons. DCL Error Handler Tile

This error handler tile displays the OK, Cancel, and Help buttons. It is useful to have the Help button call the LISP help function.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

The program pre-assigns a key to each button, as follows:

Button | Key
OK | "accept"
Cancel | "cancel"
Help | "help"

Valid Attributes

none

Example

ok_cancel_help;

Related DCL Tiles

errtile

ok_only

ok_cancel

ok_cancel_help_errtile

ok_cancel_help_info

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes

sds_help


ok_cancel_help_errtile;

Display the OK, Cancel, and Help buttons, plus an error message. DCL Error Handler Tile

This error handler tile displays the OK, Cancel, and Help buttons, along with an error message (if necessary) at the bottom of a dialog box. It is useful to have the Help button call the LISP help function.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

The program pre-assigns a key to each button, as follows:

Button | Key
OK | "accept"
Cancel | "cancel"
Help | "help"
errtile | "error"

Valid Attributes

none

Example

ok_cancel_help_errtile;

Related DCL Tiles

errtile

ok_only

ok_cancel

ok_cancel_help

ok_cancel_help_info

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes

sds_help


ok_cancel_help_info;

Display the OK, Cancel, Help, and Info buttons. DCL Error Handler Tile

This error handler tile displays the OK, Cancel, Help, and Info buttons. You can use the Info button to display a dialog box with additional information for the user. It is useful to have the Help button call the LISP help function.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

The program pre-assigns a key to each button, as follows:

Button | key
OK | "accept"
Cancel | "cancel"
Help | "help"
Info | "info"

Valid Attributes

none

Example

ok_cancel_help_info;

Related DCL Tiles

errtile

ok_only

ok_cancel

ok_cancel_help

ok_cancel_help_errtile

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes

sds_help


ok_only;

Display an OK button. DCL Error Handler Tile

This error handler tile displays a button with the OK label. This tile has a pre-assigned key of "accept." This tile is most useful when displaying a message or alert that doesn't offer alternative actions. The user clicks the button to confirm having read the message or alert and to close the dialog box.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

NOTE For most dialog boxes, you'll want to use the ok_cancel tile instead of this tile.

Valid Attributes

none

Example

ok_only;

Related DCL Tiles

errtile

ok_cancel

ok_cancel_help

ok_cancel_help_errtile

ok_cancel_help_info

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: paragraph

Display a vertical cluster of text. DCL Cluster Tile

This cluster tile stacks text vertically and adds a margin around itself. Note that this is in contrast to the concatenation tile, which "stacks" text horizontally.

Valid Attributes

none

Example

: paragraph {

text_part { label = "This text is above";}

text_part { label = "this lower text.";}

}

Related DCL Tiles

concatenation

text

text_part

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: popup_list

Display a drop-down list. DCL Active Tile

This active tile displays a drop-down list box. Contrary to its name, the popup_list drops down, not up.

The popup_list tile first appears as a single line, and more of the list appears when the user clicks the down-arrow. If necessary, the dropped down list also includes This tile is useful when dialog box space is limited.

NOTE By contrast, a list_box tile displays at least two lines of a list by default, along with vertical scrollbars, if necessary. Also, a list_box can permit multiple selections, which a popup_list does not permit.

Creating and Modifying a Pop-up List with LISP Functions

To create and modify the list displayed by the popup_list tile, use these LISP functions:

  • ( start_list "key" int1 int2)
    • The start_list function takes three arguments. The key argument identifies the name of the popup_list tile. The int1 argument specifies the action to take:

int1 | Meaning
1 | Change one item in the list.
2 | Add an item to the end of the list.
3 | Create a new list; the default.

    The int2 argument specifies the item # to change (the first item in the list is #0); int2 is only used when int1 is 1. For example:

    (start_list "L1" 1 3 ; changes the fourth item in the list.

  • ( add_list "string")
    • To make the change, use the add_list function. The string argument specifies the text that will be added or replaced in the list:

    (start_list "L1" 1 3 ; Changes the fourth item in the list.

    (add_list "New item")

    When start_list is in change mode (int1 = 1), each call to add_list changes the same item. When start_list is in add mode (int1 = 2), each call to add_list adds another item to the end of the list.

  • (end_list)
    • To end the list processing, call the end_list function, as follows:

    (start_list "L1" 1 3 ; changes the fourth item in the list.

    (add_list "New item")

    (end_list)

NOTE There are no LISP functions for inserting an item in the middle of the list nor for deleting an item from the list.

Valid Attributes

: popup_list {

action = "(string)";

alignment = position;

edit_width = number;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

list = "string";

mnemonic = "char";

tabs = "string";

value = "string";

width = number;

}

Example

: popup_list {

action = "(patternlsp)";

edit_width = 0;

key = "PL2";

value = "Closed\nFilled\nOpen";

list = "2";

}

NOTE

    • The label attribute displays the text to the left of the popup list box.
    • The value attribute determines which items on the list are initially selected or highlighted. The attribute consists of a string of integers separated by spaces, such as:
      value = "0 2 5";
    • The first item is #0. A null string "" means no items are highlighted.

Related DCL Tiles

button

edit_box

image_button

list_box

radio_button

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: radio_button

Display a radio button. DCL Active Tile

This active tile displays a radio button. A dot appears when the radio button is turned on or selected. The special character of the radio button signifies that the user can select only one radio button at a time; when one radio button is selected, any other radio button (in the same cluster) is turned off.

A radio_button tile must be placed within a radio_column or radio_row cluster tile. Otherwise, The program does not know which radio buttons are related to each other.

If you want to allow the user to select more than one option, use check boxes (via the toggle tile) instead.

NOTE When you write a DCL file that has more than one radio button in a radio_column or radio_row cluster turned on (value = "1"), the program ignores all "turned-on" radio buttons after the first one.

Valid Attributes

: radio_button {

action = "(string)";

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

mnemonic = "char";

value = "string";

width = number;

}

Example

: radio_button {

action = "(parent)";

key = "R21";

label = "Parent";

}

NOTE The value attribute indicates which radio button is currently selected, via the value of "1":

value = "1"

Related DCL Tiles

button

edit_box

image_button

list_box

popup_list

slider

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: radio_column

Display a vertical column of radio buttons. DCL Cluster Tile

This cluster tile groups together one or more radio buttons in a vertical column. A radio_button tile must be placed either within this tile or within a radio_row cluster tile. Otherwise, the program does not know which radio buttons are related to each other.

NOTE A radio_column cluster can only contain radio buttons. Use the column cluster for other tiles.

Valid Attributes

: radio_column {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

value = "string";

width = number;

}

Example

: radio_column {

label = "3D Viewpoints";

: radio_button {

action = "(frontview)";

key = "R1";

label = "Front View";

}

: radio_button {

action = "(topview)";

key = "R2";

label = "Top View";

}

}

NOTE The value attribute indicates which radio button is currently selected, via the value of "1":

value = "1"

Related DCL Tiles

dialog

column

row

boxed_column

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: radio_row

Display a row of radio buttons. DCL Cluster Tile

This cluster tile groups one or more radio buttons in a horizontal row. A radio_button tile must be placed either within this tile or within a radio_column cluster tile. Otherwise, the program does not know which radio buttons are related to each other.

NOTE A radio_row cluster can only contain radio buttons. Use the row cluster for other tiles.

Valid Attributes

: radio_row {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

width = number;

}

Example

: radio_row {

label = "3D Viewpoints";

: radio_button {

action = "(leftview)";

key = "R11";

label = "Left View";

}

: radio_button {

action = "(riteview)";

key = "R22";

label = "Right View";

}

}

NOTE The value attribute indicates which radio button is currently selected, via the value of "1":

value = "1"

Related DCL Tiles

dialog

column

row

boxed_column

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: row

Display a row of horizontal tiles. DCL Cluster Tile

This cluster tile positions a series of tiles in a horizontal row without a border. The row cluster can hold any tile except an individual radio_button (use the radio_column or radio_row cluster tiles to group radio buttons).

NOTE To place a box around the column of tiles, use the boxed_row cluster.

Valid Attributes

: row {

alignment = position;

children_alignment = position;

children_fixed_height = flag;

children_fixed_width = flag;

fixed_height = flag;

fixed_width = flag;

height = number;

label = "string";

width = number;

}

Example

: row {

: button {

action = "(zoomcmd)";

key = "BZ";

label = "Zoom";

}

: button {

action = "(pancmd)";

key = "BP";

label = "Pan";

}

}

Related DCL Tiles

dialog

column

row

boxed_column

boxed_row

boxed_radio_column

boxed_radio_row

radio_column

radio_row

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: slider

Display a horizontal or vertical slider. DCL Active Tile

This active tile displays a slider bar, which can be horizontal or vertical. The slider moves faster or slower depending on where the user clicks.

Valid Attributes

: slider {

action = "(string)";

alignment = position;

big_increment = int;

fixed_height = flag;

fixed_width = flag;

height = number;

key = "string";

label = "string";

layout = position'

max_value = int;

min_value = int;

mnemonic = "char";

small_increment = int;

value = "string";

width = number;

}

Example

: slider {

action = "(slider)";

big_increment = 32;

key = "S1";

max_value = 512;

min_value = 0;

small_increment = "1";

value = "16";

}

NOTE The value attribute indicates the default value of the slider bar; the default is min_value.

Related DCL Tiles

button

edit_box

image_button

list_box

popup_list

radio_button

toggle

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: spacer

Insert a blank tile. DCL Decorator Tile

This decorator tile places a blank area in a dialog box. While you can use spacer to help position other tiles, this tile is usually not necessary since the program normally positions all tiles automatically with appropriate spacing.

Valid Attributes

: spacer {

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

width = number;

}

Example

: spacer {

height = "5";

width = "10";

}

Related DCL Tiles

spacer_0

spacer_1

Tell me about...

Programming Overview of DCL

About Predefined Attributes


spacer_0;

Insert a blank tile that grows dynamically. DCL Decorator Tile

This decorator tile creates a blank tile that changes size. The spacer_0 tile is useful for deliberately creating an extra distance between two tiles, such as a pair of buttons. This function tells the program where to put extra space.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

Valid Attributes

none

Example

spacer_0;

Related DCL Tiles

spacer

spacer_1

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


spacer_1;

Insert a unit blank tile with width and height of 1. DCL Decorator Tile

This decorator tile inserts a blank tile with the height and width attributes preset to 1.

Notice that the format of this tile differs from most other tiles: there is no : (colon) prefix nor { ... } (brace) suffix.

Valid Attributes

none

Example

spacer_1;

Related DCL Tiles

spacer

spacer_0

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: text

Display a string of text. DCL Text Tile

This text tile displays a string of text. Use the text tile together with the concatenation and paragraph clusters to create horizontal and vertical stacks of text, respectively.

NOTE Most tiles have their own title (via the label attribute), so this function is rarely used.

Valid Attributes

: text {

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

is_bold = flag;

key = "string";

label = "string";

value = "string";

width = number;

}

Example

: text {

key = "T12";

label = "How to use IntelliCAD:";

}

Related DCL Tiles

concatenation

paragraph

text_part

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: text_part

Display multiple segments of text. DCL Text Tile

This text tile is used together with the concatenation and paragraph tiles to display several segments of text.

Valid Attribute

: text_part {

label = "string";

}

Example

: concatenation {

text_part {label = "This";}

text_part {label = " is";}

text_part {label = " text.";}

}

Related DCL Tiles

concatenation

paragraph

text

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


: toggle

Display a check box. DCL Active Tile

This active tile displays a check box. When turned on, the check box contains a check mark and the value attribute returns 1. The text for the associated label attribute appears to the right of the box.

Valid Attributes

: toggle {

action = "(string)";

alignment = position;

fixed_height = flag;

fixed_width = flag;

height = number;

is_enabled = flag;

is_tab_stop = flag;

key = "string";

label = "string";

mnemonic = "char";

value = "string";

width = "string";

}

Example

: toggle {

action = "(osnap)";

label = "Object Snap Mode";

value = "1"

}

NOTE The value attribute indicates whether the check box is currently selected (indicated by a check mark), via the value of "1":

value = "1"

Related DCL Tiles

button

edit_box

image_button

list_box

popup_list

radio_button

slider

Tell me about...

Programming Overview of DCL (Dialog Control Language)

About Predefined Attributes


dlg_action_tile

int dlg_action_tile (sds_hdlg handle, char *key, void *expression);

Respond when the user clicks a dialog box tile.

This function assigns the expression to evaluate when the user selects the tile referenced by key.

The key argument refers to the tile. (In this case, the tile is a user-selectable element of a dialog box, such as radio button, check box, or button.)

The handle argument is the name of the dialog box.

The expression is a pointer to a function called when the tile is selected:

Argument | Meaning
$value | Current value.
$key | Tile name.
$data | Application specific data.
$reason | Callback reason.
$x | Image x-coordinate.
$y | Image y-coordinate.

The function returns RTNORM if successful; otherwise, it returns an error code.

NOTE The expression assigned by dlg_action_tile overrules the default action of the dialog box (which is assigned by the dlg_new_dialog function) and the tile's action attribute.

Tell me about...

dlg_client_data_tile

dlg_new_dialog

Programming Overview of DCL (Dialog Control Language)

Programming Overview of SDS™ (Solutions Development System™)


dlg_add_list

int dlg_add_list (char *string);

Add text to an existing dialog box string.

This function adds (or replaces) a string in the list of the currently active dialog box. This function must follow the dlg_start_list function, which determines: (1) which string is affected; and (2) whether the string is added or replaces another string.

Tell me about...

dlg_start_list

Programming Overview of SDS™ (Solutions Development System™)


dlg_client_data_tile

int dlg_client_data_tile (sds_hdlg handle, char *key, void *data);

Associate data with a dialog box tile.

This function associates user-defined data with a dialog box tile.

The handle argument is the name of the dialog box.

The key argument specifies the tile.

The data argument specifies the data via callbacks.

This function returns RTNORM or an error code.

Tell me about...

dlg_action_tile

dlg_get_attr

dlg_get_tile

dlg_mode_tile

dlg_set_tile

Programming Overview of SDS™ (Solutions Development System™)


dlg_dimensions_tile

int dlg_dimensions_tile (sds_hdlg handle, char *key, short *width, short *height);

Determine the x-and y dimensions of this dialog box tile.

This function returns the x,y dimensions of the tile with the name key. The x,y dimensions are typically used by other dialog box functions: dlg_fill_image, dlg_slide_image, and dlg_vector_image .

The handle argument is the name of the dialog box.

The key argument specifies the tile; it is case-sensitive.

The width argument is the x-coordinate of the tile; the height is the y-coordinate, using a 0-based system.

NOTES

  • The dimension returned is one less than the size, since the dimension begins at 0. Thus, the size of the tile is 16 x 16 when width and height are both 15.
  • The key is a case-sensitive string.
  • This function returns RTNORM or an error code.

Tell me about...

dlg_fill_image

dlg_slide_image

dlg_vector_image

Programming Overview of SDS™ (Solutions Development System™)


dlg_done_dialog

int dlg_done_dialog (sds_hdlg handle, long message);

Dismiss this dialog box.

This function terminates a dialog box.

The handle argument is the name of the dialog box to close.

The following table summarizes the meaning indicated by the message argument:

Message | Meaning
DLGOK | User clicked OK button.
DLGCANCEL | User clicked Cancel button.
DLGALLDONE | Dialog box is not active.
DLGSTATUS | When status >=l DLGSTATUS; the code was generated by an application.

This function returns RTNORM if successful, or else it returns an error code.

Tell me about...

dlg_action_tile

dlg_new_dialog

dlg_start_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_done_positioned_dialog

int dlg_done_positioned_dialog (sds_hdlg handle, int message, int *xpos, int ypos);

Terminate the dialog box, but remember its position.

This function closes a dialog box and returns the x,y position, so that another dialog box can appear in the same location.

The handle argument is the name of the dialog box.

The following table summarizes the meaning indicated by the message argument:

Message | Meaning
DLGOK | User clicked OK button.
DLGCANCEL | User clicked Cancel button.
DLGALLDONE | Dialog box is mot active.
DLGSTATUS | When status >=DLGSTATUS; the code was generated by an application.

The xpos argument returns the x-coordinate of the dialog box's lower-right corner; the ypos argument returns the x-coordinate. The origin (0,0) of the dialog box is at the upper-left corner.

This function returns RTNORM if successful, or else it returns an error code.

Tell me about...

dlg_action_tile

dlg_new_dialog

dlg_new_positioned_dialog

dlg_start_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_end_image

int dlg_end_image (void);

End the creation of a dialog box image.

This function signals the end of the creation of an image in the current dialog box, which was begun by the dlg_start_image function.

This function returns RTNORM if successful, or else it returns an error code.

Tell me about...

dlg_start_image

Programming Overview of SDS™ (Solutions Development System™)


dlg_end_list

int dlg_end_list (void);

End the creation of a dialog box list.

This function signals the end of processing a list in the current dialog box, which was begun by the dlg_start_list function.

This function returns RTNORM if successful, or else it returns an error code.

Tell me about...

dlg_add_list

dlg_start_list

Programming Overview of SDS™ (Solutions Development System™)


dlg_fill_image

int dlg_fill_image (int x, int y, int width, int height, int color);

Fill a dialog box's rectangle with color.

This function draws a rectangle (or square), and then fills it with a color. This function must be used between the dlg_start_image and dlg_end_image functions.

The x and y arguments specify the upper-left corner of the rectangle.

The width and height arguments indicate the relative distance to the lower-right corner; these two arguments must be positive. If you obtained the lower-right coordinates from the dlg_dimension_tile functions, then the origin (0,0) is the upper-left corner.

The color argument is an IntelliCAD color number or a logical color number:

Color number | Description
-2 | Current background of the IntelliCAD graphics screen.
-15 | Current dialog box background color.
-16 | Current dialog box foreground color.
-18 | Current dialog box line color.

This function returns RTNORM when successful, or an error code, if not.

Tell me about...

dlg_slide_image

dlg_vector_image

Programming Overview of SDS™ (Solutions Development System™)


dlg_get_attr

int dlg_get_attr (sds_hdlg handle, char *key, char *attribute, char *value, int length);

Determine the DCL value of this tile's attribute.

This function returns the value of the dialog box attribute. The key argument specifies the dialog box tile; key is a string and is case-sensitive.

The attribute argument is the name of the attribute. See the DCL Programming Reference for valid attribute names.

The value argument is the value of the attribute returned by this function.

NOTE When working with a callback function, use dlg_get_attr_string inside the callback function instead.

Tell me about...

dlg_get_attr_string

dlg_get_tile

dlg_set_tile

Programming Overview of SDS™ (Solutions Development System™)


dlg_get_attr_string

int dlg_get_attr_string (sds_htile handle, char *attribute, char *value, long length);

Determine the DCL value of this tile's attribute.

This function returns the value of the dialog box attribute. Note that this value changes due to user input, as well as calls made by the dlg_get_attr function. Unlike dlg_get_attr, this function is used inside a callback function.

The key argument specifies the dialog box tile; key is a string and is case-sensitive.

The attribute argument is the name of the attribute. See the DCL Programming Reference for valid attribute names.

The value argument is the value of the attribute returned by this function.

NOTES

  • The value argument does not return the current value of the argument; instead, it is the original value set by the DCL file.
  • The length argument is a memory buffer large enough to hold the value plus the EOL terminator.
  • This function returns RTNORM when successful, or an error code, if not.

Tell me about...

dlg_get_attr

dlg_get_tile

dlg_set_tile

Programming Overview of SDS™ (Solutions Development System™)


dlg_get_tile

int dlg_get_tile (sds_hdlg handle, char *key, char *value, long length);

Determine the value of this dialog box's tile.

This function returns the value of a dialog box tile.

The handle argument is the name of the dialog box.

The key argument specifies the dialog box tile; key is a string and is case-sensitive.

The value argument is the value of the tile returned by this function.

The length argument allocates sufficient memory to return value, plus one character for the EOL (end-of-line) indicator.

Tell me about...

dlg_get_attr

dlg_get_attr_string

Programming Overview of SDS™ (Solutions Development System™)


dlg_load_dialog

int dlg_load_dialog (char *filename, int *key);

Load a dialog definition file.

This function loads a DCL dialog control language file. DCL files must be loaded before IntelliCAD can display a custom dialog box.

The filename argument is the name of the DCL file.

The key argument is a system name for the dialog box, which is used by the key argument in other DLG functions.

This function returns the RTNORM or RTERROR.

Tell me about...

dlg_unload_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_mode_tile

int dlg_mode_tile (sds_hdlg handle, char *key, int mode);

Set the mode of the dialog box's tile.

This function sets the mode of the tile identified by key.

The handle argument is the name of the dialog box.

The key argument is the case-sensitive name of the tile.

The mode argument takes one of the following integers:

Mode | Name | Meaning
0 | MODE_ENABLE | Enable tile.
1 | MODE_DISABLE | Disable tile.
2 | MODE_SETFOCUS | Set the focus to the tile.
3 | MODE_SETSEL | Select the contents of an edit box.
4 | MODE_FLIP | Change image highlighting between on and off.

This function returns RTNORM or an error code.

Tell me about...

dlg_get_attr

dlg_get_tile

Programming Overview of SDS™ (Solutions Development System™)


dlg_new_dialog

int dlg_new_dialog (char *dialog, int dlg-file, void *callback, sds_hdlg *handle);

Display a dialog box.

Use this function to display a dialog box.

The dialog box is identified by dialog within the DCL DCL(ICAD_Glossary.hlp)file named dcl-file. The string dialog is obtained from the dlg_load_dialog function.

The dlg_new_dialog function optionally executes the routine identified by the callback argument. To ignore this argument, use NULLCB.

When the dlg_new_dialog function is successful, it returns RTNORM and sets the handle argument with a handle name. When an error occurs, this function returns RTERROR and sets the handle argument with NULL.

NOTE After you use dlg_new_dialog the first time to initialize a dialog box, then use the dlg_new_positioned_dialog function to display a dialog box at a specific screen location.

Tell me about...

dlg_load_dialog

dlg_start_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_new_positioned_dialog

int dlg_new_positioned_dialog (char *dialog, int dcl-file, void *callback, int x, int y, sds_hdlg *handle);

Display a dialog box at a specific location.

Use this function to display a dialog box at a specific location on the screen. This function is meant to be used the second time you open this dialog box. Because you do not know what the size of the IntelliCAD window will be, use the dlg_new_dialog function the first time you initialize the dialog box.

The dialog box is identified by dialog within the DCL DCL(ICAD_Glossary.hlp)file named dcl-file. The string dialog is obtained from the dlg_load_dialog function.

The dlg_new_positioned_dialog function optionally executes the routine identified by the callback argument. To ignore this argument, use NULLCB.

The x and y arguments are the coordinates of the lower-right corner of the dialog box. The upper-left coordinates are (0,0). You should get the x,y coordinates from dlg_done_positioned_dialog. When x and y are both set to -1, IntelliCAD opens the dialog box in the center of the window.

When the dlg_new_ positioned_dialog function is successful, it returns RTNORM and sets the handle argument with a handle name. When an error occurs, this function returns RTERROR and sets the handle argument with NULL.

Tell me about...

dlg_done_positioned_dialog

dlg_load_dialog

dlg_start_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_set_tile

int dlg_set_tile (sds_hdlg handle, char *key, char *value);

Set the value of the dialog box tile.

This function sets the value of a dialog box tile.

The handle argument is the name of the dialog box.

The key argument is a case-sensitive string that specifies the tile.

The value attribute is the value to assign to the tile.

The function returns RTNORM if successful; otherwise, it returns an error code.

Tell me about...

dlg_get_tile

Programming Overview of SDS™ (Solutions Development System™)


dlg_slide_image

int dlg_slide_image (int x, int y, int width, int height, char *name);

Display a slide in the dialog box.

This function displays an image in a dialog box. The image is positioned at x,y coordinates. These coordinates are the upper-left corner of the image.

The width argument specifies the relative width of the image in the negative x-direction. The height argument specifies the relative height of the image in the negative y-direction. The origin is the upper-left corner of the image.

The name argument is the name of the snapshot file, which can be in EMF (enhanced metatfile), WMF (windows metafile), or SLD (slide) format.

NOTES

  • Use the MSlide command to create an image. For good reproduction, create the snapshot at the same size and aspect ratio (usually 4:3) that you plan to display the image in the dialog box.
  • Obtain the coordinates of the lower-right corner by calling the dlg_dimensions_tile function
  • This function returns RTNORM if successful; otherwise, it returns an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


dlg_start_dialog

int dlg_start_dialog (sds_hdlg handle, int *status);

Start that dialog box.

This function displays a dialog box and accepts user clicks of the mouse.

The handle argument is the name of the dialog box.

This function returns a code in the status argument, which is later used by the dlg_done_dialog function:

Status | Meaning
DLGOK | User clicked OK button.
DLGCANCEL | User clicked Cancel button.
DLGALLDONE | The dlg_term_dialog function was used.

NOTE A dialog box is first initialized by the dlg_new_dialog function.

Tell me about...

dlg_done_dialog

dlg_new_dialog

dlg_term_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_start_image

int dlg_start_image (sds_hdlg handle, char *key);

Start creating a dialog box image.

This function signals the start of the image key in a dialog box. This function is used to precede the other dialog box drawing functions: dlg_fill_image, dlg_slide_image, and dlg_vector_image. End the drawing with the dlg_end_image function.

The handle argument is the name of the dialog box.

The key argument identifies the tile.

This function returns RTNORM if successful; otherwise, it returns an error code.

Tell me about...

dlg_fill_image

dlg_slide_image

dlg_vector_image

Programming Overview of SDS™ (Solutions Development System™)


dlg_start_list

int dlg_start_list (sds_hdlg handle, char *key, int value, int item);

Start processing a list box.

This function signals the start of processing a list key in a dialog box.

The handle argument is the name of the dialog box.

The key argument identifies the tile.

The optional value argument describes the list operation to be performed (default = 3):

Value | Symbol | Meaning
1 | LIST_CHANGE | Change contents of the list.
2 | LIST_APPEND | Append new data to the list.
3 | LIST_NEW | Replace the list with a new one (default).

The optional index argument is used only when operation = 1. It indicates the item # to be changed. The first item is #0; the second item is #1, etc.

This function returns RTNORM if successful; otherwise, it returns an error code.

Tell me about...

dlg_add_list

dlg_end_list

Programming Overview of SDS™ (Solutions Development System™)


dlg_term_dialog

int dlg_term_dialog (void);

Terminate all dialog boxes.

This function terminates all dialog boxes. This function is especially useful for closing several nested dialog boxes all at once.

This function only returns RTNORM.

Tell me about...

dlg_unload_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_unload_dialog

int dlg_unload_dialog (int dlgid);

Unload that dialog box.

This function unloads a dialog box identified as dclid. Obtain ddlid from the dlg_new_dialog function).

This function only returns RTNORM.

Tell me about...

dlg_load_dialog

dlg_new_dialog

Programming Overview of SDS™ (Solutions Development System™)


dlg_vector_image

int dlg_vector_image (int x1, int y1, int x2, int y2, int color);

Draw a vector in the dialog box.

This function draws a vector of a specified color in a dialog box.

The vector is drawn from x1,y1 to x2,y2. The origin (0,0) of the dialog box tile is at the upper-left corner.

The color argument is one of the standard 255 colors in IntelliCAD or can take one of these special meanings:

Color | Mnemonic | Meaning
-2 | BGLCOLOR | Current background of the IntelliCAD graphics screen.
-15 | DBGLCOLOR | Current dialog box background color.
-16 | DFGLCOLOR | Current dialog box foreground color of text.
-18 | LINELCOLOR | Current dialog box line color.

This function returns RTNORM if successful; otherwise, it returns an error code.

Tell me about...

dlg_dimensions_tile

Programming Overview of SDS™ (Solutions Development System™)


Programming Overview of SDS™ (Solutions Development System™)

SDS is an acronym for Solutions Development System, a C/C++ language interface compatible with the ADS® (AutoCAD® Development System) interface found in other CAD systems. SDS provides hooks into IntelliCAD, allowing you to create custom applications.

SDS communicates with the user and IntelliCAD via LISP (akin to the way that ADS works with AutoLISP® and other CAD systems). However, SDS greatly augments the capabilities found in LISP with a much more powerful command base that can also access the operating system. This allows you to create even more sophisticated custom solutions. And, because SDS applications are compiled, they are typically faster than LISP applications.

Prefixes to SDS Functions

If you're familiar with ADS, note that one primary difference between ADS and SDS is that most SDS functions have an sds_ prefix (except for special dialog-related SDS functions, which have the dlg_ prefix), whereas ADS functions have a variety of prefixes, such as ads_, acad_, and acrx_.

Functions Unique to SDS

SDS offers several additional capabilities beyond those available in ADS.

SDS Functions

Function | Description
sds_name_clear | Clears the entity name or selection set.
sds_name_equal | Checks if two entity names or selection sets are equal.
sds_name_nil | Checks if the entity name or selection set has been cleared.
sds_name_set | Copies one entity name or selection set to another.
sds_point_set | Copies a point from one variable to another.
sds_progresspercent | Displays the percentage done in a progress bar.
sds_progressstart | Starts the progress bar.
sds_progressstop | Ends the progress bar.
sds_readaliasfile | Loads the PGP file into IntelliCAD.
sds_sendmessage | Sends a message to the IntelliCAD command line.
sds_swapscreen | Flips the off-screen device context to the display.

ADS Functions Not Supported by SDS

The following ADS functions are not supported by SDS: ads_arxload, ads_arxloaded, ads_arxunload, all ads_dict-related functions, ads__msize, ads_namedobjdict, ads_regappx, ads_ssgetx, ads_ssnamex, ads_tablet, ads_xstrcase, ads_xstrsave, ads_ssGetKwordCallbackPtr, ads_ssGetOtherCallbackPtr, adsw_acadMainWnd, and adsw_acadDocWnd.

Selection Modes

IntelliCAD supports the following selection modes:

IntelliCAD selection modes

Mode | Meaning
NULL | (none) Single pick point
"B" | Box
"C" | Crossing
"CC" | Crossing Circle
"CP" | Crossing Polygon
"F" | Fence
"I" | Implied
"L" | Last
"O" | Outside
"OC" | Outside Circle
"OP" | Outside Polygon
"P" | Previous
"PO" | Point
"W" | Window
"WC" | Window Circle
"WP" | Window Polygon
"X" | All

Selection Modes Not Supported by IntelliCAD

IntelliCAD does not support the following selection modes found in other CAD systems: "G", ":$", ":?", ":D", ":E", ":K", ":N", ":S", ".", "#", "A", and "M" nor the Boolean operators <NOT>, <OR>, and <AND>.

SDS Return Codes

SDS functions return these request type codes:

Request | Code | Meaning
RSRSLT | 1 | Result is returned.
RSERR | 3 | Error in evaluation; no result is returned.
RQSAVE | 14 | IntelliCAD is saving the drawing.
RQEND | 15 | IntelliCAD is exiting.
RQQUIT | 16 | IntelliCAD is quitting.
RQCFG | 22 | IntelliCAD is returning from the Config command.
RQXLOAD | 100 | Load external functions.
RQXUNLD | 101 | Unload the application.
RQSUBR | 102 | External subroutine request.
RQHUP | 105 | IntelliCAD is disconnected from the application.
RQXHELP | 118 | Define help for the function.
RTERROR | -5001 | An error has occurred.
RTCAN | -5002 | User canceled the command by pressing Esc.
RTREJ | -5003 | IntelliCAD rejected the request, probably due to invalid format.
RTFAIL | -5004 | Link failure between SDS and IntelliCAD.
RTKWORD | -5005 | Keyword returned from getxxx routine.
RTNORM | 5100 | Request succeeded.

Result buffer codes

Request | Code | Meaning
RTNONE | 5000 | No result.
RTREAL | 5001 | Real number.
RTPOINT | 5002 | 2-D point (x,y-coordinate).
RTSHORT | 5003 | Short integer.
RTANG | 5004 | Angle.
RTSTR | 5005 | String.
RTENAME | 5006 | Entity name.
RTPICKS | 5007 | Pick set.
RTORINT | 5008 | Orientation.
RT3DPOINT | 5009 | 3-D point (x,y,z coordinate).
RTLONG | 5010 | Long integer.
RTVOID | 5014 | Blank symbol.
RTLB | 5016 | Begin list.
RTLE | 5017 | End of list.
RTDOTE | 5018 | Dotted pair.
RTNIL | 5019 | Nil
RTDXF0 | 5020 | DXF code 0 (used only by sds_buildlist).
RTT | 5021 | T (true) atom.
RTRESBUF | 5023 | Result buffer.

Tell me about...

Copying Code Examples from the IntelliCAD Programmer’s Reference


sds_abort

void sds_abort (const char *string);

Close the SDS™ application and notify user.

This function ends an SDS application running under IntelliCAD. Before closing, it prints a message displaying the reason for closing to the command line.

This function has no value to return.

Example

sds_abort("Myapp has experienced a problem, and will be terminated.");

Prints:

Myapp has experienced a problem, and will be terminated.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_alert

sds_exit

sds_fail


sds_alert

int sds_alert (const char *string);

Display an alert or message for the user.

This function displays a dialog box containing the string. This provides information to the user and includes only the OK button. The argument *string is the text to be displayed in the small dialog box. This string may contain new-line characters ("\n") to present the text more clearly.

The function returns RTNORM if successful; otherwise, it returns an errorcode.

Example

char string1[512];

strncpy(string1,"A point is needed.\n\n Please try again.",

sizeof(string1)-1);

sds_alert(string1);

Shows a dialog box with this message:

A point is needed.

Please try again.

Tell me about...

dlg_action_tile

dlg_client_data_tile

dlg_dimensions_tile

dlg_done_dialog

dlg_done_positioned_dialog

dlg_end_image

dlg_end_list

dlg_fill_image

dlg_get_attr

dlg_get_attr_string

dlg_get_tile

dlg_load_dialog

dlg_mode_tile

dlg_new_dialog

dlg_new_positioned_dialog

dlg_set_tile

dlg_slide_image

dlg_start_dialog

dlg_start_image

dlg_start_list

dlg_unload_dialog

Programming Overview of SDS™ (Solutions Development System™)

sds_fail


sds_angle

double sds_angle (const sds_point point1, const sds_point point2);

Determine the angle given by these points.

This function returns the angle between point1 and point2 in the current UCS. The first point determines the line parallel to the x-axis. When point1 is plotted and connected to point2, the resultant angle is returned, in radians.

This function returns the angle, a real number, in radians.

Example

sds_real returnr;

sds_point firstpt,secondpt;

sds_getpoint(NULL,"\nFirst point for angle: ",firstpt);

sds_getpoint(firstpt,"\nSecond point: ",secondpt);

returnr=sds_angle(firstpt,secondpt);

sds_printf("\nThe angle is %f radians",returnr);

Prints:

First point for angle: pick point 1,1

Second point: pick second point 3,3

The angle is 0.7854 radians.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getangle


sds_angtof

double sds_angtof (const char *sangle, int format, double *rangle);

Change this angle to a real number.

This function converts a string, expressing an angle in one of the formats described below, to a real number expressing the angle in radians. The argument *sangle represents the given angle, in the chosen format. The argument format represents the type of string from which sds_angtof will convert the given number.

The following formats are available:

Format | Description | Example
format=0; | Degrees | 360d
format=1; | Deg/Min/Sec | 47d29'15"
format=2; | Grads | 132g
format=3; | Radians | 6.28r
format=4; | Surveyor's Units | N 82d W

The last argument, *rangle, represents the angle, expressed in radians.

This function returns RTNORM or an error code.

Example

int format=0;

sds_real real1;

char string1[512];

sds_getstring(0,"\nEnter an angle in decimal degrees (eg. 47.5): ",string1);

sds_angtof(string1,format,&real1);

sds_printf("\nThat's equal to %f radians. ",real1);

Prints:

Enter an angle in decimal degrees (eg. 47.5): 90

That's equal to 1.5708 radians.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_angle

sds_angtos

sds_getangle

sds_rtos


sds_angtos

int sds_angtos (double rangle, int format, int places, char *sangle);

Convert this absolute angle to a string, relative to angbase.

This function converts the angle rangle in radians to a string, known as *sangle. This is similar to the sds_rtos function, but sds_angtos converts angles (rather than numbers) to strings.

The format argument represents the type of string to which sds_angtos will convert the given number. The following formats are available:

Format Code | Meaning | Example
0 | Degrees | 360d
1 | Deg/Min/Sec | 47d29'15"
2 | Grads | 132g
3 | Radians | 6.28r
4 | Surveyor's Units | N 82d W

The argument places represents the number of decimal places to which the angle in the string is displayed. To default to the current level of precision (as defined by system variable LUPREC), use -1.

The argument *sangle represents the given angle, converted to a string, according to format and number of decimal places.

This function returns RTNORM or an error code.

Example

int format=0;

sds_real real1;

char string1[512];

sds_getreal("\nEnter radians to be converted to degrees: ",&real1);

sds_angtos(real1,format,-1,string1);

sds_printf("\n%f radians equals %s degrees. ",real1,string1);

Prints:

Enter radians to be converted to degrees: 1.570796

1.570796 radians equals 90 degrees.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_angle

sds_angtof

sds_getangle

sds_rtos


sds_buildlist

struct sds_resbuf *sds_buildlist (int rtype, ...);

Create a linked list of these items.

This function creates a linked list of types and values entered as argument pairs. The rtype argument consists of pairs. The first half of the pair describes the "type" of data to follow; the second half of the pair contains the data.

The type is either an RTxxx code (listed below) or a DXF group code:

Type | Meaning
RTNONE | No result.
RTREAL | Real number.
RTPOINT | 2D point (x,y-coordinate).
RTSHORT | Short integer.
RTANG | Angle.
RTSTR | String.
RTENAME | Entity name.
RTPICKS | Pick set.
RTORINT | Orientation.
RT3DPOINT | 3D point (x,y,z coordinate).
RTLONG | Long integer.
RTVOID | Blank symbol.
RTNIL | Nil.
RTDXF0 | DXF code 0.
RTT | The T (true) atom.
RTRESBUF | Result buffer list.

The following types are not paired:

Type | Meaning
RTLB | Begin list.
RTLE | End of list.
RTDOTE | Dotted pair list.
RTNONE | End of list.

When DXF group codes are used, group 0 must be represented by the result type code RTDXF0. Otherwise, sds_buildlist will think the list has been terminated.

There are four exceptions to the paired-data rule: the -3 code, which indicates the start of extended entity data; the rtlb (begin list); rtle (end list); and rtdote (dotted pair list).

Arguments in the sds_buildlist function are paired: ...,TYPE,value,.... Each pair consists of the argument type (such as RTREAL or RTSTR), followed by the value for that item in the list (for example 99.94 or "Einstein"). You may use any number of argument pairs.

The last argument is not a pair and must be 0 (zero) or RTNONE.

When you are done with the list, you must free the list using sds_relrb .

This function returns a pointer to the list; if it is not able to, it returns a NULL pointer. Failure can be due to bad arguments in the list or to a lack of memory.

Example

struct sds_resbuf *listbuf = NULL;

listbuf=sds_buildlist(RTREAL,3.57,RTSHORT,12,RTSTR,"My Cat",RTNONE);

sds_retlist(listbuf);

if(listbuf != NULL)

sds_relrb(listbuf);

Prints:

(3.57 12 "My Cat")

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_retlist


sds_calloc

void* sds_calloc (size_t howmany, size_t size);

Allocate memory for an array.

This function allocates sufficient memory for an array. The array contains howmany elements, each element taking up size bytes of memory.

This function returns a pointer to the first element of the array in memory.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_cmd

int sds_cmd (const struct sds_resbuf *cmdlist);

Execute an IntelliCAD command.

This function executes one or more IntelliCAD commands. It supplies the input for an IntelliCAD command from a linked list, as if it were being entered at the command line.

The portion const struct sds_resbuf *cmdlist represents a linked list that includes all the input required to complete the given command(s).

This function returns one of the following: RTNORM (the function executed normally), RTCAN (the user canceled the command), RTREJ (the command sequence was rejected by IntelliCAD), or RTERROR (some other error).

Example

struct sds_resbuf *listbuf;

sds_point point1 = {2.0, 2.0};

sds_point point2 = {3.0, 3.0};

listbuf=sds_buildlist(RTSTR,"circle",RTPOINT,point1,RTPOINT,point2,RTNONE;

sds_cmd(listbuf); Draws a circle given points as variables.

sds_relrb(listbuf); Releases the result buffer.

listbuf=sds_buildlist(RTSTR,"circle",RTSTR,"5,2",RTSTR,"6,3",RTNONE);

sds_cmd(listbuf); Draws a circle given points as strings.

sds_relrb(listbuf); Releases the result buffer.

Tell me about...

sds_buildlist

sds_command

Programming Overview of SDS™ (Solutions Development System™)


sds_command

int sds_command (int rtype, ...);

Execute this IntelliCAD command.

This function allows you to use any IntelliCAD command in an SDS program. Any following arguments will be used for that command. Each argument has two parts. As in public speaking, you tell the SDS program what you are going to tell it, and then tell it just that.

For example, to use the Line command, you need to tell the SDS program the command name, which is a string (RTSTR), "line". So far we have:

sds_command(RTSTR,"line", ...

That gets us into the Line command. Now we need to provide the information that the Line command requests, which is (at least) two 3-D points (RT3DPOINT). These are written:

...RT3DPOINT,point1,RT3DPOINT,point2...

To end the Line command, enter another string, empty this time. To end the sds_command function enter RTNONE or 0 (zero).

To summarize, a complete line command from sds_command would look like this:

sds_command(RTSTR,"line",RT3DPOINT,point1,RT3DPOINT,point2,RTSTR,"",RTNONE);

For the argument int rtype, any of the result types (RTxxx) are allowed. In each case, they are written as pairs, with the result types followed by the appropriate inputs, or variable names of the matching types, all separated by commas.

This function returns one of the following: RTNORM (the function executed normally), RTCAN (the user canceled the command), RTREJ (the command sequence was rejected by IntelliCAD), or RTERROR (some other error).

Example

sds_point point1,point2;

sds_getpoint(NULL,"\nFirst point for a line: ",point1);

sds_getpoint(point1,"\nSecond point: ",point2);

sds_command(RTSTR,"line",RT3DPOINT,point1,RT3DPOINT,point2,RTSTR,"",RTNONE);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_cmd


sds_cvunit

int sds_cvunit (double oldreal, const char *before, const char *after, double *newreal);

Convert these units to those units.

This function performs a conversion of units. Given a number representing a value in before units (eg.: 3 feet), sds_cvunit converts the number to an equivalent value, expressed in after units (eg.: 36 inches).

The before and after units must be of the same type, such as units of length, or units of time. Sds_cvunit will not, for example, convert furlongs to fortnights.

Commonly used units and conversion factors are stored in the ICAD.UNT file. You may modify this file to include any additional types of units or conversions you need.

The argument oldreal represents the number to be converted, expressed in units defined by the before variable. The argument before represents the units in which the number is originally expressed. after is the units to which the given number will be converted. answer is the converted number, now expressed in units defined by the after variable.

This function returns one of the following: RTNORM or RTERROR

Example

sds_real real1,*answer;

char *before="foot";

char *after="inch";

sds_getreal("\nEnter feet to convert to inches: ",&real1);

sds_cvunit(real1,before,after,&answer);

sds_printf("\n%f feet equals %f inches. ",real1,answer);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_defun

int sds_defun (const char *funname, int funcode);

Define a new LISP function and its code.

This function defines a LISP function by associating its function name, which the user can type at the command line, with its function code and which can be used by sds_getfuncode.

The command to undefine the function is sds_undef, which requires the same arguments.

The argument funname represents the command to be typed at the command line. The argument funcode represents the function code, by which sds_getfuncode can access this function.

This function returns one of the following: RTNORM or an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getfuncode

sds_undef


sds_distance

double sds_distance (const sds_point firstpt, const sds_point secondpt);

Determine the distance between these points.

This function returns the distance between two points: firstpt represents the coordinates of the first point, and secondpt is the second point. The distance function handles 2-D or 3-D.

This function returns the distance, in current drawing units, between the two points, as a real number.

Example

sds_real returnr;

sds_point firstpt,secondpt;

sds_getpoint(NULL,"\nFirst point for distance: ",firstpt);

sds_getpoint(firstpt,"\nSecond point: ",secondpt);

returnr=sds_distance(firstpt,secondpt);

sds_printf("\nThe distance is %f",returnr);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getdist


sds_dictadd

int sds_dictadd(const sds_name nmDict, const char *szAddThis, const sds_name nmNonGraph)

Add a nongraphical object to the specified dictionary.

This function adds an entity to the named object dictionary, where nmDict is the named object dictionary to which the object is being add to, szAddThis is the key name of the object being added to the dictionary and nmNonGraph is a nongraphical object to be added to the dictionary.

The function returns RTNORM if successful; otherwise, it returns RTERROR.

Example

struct sds_resbuf *listbuf = NULL;

struct sds_resbuf *databuf = NULL;

sds_name xname;

sds_name newxname;

sds_name nmdict;

/*Create an entity list*/

listbuf= sds_buildlist(

RTDXF0, "DICTIONARY",

100, "AcDbDictionary",

0);

/*Create entity from entity list*/

if ( sds_entmakex(listbuf,xname) != RTNORM )

sds_printf("\nError on making entity : listbuf.");

/*Get the named object of dictionary */

sds_namedobjdict(nmdict);

/*Add the record to dictionat table*/

sds_dictadd( nmdict, "MY_DICTIONARY", xname);

/*Create another entity list*/

databuf= sds_buildlist(

RTDXF0, "XRECORD",

100, "AcDbXrecord",

1, "My Data",

0);

/*Create entity from entity list*/

if ( sds_entmakex(databuf,newxname) != RTNORM )

sds_printf("\nError on making entity : databuf.");

/*Add the record to dictionat table*/

sds_dictadd( xname, "MY_DICTIONARY", newxname);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictdel

sds_dictnext

sds_dictrename

sds_dictsearch


sds_dictdel

int sds_dictdel(const sds_name nmDict, const char *szDelThis);

Remove an item from a dictionary.

This function removes an entity from the named object dictionary. Here nmDict is the named object dictionary from which the object is being removed, szDelThis is the key name of the object being removed .

This function returns RTNORM if successful; otherwise, it returns RTERROR.

Example

struct sds_resbuf *listbuf = NULL;

sds_name xname;

sds_name nmdict;

/*Create an entity list*/

listbuf= sds_buildlist(

RTDXF0, "DICTIONARY",

100, "AcDbDictionary",

0);

/*Create entity from entity list*/

if ( sds_entmakex(listbuf,xname) != RTNORM )

sds_printf("\nError on making entity : listbuf.");

/*Get the named object of dictionary */

sds_namedobjdict(nmdict);

/*Add the record to dictionat table*/

sds_dictadd( nmdict, "MY_DICTIONARY", xname);

/*Removes the added record*/

sds_dictdel( nmdict, "MY_DICTIONARY" );

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictadd

sds_dictnext

sds_dictrename

sds_dictsearch


sds_dictnext

struct sds_resbuf * sds_dictnext(const sds_name nmDict, int swFirst);

Get the next record of the named objects dictionary.

This function gets the next (or first, depending on value of parameter swFirst) record of named objects dictionary. The argument nmDict is the name of named objects dictionary from which the record is fetched. Whenever the swFirst argument is non-zero, the first record record in dictionary is returned. Used repeatedly, the next record is returned in order.

The function returns the complete dictionary record, if found. When no more records exist in the table, it returns nil.

Example

sds_name ename;

struct sds_resbuf *nextDictRecord = NULL;

/*Get the named object of dictionary */

if ( sds_namedobjdict(ename) != RTNORM )

sds_printf("\nError getting the named object dictionary.");

/*Gets the next record of the Named Objects Dictionary table */

nextDictRecord = sds_dictnext(ename,0);

/* return the record */

sds_retlist(nextDictRecord);

/*free the memory */

if(nextDictRecord != NULL)

sds_relrb(nextDictRecord);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictadd

sds_dictdel

sds_dictrename

sds_dictsearch


sds_dictrename

int sds_dictrename(const sds_name nmDict, const char *szOldName, const char *szNewName);

Rename the existing dictionary table entry.

This function allows you to rename the existing dictionary table entry. This function replaces the szOldName with szNewName for nmDict dictionary object.

The function returns RTNORM if successful; otherwise, it returns RTERROR

IntelliCAD allows you to name the dictionary entry as you choose. It's up to you to avoid renaming dictionary records that shouldn't be renamed.

Example

sds_name ename;

/*Get the named object of dictionary */

sds_namedobjdict(ename);

/*Renames the existing dictionary table entry*/

sds_dictrename(ename, "MY_DICTIONARY", "MY_NEW_DICTIONARY");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictadd

sds_dictdel

sds_dictnext

sds_dictsearch


sds_dictsearch

struct sds_resbuf *sds_dictsearch(const sds_name nmDict, const char *szFindThis, int swFirst);

Search the named objects dictionary.

This function searches the named objects dictionary table for the specified szFindThis. If the swFirst argument is non-zero, the found record is set such that sds_dictnext() returns it.

The return value is the entry for the specified item, if successful, or nil, if no entry is found.

Example

sds_name nmdict;

struct sds_resbuf *dictRecord = NULL;

/*Get the named object of dictionary */

sds_namedobjdict(nmdict);

/* Searches the named objects dictionary table for "ACAD_GROUP"*/

dictRecord = sds_dictsearch(nmdict,"ACAD_GROUP",0);

/* return the data *.

sds_retlist(dictrecord);

/* free the memory *.

sds_retlist(dictrecord);

if(dictrecord != NULL)

sds_relrb(dictrecord);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictadd

sds_dictdel

sds_dictnext

sds_dictrename


sds_distof

int sds_distof (const char *string, int format, sds_real *real);

Convert this value to a real number.

This function converts a given distance (or other quantity), expressed as a string in one of the formats listed below, to a real number expressing the distance in units defined by the LUNITS system variable.

The argument string represents the original number, expressed in one of the formats listed below.

format specifies one of the following formats:

Format | Meaning | Example
1 | Scientific | 6.35e1
2 | Decimal | 63.5
3 | Engineering | 5'3.5"
4 | Architectural | 5'3-1/2"
5 | Fractional | 23-3/4"

The argument real represents the number expressed in units defined by LUNITS.

This function returns RTNORM or an error code.

Example

int format;

sds_real real1;

char string1[512];

format=1;

sds_getstring(1,"\nEnter a number using scientific notation: ",string1);

sds_distof(string1,format,&real1);

sds_printf("\n%s is equal to %f. ",string1,real1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_rtos


sds_draggen

int sds_draggen (const sds_name ss, const char *prompt, int cursor, int (*myfunction)(sds_point point, sds_matrix mt), sds_point p);

Allow the user to drag the selection set.

This function prompts the user to drag the selection set. The ss argument is the name of the selection set, which you obtain from the function sds_ssget or sds_ssadd. The prompt is optional; if it is not used, pass a null pointer.

The cursor argument specifies the type of cursor to display:

Cursor | Meaning
0 | Display the default crosshair cursor.
1 | Display no cursor.
2 | Display the object-selection (box) cursor.

The *myfunction argument is a pointer to a function. This function is called as the mouse changes position. The arguments for myfunction are the current position of the mouse in UCS coordinates, point, and a 4 x 4 transformation matrix, mt. Myfunction() can change the matrix, which sds_draggen() then uses to update the dragging display of the selection set ss.

This function returns RTNORM (when it succeeds), RTERROR (when it fails), or RTCAN (when the user cancels the function or when myfunction returns RTERROR).

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_entdel

int sds_entdel (const sds_name entity);

Delete (or undelete) this object.

This function deletes an object from a drawing, or, if the entity specified is already deleted, sds_entdel undeletes it. The object can be toggled between the two states (deleted and undeleted) at any point during the session. When the drawing is closed, any deleted objects are permanently erased.

The argument entity represents the object to be deleted (or undeleted).

This function returns RTNORM or an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_entget

struct sds_resbuf *sds_entget (const sds_name entity);

Get information about this object.

Given the name of an object, this function returns a result buffer with information about the object, such as layer, linetype, color, defining points, and so on. Note that the color, linetype, thickness, attributes follow flag, and entity handle are returned only when their value differs from the default value. The result buffer gives the group code as the restype and the value as the resval.

The sds_entget function returns x,y,z coordinates as a single point value in RPOINT and not as separate x, y, and z groups, as with DXF codes.

Before using sds_entget on polyline vertex entities, read the polyline's entity header because width information can be lost when the most-recently processed polyline object is different than the one the vertex belongs to.

The argument entity represents the name of the object whose information you wish to retrieve. If that object is not present in the current drawing, sds_entget returns NULL.

This function returns a linked list of result buffers with the information for one of the following: SDS_RTCAN, SDS_RTERROR, SDS_RTKWORD, SDS_RTNONE, or RTNORM.

Example

sds_name entname1;

sds_point point1;

struct sds_resbuf *entlist;

sds_entsel("\nPick an object: ",entname,point1);

entlist=sds_entget(entname);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entgetx

sds_entmod


sds_entgetx

struct sds_resbuf *sds_entgetx (const sds_name entity, const struct sds_resbuf *applist);

Get information and EED about this object.

This function is very similar to sds_entget, except that the result buffer list returned by sds_entgetx includes the EED (an acronym for extended entity data, also referred to as xdata) for the application specified in applist.

The argument entity represents the name of the object whose information you wish to retrieve. The argument applist represents a linked list of application names, whose extended entity data you want included in the result buffer returned by this function.

This function returns the result buffer list with the object's information and extended entity data, or null if the object is not found.

Example

sds_name entname1;

struct sds_resbuf *applist;

struct sds_resbuf *entlist;

applist=sds_buildlist(RTSTR,"myapp",RTNONE);

entlist=sds_entgetx(entname1,applist);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entget


sds_entlast

int sds_entlast (sds_name entity);

Determine which is the last object in the drawing.

This function retrieves the name of the last non-deleted object in your database. This is useful if you want to use the last object drawn.

The argument entity is set to the name of the object if this function succeeds.

This function returns one of the following: RTNORM or RTERROR. Check system variable ERRNO for the reason code.

Example

sds_name entity1;

char string1[512];

sds_getstring(0,"\nEnter to highlight the last object created: ",string1);

sds_entlast(entity1);

sds_redraw(entity1,3); // Highlights the last object.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entnext


sds_entmake

int sds_entmake (const struct sds_resbuf *entity-list);

Make a new object with these properties.

This function creates an object in the drawing database, given the entity information for a new object. This is the reciprocal function to sds_entget.

The argument entlist represents a pointer to a linked list of sds_resbuf structures containing the object information for a new object. The following objects cannot be created: viewports, xrefs, xdefs, and xdeps.

The first or second buffer in the list must specify the entity type (a valid DXF entity type). When the first buffer does not specify the type, it must specify the entity name in the same format returned by sds_entget.

Text style names, linetype names, shape names, and block names must be already defined in the drawing before your pass the entity list to sds_entmake; the layer names are the exception. The list must not include the name of a handle.

To create a complex object, such as polyline or block, make more than one call to sds_entmake, with one call for each subentity. The complex entity is not added to the drawing until it is complete.

This function returns RTNORM (when it is successful), RTKWORD (when it creates the endblk of a block), or RTREG (when it cannot update the database) and sets system variable ERRNO to the reason code.

Example

sds_point point1 = {1.0,3.0,0.0};

sds_point point2 = {7.0,3.0,0.0};

entlist=sds_buildlist(RTDXF0, "line", // Entity type

8, "0", // Layer name

62, 70, // Color number

10, point1, // Starting point for the line

11, point2, // Ending point for the line

RTNONE); // List always ends with RTNONE or 0

sds_entmake(entlist);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entget


sds_entmakex

int sds_entmakex (const struct sds_resbuf *entity-list, sds_name new-entity);

Make a new object with these properties.

This function is identical to the sds_entmake function. Its original purpose was to provide a function that was similar to sds_entmake, except not assign an owner, which would be useful for creating an object that is not saved with the drawing. However, for compatibility reasons, sds_entmakex does assign an owner and is saved to the drawing because the corresponding ADS function does so as well.

This function returns RTNORM if it succeeds. It returns RTREJ if it cannot update the database.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entmake


sds_entmod

int sds_entmod (const struct sds_resbuf *entity-list);

Modify an object in this drawing.

This function modifies the information for an object already existing in the drawing database. You may have made changes to the object list that you retrieved using sds_entget, so the function sds_entmod writes the changed list permanently into the database.

This function updates the display of the modified object, unless it is a sub-entity (such as part of a block or polyline). For a sub-entity, use the sds_entupd function or Regen command to force a redisplay the object on the screen.

The argument entity-list represents a linked list of result buffers in the same form as that returned by sds_entget. Note that sds_entmod cannot change the object's type or handle.

Text style names, linetype names, shape names, and block names must be already defined in the drawing before your pass the entity list to sds_entmod; layer names are the exception. The list must not include the name of a handle.

This function returns RTNORM or RTREJ, with the reason code in system variable ERRNO.

NOTES

  • To restore the default color or linetype to an object, set the color to 256 and the linetype to BYLAYER.
  • The following objects cannot be modified: viewports, xrefs, xdefs, and xdeps.
  • The following symbol table entries cannot be modified and/or renamed:

Table Name | Entry
LAYER | All, except extended entity data.
LINESTYLE | CONTINUOUS
VPORT | *ACTIVE

These can be modified but not renamed:

Table Name | Entry
APPID | None.
BLOCKS | *MODEL_SPACE and *PAPER_SPACE
DIMSTYLE | STANDARD
LAYER | 0
STYLE | STANDARD

Example

struct sds_resbuf *templist;

sds_entlast(entname); //Get the name of the last object drawn.

entlist=sds_entget(entname); //Get the resbuf for that object.

//Go through the object's resbuf...

for (templist=entlist;templist->rbnext!=NULL;templist=templist->rbnext)

{

if (templist->restype==62) //When it gets to the color

templist->resval.rint=240; //group, change it to 240.

}

sds_entmod(entlist); //Put the (modified) resbuf back

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entmake


sds_entnext

int sds_entnext (const sds_name entity1, sds_name entity2);

Determine the next object after this object.

This function returns the name of the first non-deleted object in the database when no arguments are supplied. If an object name is supplied, sds_entnext returns the next object following the given entity1. When there is no next object in the database, sds_entnext returns RTERROR.

The argument entity1 is a known object name. This can be NULL, in which case sds_entnext gives the name of the first object in the drawing. The argument entity2 represents the name of the next object in the drawing, or the first object if entity1 is NULL.

This function returns RTNORM, if it succeeds, or RTERROR if entity1 is invalid or the last (non-deleted) entity in the drawing.

Example

sds_name entity1,entity2;

char string1[512];

sds_entsel("\nPick an object: ",entity1,point1);

sds_getstring(0,"\nPress Enter to highlight the next object: ",string1);

sds_entnext(entity1,entity2); Finds the name of the next object.

sds_redraw(entity2,3); Highlights the next object.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entlast


sds_entsel

int sds_entsel (const char *prompt, sds_name entity, sds_point point);

Select the object right here. . . *click*.

This function displays a prompt, then pauses for the user to select an object. The function returns the object selected and the point on the object where the user selected it.

The argument *prompt represents the text to prompt the user to select an object. When NULL, the program uses the default prompt, "Select Entity." The argument entity represents the name of the selected object. The argument point represents the point by which the object was selected.

This function returns RTCAN (when the user has canceled the request), RTERROR (when this function has failed), RTKWORD (when a call to sds_initget was made previously), or RTNORM, when this function succeeds.

NOTES

  • This function ignores the current object snap setting.
  • If the user selects a complex object, such as a block or polyline, this function returns the nearest block (or polyline) header. If you want the nearest attribute or polyline vertex, use function sds_nentselp instead.

Example

sds_name entity1;

sds_point point1;

sds_entsel("\nPick an object: ",entity1,point1);

sds_redraw(NULL,4); Un-highlights everything.

sds_redraw(entity1,3); Highlights selection.

sds_printf("\nSelection point: (%f, %f, %f.) ",point1[0],point1[1],point1[2]);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_nentselp


sds_entupd

int sds_entupd (const sds_name entity);

Update the image of that object.

This function updates the image of an object and is useful particularly for complex objects, such as blocks and polylines. In some cases, you may need to use the Regen command to fully update the image. The argument entity represents the object to be updated.

This function returns RTNORM or RTERROR.

Example

sds_name entname;

sds_entupd(entname);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_redraw


sds_exit

void sds_exit (int status);

Notify IntelliCAD that the SDS™ application is exiting now, then exit.

This function tells IntelliCAD that the SDS application is about to exit and then exits. If the application exits without telling IntelliCAD, the memory and resources it uses are not freed.

The status argument represents the way in which the application terminated. Use 0 (zero) for a planned and intentional termination. Other values can be used for unusual reasons for exiting the application, depending on your system.

This function returns void.

Example

sds_printf("\nOURBASE is shutting down now.");

sds_exit(0);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_abort

sds_alert

sds_fail


sds_fail

void sds_fail (const char *string);

Display an error message.

This function prints an error message, along with the name of the SDS application and the given string at the command line. This function is meant for use with recoverable errors.

The argument string represents the text to print to the command line, following the name of the SDS application.

This function returns void.

Example

char string1[512];

strncpy(string1," was not able to find that point./n",sizeof(string1)-1);

sds_fail(string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_abort

sds_alert

sds_exit


sds_findfile

sds_findfile (const char *lookfor, char *pathfound);

Locate this file.

This function searches for the given file and gives the full path for that file (the foundpath argument).

The argument lookfor represents the name of the file to search for. The string must include the file's extension (if any).

The search criteria can be limited to a particular drive or directory tree by prefixing the filename with a drive or subdirectory name, such as "c:\intellicad\drawing.dwg".

The argument foundpath represents the complete path name for the specified file.

This function returns RTNORM or RTERROR.

Example

char lookfor[512],foundpath[512];

sds_getstring(0,"\nEnter the name of a file to find: ",lookfor);

sds_findfile(lookfor,foundpath);

sds_printf("\nThe path for that file is %s: ",foundpath);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getfiled


sds_free

void sds_free (void *memloc);

Deallocate the memory allocated by xAlloc.

This function deallocates memory allocated by the sds_calloc, sds_malloc, and/or sds_realloc functions. The argument memloc is the memory region previously allocated.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getangle

int sds_getangle (const sds_point firstpt, const char *prompt, double *answer);

Ask the user to specify an angle.

This function pauses to get an angle from the user. You can prompt the user to specify an angle numerically, or by picking points.

The argument firstpt represents the first point of the angle. It may be null. When null, the user enters the angle itself, using the current units for angles.

If given a starting point (firstpt), the user picks another point to define a rubber-band line, and sds_getangle determines the counter-clockwise angle between the current zero direction (as set in ANGBASE) and the rubber-band line.

The prompt argument represents a command-line prompt requesting that the user specify or pick an angle. This argument may be null.

The answer argument represents the angle specified by the user, counter-clockwise from the zero direction, expressed in radians (regardless of the current units for angles).

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

NOTE This functions read ANGBASE to find the 0-angle direction. If you prefer the 0-angle fixed in the east or 3 o'clock direction, use the sds_getorient function.

Example

sds_real *answer;

sds_point firstpt;

sds_getpoint(NULL,"\nFirst point: ",firstpt);

sds_getangle(point1,"\nSecond point: ",&answer);

sds_printf("\nThe angle is %f radians.",answer);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_angle

sds_getorient


sds_getappname

char *sds_getappname (void);

Determine the name of the current SDS application.

This function returns the name of the current SDS application. This name is needed so that you can unload the application from memory.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getargs

struct sds_resbuf *sds_getargs (void);

Return the arguments to the current SDS application.

This function returns the arguments to the specified external function and returns a pointer to a linked list of arguments. When there are no arguments, this function returns a null pointer. There is no need to call sds_relrb since this function automatically releases the list.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getcfg

int sds_getcfg (const char *symbol, char *var, int length);

Determine the value of the parameter.

This function returns data from the [AddData] section of the Icad.Cfg file, if it exists.

The symbol argument is a string with the following format:

"AppData/appname/sname/parameter"

where:

Cfg Name | Meaning
AppData | The [AppData] section.
appname | The name of the application.
sname | The section name.
parameter | The parameter name.

The var argument is a pointer to a location in memory that holds the retrieved parameter data. This memory location is pre-allocated and must be big enough to hold all of the data.

The length parameter is the length of the retrieved data.

This function returns RTNORM or RTERROR when the string is truncated due to length being too small.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getcname

int sds_getcname (const char *other-lang, char **English-name);

Determine the English version of that command.

This function returns either: (1) the localized; or (2) English name of an IntelliCAD command, depending on the argument you employ. The argument other-lang is the name of the command. The second argument, English-name, is a pointer to the string result.

This function returns RTNORM or RTERROR.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getcorner

int sds_getcorner (const sds_point point1, const char *prompt, sds_point point2);

Ask the user to specify the second corner.

This function pauses to get a second corner-point for a rectangle from the user. You may prompt the user to specify the corner-point, either numerically, or by picking a point.

The argument point1 represents the first corner of a rectangle. The rectangle is defined between this point and the next point the user specifies. The points are treated as 2-D x,y coordinates.

The prompt argument is a command-line prompt requesting that the user specify a second point for a rectangle. This argument may be null.

The argument point2 represents the second corner of the rectangle, a point specified by the user.

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

Example

sds_point point1,point2;

sds_getpoint(NULL,"\nFirst corner: ",point1);

sds_getcorner(point1,"\nSecond corner: ",point2);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getdist

int sds_getdist (const sds_point point, const char *prompt, double *answer);

Ask the user to specify a distance.

This function pauses to get a second point from the user to determine a distance. You may prompt the user to specify the second point, either numerically or by picking a point.

The argument point represents the first point, from which the distance is measured.

The prompt argument represents a command-line prompt requesting that the user specify a second point for determining a distance. This argument may be null.

The argument answer is the distance between the two points.

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

Example

sds_point point1;

sds_real real1;

sds_getpoint(NULL,"\nFirst point: ",point1);

sds_getdist(point1,"\nSecond point: ",&real1);

sds_printf("\nThe distance between the points is %f. ",real1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_distance


sds_getfiled

int sds_getfiled (const char *title, const char *path, const char *fileext, int options, struct sds_resbuf *filename);

Bring up the file dialog box.

This function displays the standard Windows file dialog box so that the user can save, open, or find a file, as appropriate. However, this function includes arguments that allow you to somewhat customize the dialog box's wording.

The argument title represents the label of the dialog box. This is the text that appears across the top, such as "Open Drawing."

The path argument represents the default pathname and filename, if applicable. This is where the dialog box first looks for the file. This can be NULL. If so, the default is the current working directory.

The fileext argument is the default file extension. This can be overridden by the user only if bit 2 ( = 4) is set in options.

The argument options represents the sum of the appropriate bits for each of the following options:

Option | Meaning
1 | Warns when the user types an existing filename; use this option to create a new file, not open an existing one.
2 | Grays out the "Type it" button.
4 | Allows the user to type a filename other than that specified by fileext.
8 | Only the filename is stored in the result buffer, filename. When not set, the entire pathname is stored in filename. When option 1 is set (for creating a new file), this has no effect.
16 | Path is assumed to be a pathname only. This is also true when path ends with a slash.

The argument filename is a result buffer containing either a string with the path and file name for the selected file or, if the user selected the Type It button, a short with a resval of 1.

This function returns RTNORM or RTERROR.

NOTE While normally you would release the resbuf using sds_relrb, you do not want to when using this function because it will cause your program to crash.

Example

struct sds_resbuf filename;

sds_getfiled("sds_getfiled Test Dialog",NULL,"DWG",4,&filename);

if (filename.restype==RTSTR)

sds_printf("\nThe name of the file is %s. ",filename.resval.rstring);

else if (filename.restype==RTINT)

sds_printf("\nThe user selected the \"Type it\" button. ");

else

sds_printf("\nAn error occurred.");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getfuncode

int sds_getfuncode (void);

Determine the code number of that application.

This function returns the function code number for an SDS command typed at the command line. IntelliCAD associates a function code with the external function name during the call made by sds_defun . The function sds_getfuncode does not accept any arguments.

When successful, it returns the function code; otherwise, it returns RTERROR.

Tell me about...

sds_defun

sds_undef

Programming Overview of SDS™ (Solutions Development System™)


sds_getinput

int sds_getinput (char *string);

Retrieve the input the user just typed or specified.

This function retrieves information entered by the user in response to the previous function. This function must immediately follow a user-input function. In addition, the previous function must return RTKWORD or RTSTR; otherwise, it will fail.

The argument string is a string of a maximum of 511 characters, containing whatever the user entered. The last (512) character in the string is always Ø (ASCII 0 or null).

This function returns RTERROR or RTNORM.

Example

int int1;

char string1[512];

sds_initget(128,""); // Allows arbitrary input

sds_getint("\nEnter an integer: ",&int1); // User may enter 123abc

sds_getinput(string1); // String1 would be: 123abcØ

sds_printf("\nYou entered %s ",string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getint

int sds_getint (const char *prompt, int *answer);

Ask the user to specify an integer.

This function pauses to get an integer from the user. You may prompt the user to enter the integer.

The argument prompt represents a command-line prompt requesting that the user enter an integer.This argument may be null.

The answer argument is the integer entered by the user. The valid range is a short integer between -32768 and 32767.

This function returns RTCAN (when the user presses Esc), RTERROR (when it fails), or RTNORM (when it succeeds). If the prior function was sds_initget, this function may return RTKWORD or RTNONE.

Example

int int1;

sds_getint("\nPlease enter an integer: ",&int1);

sds_printf("\nThe integer you entered is %i. ",int1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getreal


sds_getkword

int sds_getkword (const char *prompt, char *answer);

Ask the user to specify a keyword.

The function pauses to get a keyword from the user. The prompt to the user shows the list of acceptable keywords. The user may type the whole word, or an abbreviation.

Keywords are defined using sds_initget prior to sds_getkword. Do not use command names as keywords.

The prompt argument is a command-line prompt requesting that the user enter a keyword. The prompt can include a list of keywords so the user is not required to know them from memory. This argument may be null.

The argument answer is the keyword entered by the user. It is a string of a maximum of 512 characters, the last of which is always Ø (ASCII 0). Even if the user enters an abbreviation, the entire keyword, with its original capitalization, is stored in the answer argument.

This function returns RTCAN (when the user presses Esc), RTERROR (when it fails), or RTNORM (when it succeeds). If the prior function was sds_initget, this function may return RTNONE.

NOTE sds_getkword itself does not ever return RTKWORD.

Example

char string1;

sds_initget(0,"Cat Dog Horse Bird");

sds_getkword("\nChoose a pet: Cat/Dog/Horse/Bird ",string1);

sds_printf("\nYou chose a %s. ",string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_getorient

int sds_getorient (const sds_point point, const char *prompt, double *answer);

Ask the user to specify an orientation.

This function pauses to get an angle from the user. You may prompt the user to specify an angle, either numerically, or by picking points.

This function measures the angle relative to a horizontal line extending to the right. The current value of the ANGBASE system variable has no effect on sds_getorient.

The argument point is the starting point, which may be null. If null, the user enters the angle itself, using the current units for angles. If given a starting point (point), the user picks another point to define a rubber-band line, and sds_getorient determines the counter-clockwise angle between a horizontal line and the rubber-band line.

The argument prompt represents a command-line prompt requesting that the user specify or pick an angle. This argument may be null.

The answer argument represents the angle specified by the user, counter-clockwise from the zero direction, expressed in radians (regardless of the current units for angles).

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

Example

sds_real *real1;

sds_point point1;

sds_getpoint(NULL,"\nFirst point: ",point1);

sds_getorient(point1,"\nSecond point: ",&real1);

sds_printf("\nThe angle is %f radians. ",real1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getangle


sds_getpoint

int sds_getpoint (const sds_point point, const char *prompt, sds_point answer);

Ask the user to specify a point.

This function pauses to get a point from the user. You may prompt the user to enter a point, either numerically, or by picking one.

The argument point represents an existing point for reference. If this point is used, IntelliCAD draws a rubber-band line from the point to the cursor while the user is picking the requested point. This argument may be null.

The argument prompt represents a command-line prompt requesting that the user enter a point. This argument may be null.

The argument answer is the point entered by the user.

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

Example

sds_point point1;

sds_getpoint(NULL,"\nPlease pick or specify a point: ",point1);

sds_printf("\nThe point is (%f,%f,%f). ",point1[0],point1[1],point1[2]);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getangle


sds_getreal

int sds_getreal (const char *prompt, double *answer);

Ask the user to specify a real number.

This function pauses to get a real number from the user. You may prompt the user to enter the number.

The argument prompt is a command-line prompt requesting that the user enter a real number.

The argument answer is a pointer to the real number entered by the user.

This function returns one of the following: RTCAN, RTERROR, RTKWORD, RTNONE, or RTNORM.

Example

sds_real real1;

sds_getreal("\nEnter a real number: ",&real1);

sds_printf("\nYou entered %f. ",real1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getint


sds_getstring

int sds_getstring (int flag, const char *prompt, char *answer);

Ask the user to specify a string.

This function pauses to get a character string from the user. You may prompt the user to enter the information.

The argument flag represents an integer, either 0 or 1, which signals whether spaces are allowed in the string. When 0, a space is treated as a carriage return. If 1, the user can type spaces and must press Enter to signal the end of the string.

The argument prompt is a command-line prompt requesting that the user enter information. This argument may be null.

The answer argument is the information entered by the user. This can be a string of a maximum of 512 characters, the lastsds_getint(IDR_374) of which is always Ø (ASCII 0).

This function returns RTCAN, RTERROR, or RTNORM.

Example

char string1[512];

sds_getstring(1,"\nType a brief line of text: ",string1);

sds_printf("\nYou entered: %s ",string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getint


sds_getsym

int sds_getsym (const char *symname, struct sds_resbuf **valueout);

Get the value of a symbol from LISP.

This function retrieves the value of a LISP symbol.

The argument const char symname represents the name of the LISP symbol whose value you want to retrieve.

The valueout argument is a pointer to the result buffer into which the type and value from the LISP symbol symname are stored.

This function returns RTERROR or RTNORM.

Example

struct sds_resbuf *valueout;

sds_getsym("LISPsym",&valueout);

switch(valueout->restype){

case RTREAL:

sds_printf("\nLISPsym's value is %f. ",valueout->resval.rreal);

break;

etc.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_putsym


sds_getvar

int sds_getvar (const char *sysvar, struct sds_resbuf *info);

Determine the value of this system variable.

This function stores the type and current value for the variable in the result buffer info, given the name of a system variable sysvar.

The argument sysvar is the name of the system variable whose value you are retrieving.

The argument info points to a result buffer structure that represents the current value stored in the above variable. The info argument must point to an allocated result buffer. It cannot be declared as only a pointer since the data returned from a system variable ranges from a single-digit integer (such as 0) to a 132-character string.

This function returns RTERROR or RTNORM.

Example

char sysvar[512];

struct sds_resbuf rb1;

sds_getstring(0,"\nEnter a variable name: ",sysvar);

sds_getvar(sysvar,&rb1);

switch(rb1.restype){

. . .

case RTREAL:

sds_printf("\n%s is currently set at %f. ",sysvar,rb1.resval.rreal);

break;

. . .

}

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_setvar


sds_graphscr

int sds_graphscr (void);

Switch to the drawing window.

This function switches to the graphics window from the Prompt History window, which is the equivalent of pressing the F2 function key.

This function returns RTNORM or an error code.

Example

char string1[512];

sds_getstring(0,"\nTo switch to the graphics screen, press Enter ",string1);

sds_graphscr();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_textpage

sds_textscr


sds_grclear

int sds_grclear (void);

Clear the drawing window.

This function clears the drawing window.

This function returns RTNORM unless a critical error occurs.

Example

char string1[512];

sds_getstring(0,"\nTo clear the graphics window, press Enter. ",string1);

sds_grclear();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_grdraw


sds_grdraw

int sds_grdraw (const sds_point point1, const sds_point point2, int color, int mode);

Draw a vector, this way.

This function draws a vector in the graphics window, from point1 to point2. The vector can be displayed in any of the standard colors and can be highlighted or displayed normally.

The arguments point1 and point2 represent the first and second points for the vector.

The argument color is the color number for the vector. This can be any of the standard color numbers, from 0 to 255. When color is set to -1, the vector is drawn in XOR ink.

NOTE When one XOR-colored vector overdraws another vector, it is drawn in a complimentary color. When an XOR-color vector overdraws itself, it becomes invisible.

The mode argument determines whether the vector is displayed as highlighted or normal. To display normally, mode equals zero. Any other value highlights the vector.

This function returns RTNORM except when a critical error occurs.

NOTE If you need to draw multiple vectors, use the sds_grvecs function.

Example

int color,highlight;

sds_point firstpt,secondpt;

sds_getpoint(NULL,"\nFirst point for vector. ",firstpt);

sds_getpoint(NULL,"\nSecond point for vector. ",secondpt);

sds_getint("\nEnter a color number (0-255): ",&color);

sds_getint("\nEnter 1 for highlighted, 0 for normal display. ,&highlight);

sds_grdraw(firstpt,secondpt,color,highlight);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_grvecs


sds_grread

int sds_grread (int bits, int *answertype, struct sds_resbuf *answer);

Read data from any input device.

This function directly reads the data generated by input devices. A note of caution applies when using this function: the data can become an overwhelming amount.

The argument bits specifies the following:

Track | Meaning
1 | Returns the coordinates dynamically in the form of a list. The list consists of the value and the 3-D coordinate.
2 | Returns keystrokes but does not move the cursor. Returns all key values, including cursor and function key codes.
4 | Turn this on if you are going to choose a cursor type.
8 | Turns off the error message "console break" when you cancel out of the loop.

Add the bits above to obtain a combination if desired.

The cursor argument is an integer that corresponds to a cursor type:

Cursor | Meaning
0 | Normal cursor-crosshairs.
1 | No cursor.
2 | Selection cursor - box.

The following table describes how the information is returned. For example, if you entered the letter, l (keyboard input), the value 2 and the character code would be returned (2 108) in a list.

Type of Input | Returned Value | Definition
Keyboard | 2 | Character code.
Selected Point | 3 | 3-dimensional point.
Pulldown menu | 4 | 1,001 to 1,999 POP1 menu 2,001 to 2,999 POP2 menu 16,001 to 16,999 POP16 menu
Mouse (other pointer) | 5 | 3-dimensional point.

The argument answer the actual input, including type and value, is stored in this result buffer.

This function returns RTNORM or RTCAN.

Example

int type;

sds_resbuf readinput;

sds_grread(2,&type,&readinput); // Using 2 returns the value of any key pressed.

switch(type){

case 2: sds_printf("\nYou used the keyboard."); break;

case 3: sds_printf("\nYou selected a point."); break;

etc.

break;

}

switch(readinput.restype){

case RTREAL: sds_printf("\nIts value is %f. ",readinput.resval.rreal)

break;

case RTPOINT: sds_printf("\nThe 2D point is %f,%f.",

readinput.resval.rpoint[X],readinput.resval.rpoint[Y]);

break;

etc.

}

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_grtext

int sds_grtext (int where, const char *message, int highlight);

Display text on the status line.

This function controls how and where messages are written in the drawing window.

The argument where controls where the message is displayed:

Where | Meaning
-1 | Message appears on the status line.
-2 | Message appears in the coordinate display.
-3 | Status line is restored to its original state.

The argument message represents the text you wish to display in the location specified by where.

The argument highlight is ignored. It is provided for the sake of compatibility with earlier CAD programs.

This function returns RTNORM or RTERROR.

Example

int where = -1;

char *message = "Display this message";

int highlight = 1;

sds_grtext(where,message,highlight);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_grvecs

int sds_grvecs (const struct sds_resbuf *vlist, sds_matrix mat);

Draw vectors on the screen.

This function draws one or more vectors on the screen, unlike the sds_grdraw, which draws a single vector. Vectors can be displayed in any of the standard colors and can be highlighted or displayed normally.

The argument vlist represents a list of result buffers that specify the vectors. The vectors are clipped as required. The vlist consists of point pairs and a color. RTPOINT specifies a pair of 2D x,y-coordinates; or RT3DPOINT specifies a pair of 3D x,y,z-coordinates.

RTSHORT specifies the color of the vector:

Color | Meaning
-1 | Vector is highlighted.
0 -255 | Standard colors.
256 | Vector is drawn in XOR ink.

NOTE When vectors are drawn in XOR ink and one XOR-colored vector overdraws another vector, it is drawn in a complimentary color. When an XOR-color vector overdraws itself, it becomes invisible.

The argument mat is a 4 x 4 matrix that transforms the vectors before they are displayed.

This function returns RTERROR or RTNONE.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_grdraw


sds_handent

int sds_handent (const char *enthandle, sds_name entname);

Determine the entity name of this object.

This function returns the entity name, given a pointer to the handle for a specific object.

The argument enthandle represents the handle for the object whose name you wish to retrieve.

The argument entname is the name of the object with the given handle.

This function returns RTNORM or RTERROR and sets an error code

Example

struct sds_resbuf *entlist;

struct sds_resbuf *templist;

sds_name entname1, entname2;

char string1[512];

sds_point pt;

sds_entsel ("Pick an entity: ", entname1, pt);

entlist=sds_entget(entname1); // Get the resbuf for that object.

// Go through the object's resbuf...

for (templist=entlist;templist->rbnext!=NULL;templist=templist->rbnext)

{

if (templist->restype==5){// Restype=5 is the handle

sds_handent(templist->resval.rstring,entname2);

sds_getstring(0,"Press Enter to highlight the object. ",string1);

sds_redraw(entname2,3);

}

}

sds_relrb(entlist);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_help

int sds_help (char *helpfile, char *id, int flag);

Display the Help window.

This function displays a help file. The three arguments are passed to the Windows Help engine.

The argument helpfile specifies name of the HLP file.

The id argument specifies the topic ID string, which brings up a specific topic, such as a command name. When missing, IntelliCAD displays the first topic of the Help file.

The flag argument displays one of the following:

Flag | Meaning
help_contents | Display the initial topic in the HLP file.
help_helponhelp | Display help on using help.
help_partialkey | Display the Search dialog box using topic as the search text.

This function returns RTNORM or RTERROR when the Help file cannot be found.

NOTE This function should be attached to the dialog box's Help button in your DCL file. For more information on creating a dialog box with a Help button, see these topics in the DCL Programming Reference: ok_cancel_help, ok_cancel_help_errtile, ok_cancel_help_info .

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_init

int sds_init (int argc, char *argv[ ... ]);

Initialize the SDS™ app.

The is the first function called in any SDS application.

The arguments argc and argv are the same arguments passed to the main() function of the SDS application.

This function returns either any value. When the SDS application does not work, this function returns control to the command line.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_initget

int sds_initget (int accept, const char *keys);

Accept only input fitting these criteria.

This function defines what input is acceptable for the command immediately following sds_initget. When keywords are allowed, use sds_getinput after this function to get the keyword that the user entered.

The argument accept determines the type of input that will be accepted from the user with the next function. It is the sum of the bit values selected from the list below:

Accept |  | Meaning
1 | RSG_NONULL | Does not accept a carriage return from the user.
2 | RSG_NOZERO | Accepts only non-zero input from the user.
4 | RSG_NONEG | Accepts only non-negative numbers, including zero.
8 | RSG_NOLIM | Accepts input outside of the limits of the drawing. This has precedence over the LIMCHECK system variable.
16 | ... | Not used.
32 | RSG_DASH | Uses dashed lines for selection tools (boxes and rubberband lines).
64 | RSG_2D | Accepts, but does not use, the z-value for points in the sds_getdist function.
128 | RSG_OTHER | Accepts anything the user enters, and returns SDS_RTKWORD.

For example, if you want to limit the user's input to only positive numbers (non-negative and non-zero), and draw a rubber-band line with dashes, you add 4 + 2 + 32 to get a value of 38 for the accept variable.

A more verbose-but often clearer way-of using accept is to write an expression using the RSG_XXX words for each of the bits you wish to set. The same example as above written in this way is:

(RSG_NONEG + RSG_NONULL + RSG_DASH)

Once the bit code is set, you use string to determine the values that the user is limited to entering in response to the prompt displayed by the following function. This string is a list of keywords to be accepted by the next command. In essence, initget lets you define keywords. If keywords are not to be used, argument keys should be null or an empty string (""). The function always returns nil.

When defining your list of keywords, separate each keyword with a space. Show allowable abbreviations by capitalizing the required letter(s). When the entire word is in capital letters, the user is required to enter the entire word. Keywords may contain letters, numbers, and dashes. Here is an example of a list of keywords:

"One Two Three Four"

Given this, the user can type "three" or just "th" for three.

An alternative method of listing keywords is to write each word in all-capital letters, followed by a comma and the abbreviation for the word, as in the following example:

"ONE,O TWO,T THREE,TH FOUR,F"

This is usually used with (human) languages that do not use upper- and lower-case letters.

"~A B C _F _G ~_H"

The ~ prefix causes the keyword that follows to not be displayed in the popup menu. Use ~~ if you need to have ~ appear as a keyword.

The first underscore prefix indicates that the remaining keywords are globalized forms of the preceding keywords. The first keyword ("A" in this example) will match the first globalized keyword ("F" in this example), the second keyword will match the next globalized keyword ("B" will match "G" in the example), and so on. The user can enter either the localized or globalized keyword; the globalized keyword will be returned in either case. Only the first globalized keyword is required to have the underscore prefix.

NOTE The following combinations of functions, keywords, and accept bits are allowed:

Function | Keywords | 1 | 2 | 4 | 8 | 32 | 64 | 128
sds_draggen | Yes | Yes |  |  |  |  |  | Yes
sds_entsel | Yes |  |  |  |  |  |  |
sds_getangle | Yes | Yes | Yes |  |  | Yes |  | Yes
sds_getcorner | Yes | Yes |  |  | Yes | Yes |  | Yes
sds_getdist | Yes | Yes | Yes | Yes |  | Yes | Yes | Yes
sds_getint | Yes | Yes | Yes | Yes |  |  |  | Yes
sds_getkword | Yes | Yes |  |  |  |  |  | Yes
sds_getorient | Yes | Yes | Yes |  |  | Yes |  | Yes
sds_getpoint | Yes | Yes |  |  | Yes | Yes |  | Yes
sds_getreal | Yes | Yes | Yes | Yes |  |  |  | Yes
sds_getstring |  |  |  |  |  |  |  |
sds_nentsel | Yes |  |  |  |  |  |  |
sds_nentselp | Yes |  |  |  |  |  |  |

This function returns RTNORM, RTKWORD, or RTERROR.

Example

char string1[512];

sds_initget(0,"Cat Dog Horse Bird");

sds_getkword("\nChoose one: Cat/Dog/Horse/Bird ",string1);

sds_printf("\nYour favorite animal is a %s. ",string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_draggen

sds_entsel

sds_getinput

sds_nentsel

sds_nentselp


sds_inters

int sds_inters (const sds_point point1, const sds_point point2, const sds_point point3, const sds_point point4, int mode, sds_point interspt);

Find where these lines intersect.

This function finds the intersection point of two lines.

The arguments point1 and point2 represent the starting and ending points for the first line segment, while point3 and point4 are the starting and ending points for the second line segment.

The mode argument controls whether the line segments must actually cross:

Mode | Meaning
0 | The lines do not need to cross.
1 | The lines must cross.

When mode is 1 and the line segments do not intersect, sds_inters returns RTERROR.

The interspt argument is the point at which the two lines intersect.

This function returns RTERROR or RTNORM.

Example

int cross;

cross = 1;

sds_point firstpt,secondpt,thirdpt,fourthpt,interspt;

sds_getpoint(NULL,"\nFirst point for line 1: ",firstpt);

sds_getpoint(firstpt,"\nSecond point: ",secondpt);

sds_getpoint(NULL,"\nFirst point for line 2: ",thirdpt);

sds_getpoint(thirdpt,"\nSecond point: ",fourthpt);

returni=sds_inters(firstpt,secondpt,thirdpt,fourthpt,cross,intpt);

if (returni != 5100)

sds_printf("\nThese two line segments do not intersect");

if (returni == 5100)

sds_printf("\nIntersection: (%f,%f,%f)", intpt[0],intpt[1],intpt[2]);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_invoke

int sds_invoke (const struct sds_resbuf *args, struct sds_resbuf **answer);

Call a function in another SDS™ application.

This function calls a function defined in another SDS application.

The args argument is a result buffer list that contains the external function call.

The answer argument contains the external function's return values.

This function returns RTERROR or RTNORM.

NOTE Make sure that external functions are registered by sds_regfunc .

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_isalnum

int sds_isalnum (int val);

Determine whether this character is alphanumeric.

This function determines whether a given character is alphanumeric (A - Z and a - z and 0 - 9). The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a character: ",string1);

returni=sds_isalnum(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT alphanumeric. ");

else

sds_printf("\nThe character IS alphanumeric. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_isalpha

int sds_isalpha (int val);

Determine whether this character is alphabetical.

This function determines whether a given character is alphabetical (A - Z and a - z). The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a alphabetical character: ",string1);

returni=sds_isalpha(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT alphabetical. ");

else

sds_printf("\nThe character IS alphabetical. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_iscntrl

int sds_iscntrl (int val);

Determine whether this is a control character.

The function determines whether a given character is a control character. The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a control character: ",string1);

returni=sds_iscntrl(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT a control character. ");

else

sds_printf("\nThe character IS a control character. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_isdigit

int sds_isdigit (int val);

Determine whether this character is a digit.

This function determines whether a given character is a decimal digit (0-9). The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a digit (0-9) (or not): ",string1);

returni=sds_isdigit(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT a digit (0-9). ");

else

sds_printf("\nThe character IS a digit (0-9). ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_isxdigit


sds_isgraph

int sds_isgraph (int val);

Determine whether this a graphical character.

This function determines whether a given character is a graphical character. The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a graphical character-try (c) (ALT-0169): ",string1);

returni=sds_isgraph(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT graphical. ");

else

sds_printf("\nThe character IS graphical. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_islower

int sds_islower (int val);

Determine whether this a lower-case character.

This command determines whether a given character is lower-case (a-z). The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a lowercase character: ",string1);

returni=sds_islower(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT lowercase. ");

else

sds_printf("\nThe character IS lowercase. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_isupper

sds_tolower

sds_toupper


sds_isprint

int sds_isprint (int val);

Determine whether this character is printable.

This function determines whether a given character is a printable character (a non-control character). The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a printable character: ",string1);

returni=sds_isprint(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT printable. ");

else

sds_printf("\nThe character IS printable. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ispunct

int sds_ispunct (int val);

Determine whether this character is a punctuation mark.

This function determines whether a given character is a punctuation mark. The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a punctuation mark: ",string1);

returni=sds_ispunct(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT a punctuation mark. ");

else

sds_printf("\nThe character IS a punctuation mark. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_isspace

int sds_isspace (int val);

Determine whether this character is a blank space.

This function determines whether a given character is a blank, or white-space, character, such as a space, tab, new-line character, formfeed, or carriage return. The argument val is the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nHit Space, Tab, or Enter: ",string1);

returni=sds_isspace(string1[0]);

if (returni == 0)

sds_printf("\nYou typed something that is NOT blank space. ");

else

sds_printf("\nYou entered some blank space. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_isupper

int sds_isupper (int val);

Determine whether this is an upper-case character.

This function determines whether a given character is upper-case (A-Z). The argument val represents the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter an uppercase character: ",string1);

returni=sds_isupper(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT uppercase. ");

else

sds_printf("\nThe character IS uppercase. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_islower

sds_tolower

sds_toupper


sds_isxdigit

int sds_isxdigit (int val);

Determine whether this character is a hex digit.

This function determines whether a given character is a hexadecimal digit (0-9, and A-F). The argument val represents the ASCII value for a character.

This function returns non-zero if the given character is alphabetical. Otherwise, it returns zero.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a hex digit (0-9 or A-F): ",string1);

returni=sds_isxdigit(string1[0]);

if (returni == 0)

sds_printf("\nThe character is NOT a hex digit. ");

else

sds_printf("\nThe character IS a hex digit. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_link

int sds_link (int lispmsg);

Signal LISP that the SDS app is ready.

This function lets LISP know that the SDS application is ready for a request. If there has been a problem, sds_link prints "Error: SDS error in evaluation" to the command line.

The argument lispmsg is a message to LISP, which consists of either RSRSLT (the application is ready for the next request) or RSERR (there was a problem with the SDS application).

This function returns a LISP request code.

Example

Refer to the manual section on the structure of SDS applications.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_loaded

struct sds_resbuf *sds_loaded (void);

Determine which SDS™ applications are loaded.

This function tells you which SDS applications are loaded by returning a linked list of all the currently loaded application names. When no applications are loaded, this function returns NULL.

Example

struct sds_resbuf *loadlist;

struct sds_resbuf *templist;

char string1[512];

int howmany = 0;

loadlist=sds_loaded;

for (templist=loadlist;templist->rbnext!=NULL;templist=templist->rbnext){

if (templist->restype!=RTSTR) // It *should* be a string, but if not...

sds_getstring(0,"\nWrong type. Press Enter.",string1);

else {

sds_printf("\nThe application %s is loaded.",templist->resval.rstring);

howmany++;

}

}

sds_printf("\nThere are %i applications loaded at this time.",howmany);

sds_relrb(loadlist);

loadlist=NULL;

templist=NULL;

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_xload

sds_xunload


sds_malloc

void *sds_malloc (size_t bytes);

Allocate memory.

This function allocates memory equal in size the amount returned by the memory functions.

The argument bytes is the amount of memory to allocate.

This function returns a pointer to the memory region. When the memory cannot be allocated, this function returns NULL.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_menucmd

int sds_menucmd (const char *string);

Execute this menu command.

This function executes a command in the menu bar (cursor menu and pull-down menus). The string parameter uses the following formats:

"menu=value"

"menu=*"

The menu parameter has two parts, such as (menucmd "P1.2=*). In this case, the "P1" refers to the first pull-down menu (usually the File menu). the ".2" refers to the first item on the menu (usually the Open item). The first values of menucmd permitted in IntelliCAD are:

Menu | Meaning
P0 | Cursor menu
P1-P16 | Pull-down menus 1-16

The value parameter has the following meanings:

Value | Meaning
? | What is status of the menu item?
* | Display the menu.
~ | Disable the menu item (grayed out).
!. | Prefix menu item with a checkmark.
 | (blank) Remove properties.
name | Load the menu name.

This function returns RTNORM (when the function is successful), RTKWORD (when value = ?), or an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_name_clear

int sds_name_clear (sds_name name);

Clear an entity name or selection set.

This function clears an entity name or a selection set.

The argument name is the name of the entity or selection set.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_name_equal

int sds_name_equal (sds_name name1; sds_name name2);

Determine whether these two entity names or selection sets are equal.

This function checks whether two entity names or two selection sets are the same.

The argument name1 is the name of one entity or selection set, while name2 is the name of the other entity or selection set.

Value | Returns
0 | False
non-zero | True

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_name_nil

int sds_name_nil (sds_name name);

Determine whether the entity name or selection set been cleared.

This function checks whether an entity name or a selection set has been cleared by the sds_name_clear function.

The argument name is the name of the entity or selection set being checked.

Value | Returns
0 | False
non-zero | True

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_name_set

int sds_name_set (sds_name name1, sds_name name2);

Copy n entity name or selection set to another.

This function copies an entity name (or a selection set name) to another name.

The argument name1 is the name of originating entity or selection set, while name2 is the target name to which to copy.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_namedobjdict

int sds_namedobjdict(sds_name nmDict);

Get the named object dictionary.

This function gets the named object dictionary in the argument nmDict.

The function returns RTNORM if successful; otherwise, it returns RTERROR.

Example

sds_name nmdict;

/*Get the named object of dictionary */

sds_namedobjdict(nmdict);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_dictadd

sds_dictnext

sds_dictremove

sds_dictrename

sds_dictsearch


sds_nentsel

int sds_nentsel (const char *prompt, sds_name entityname, sds_point point, sds_point ecs2wcs[4], struct sds_resbuf **nestblks);

Get information about this nested object.

NOTE Do not use this function in new programs. It is provided for backward compatibility with third-party applications written for earlier CAD programs. For new programs, use sds_nentselp.

This function works exactly like sds_nentselp except that instead of a 4 x 4 transformation matrix, sds_nentsel creates a 4 x 3 matrix stored as an array of four points.

Example

char *prompt;

sds_name entname;

sds_point entpoint;

sds_point ecs2wcs[4];

struct sds_resbuf *nestblks;

sds_nentsel("Pick your favorite object: ",entname, entpoint,

ecs2wcs, &nestblks);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entsel

sds_nentselp


sds_nentselp

int sds_nentselp (const char *prompt, sds_name entity-name, sds_point point, int userpick, sds_matrix ecs2wcs, struct sds_resbuf **nestblks);

Get information about this nested object.

This function works very much like sds_entsel but has features especially suited to dealing with objects nested within other objects, such as polyline vertices and block components.

Just as in sds_entsel, entity-name is the object selected, and point is the point used to select it. Also, here you have the option of prompting the user with prompt or using a predefined point with userpick, and a way to specify the prompt's wording.

There are two additional outputs with information specific to nested objects:

  • A transformation matrix for converting from the entity's Coordinate System to the World Coordinate System;
  • A linked list of objects in which the selected object is nested.

The prompt argument is the string that prompts the user for input. This argument may be null. If userpick is 1, this is not needed and is ignored. If userpick is 0, and this prompt is NULL, IntelliCAD displays the default pick prompt..

The argument entity-name is the name of the object selected.

The argument point variable serves two purposes:

Userpick | Meaning
1 | point is used as the selection point.
0 | sds_nentselp sets point to the point used to select the object.

The userpick argument is a toggle indicating whether to prompt the user to pick an object, or to accept the current value of entpoint as the pickpoint. If userpick is set to 0, the user is asked to pick an object. If userpick is 1, point is taken as the selection point.

The argument ecs2wcs is a transformation matrix for converting point from the Entity Coordinate System to the World Coordinate System in the case that the object is nested inside a block or blocks. If not, this is an identity matrix. In sds_nentselp this is a 4x4 transformation matrix, whereas in sds_nentsel it is a 4x3 matrix.

NOTE The 4x4 matrix of sds_nentselp is preferred. The other function, sds_nentsel, is available because some programs written for other CAD systems rely on it; however, you should not use it in a new program.

The nestblks argument is a linked list of nested blocks, in which the chosen object is contained. The first block in the list is the one that directly contains the object; the next contains the first, and so on.

This function returns RTNORM, RTCAN, RTERROR, or RTKWORD.

Example

char *prompt;

sds_name entname;

sds_point entpoint;

int userpick;

sds_matrix ecs2wcs;

struct sds_resbuf *nestblks;

sds_nentselp("Pick your favorite object: ",entname, entpoint, userpick,

ecs2wcs, nestblks);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_entsel

sds_nentsel


sds_newrb

struct sds_resbuf *sds_newrb (int result);

Create a new result buffer.

This function creates a new result buffer.

The argument result can be any of the result types (e.g. RTREAL) or any of the DXF group codes present in object definitions.

Example

struct sds_resbuf *newbuffer;

newbuffer=sds_newrb(RTREAL);

newbuffer->resval.rreal=121.50;

sds_printf("\nThe Real in the new buffer is %f.",newbuffer->resval.rreal);

sds_relrb(newbuffer);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_osnap

int sds_osnap (const sds_point point, const char *mode, sds_point answer);

Find a point based on this snap mode and point.

This function uses the specified object snap mode(s) to determine the resulting point, given a 3-D point.

The argument point is a 3-D point, which is the center of a square area defined by the system variable APERTURE. Sds_osnap looks for the object selected by this point.

The mode argument is the snap mode or modes used to find the resulting point :

Mode | Meaning
"nea" | NEArest
"end" | ENDpoint
"mid" | MIDpoint
"cen" | CENter
"per" | PERpendicular
"tan" | TANgent
"qua" | QUAdrant
"ins" | INSertion
"po" | POint
"int" | INTersection (3D intersection)
"pla" | PLAnview (2D intersection)
"vis" | VISible (apparent intersection)
"off" | Off

NOTE Separate multiple object snap modes with a comma, such as: "tan, qua, cen".

The argument answer is the 3-D point determined by the original point and the snap mode, such as the end of a line.

This function returns RTNORM (when it finds a point); otherwise, it returns an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_point_set

void sds_point_set (sds_point point1, sds_point point2);

Copy a point from one variable to another.

This function copies a point from one variable to another. This sds_point_set function is unique to the implementation of SDS™ included with IntelliCAD.

The argument point1 is contains the 3-D source point.

The argument point2 is the destination for the 3-D point.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_polar

void sds_polar (const sds_point point, double angle, double dist, sds_point result);

Find a point, using polar coordinates.

This function gives the point resulting from a given center point, angle, and distance.

The argument point is the center point for the polar coordinate system.

The angle argument is the angle, counter-clockwise from a line extending horizontally to the right, along which the point will be located.

The dist argument is the distance along the line, from the center point to the resulting point.

The result argument is the point on the line.

This function does not return a value.

Example

sds_real angle,dist;

sds_point point1,returnp;

sds_getpoint(NULL,"\nPick the center pt for the polar function: ",point1);

sds_getangle(NULL,"\nEnter an angle: ",&angle);

sds_getdist(NULL,"\nEnter a distance: ",&dist);

sds_polar(point1,angle,dist,returnp);

sds_printf("\nThe point is (%f,%f,%f)",returnp[0],returnp[1],returnp[2]);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_printf

int sds_printf (const char *format, ...);

Print this at the command line.

This function prints a given string to the command line. Although this function looks identical to the C-language printf function, the SDS version prints to the command line and Prompt History window.

The argument format is the text to be printed to the screen. The maximum string length is 132 characters. You should enclose the text in double-quotes. The argument can include escape sequences (such as \n or \t) and references to variables (such as %f or %s), which are listed, in order, immediately after the string.

This function returns RTNORM or an error code.

Example

char food[512];

sds_getstring(1,"\nWhat is your favorite food? ",food);

sds_printf("\nYou must really like %s.",food);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_progresspercent

int sds_progresspercent (int pcdone);

Display the % of progress.

This function displays a percentage-completed gas gauge. The sds_progresspercent function is unique to the implementation of SDS™ included with IntelliCAD.

The argument pcdone is an integer that indicates the percentage completed. The value of this argument is between 0 and 100 and should reflect a percentage.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_progressstart

sds_progressstop


sds_progressstart

int sds_progressstart (void);

Start the progress dialog box.

This function displays a percentage-completed gas gauge. The sds_progressstart function is unique to the implementation of SDS™ included with IntelliCAD.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_progresspercent

sds_progressstop


sds_progressstop

int sds_progressstop (void);

Dismiss the progress dialog box.

This function dismisses the percentage-completed gas gauge. The sds_progressstop function is unique to the implementation of SDS™ included with IntelliCAD.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_progresspercent

sds_progressstart


sds_prompt

int sds_prompt (const char *prompt);

Prompt the user.

This function displays a prompt on the command line. The prompt argument is a string.

This function returns SDS_RTNORM or an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_putsym

int sds_putsym (const char *symbol, struct sds_resbuf *value);

Set this LISP symbol to that value.

This function finds or creates a LISP symbol and stores a value.

The argument symbol is the name of the LISP symbol in which you want to store a given value. When this symbol already exists, the value is simply stored there. If not, it is created, then the value is stored in it.

The argument value is the result buffer from which the value is obtained.

This function returns RTNORM or RTERROR with an error code.

Example

struct sds_resbuf valuein;

valuein.restype=RTREAL;

valuein.resval.rreal=121.50;

sds_putsym("LISPsym",&valuein); // Put value in symbol "LISPsym

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_getsym


sds_readaliasfile

int sds_readaliasfile (char *filename);

Read a PGP file.

This function loads a *.PGP file into the aliases for IntelliCAD.

The argument filename is the name of the PGP file (the file in which the AutoCAD® command aliases have been defined).

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_realloc

void *sds_realloc (void *memloc, size_t bytes);

Change the size of a memory allocation.

This function changes the size of memory that has been previously allocated. The contents of the memory region are preserved if the size is increased; some contents may be lost when the memory size is decreased.

The argument memloc is a pointer to the memory region.

The bytes argument is the new size of the memory allocation.

This function returns a pointer to the memory region. If the function fails, it returns null.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_redraw

int sds_redraw (const sds_name entity-name, int mode);

Redraw that, like this.

This function redraws the specified object(s) or the entire viewport.

The argument entity-name defines what is to be redrawn. When this argument is NULL, the entire viewport is redrawn.

The argument mode describes how the specified objects are to be redrawn, but is only useful if entity-name is not NULL.

Mode | Descriptions
1 or -1 | Redraw the specified object(s).
2 or -2 | Disappear the specified object(s).
3 or -3 | Highlight the specified object(s).
4 or -4 | Redraw highlighted object(s) in normal (non-highlighted) mode.

When you are working with complex objects, such as polylines, use the positive value to update all the parts of the object; use the negative value to update only the first part.

The modes for this function have to be used in pairs, so that every time you use one mode, you have to follow that up later with the opposite mode. For example, if you use mode 2, you must later use mode 1. Likewise, if you use mode 3, you must later use mode 4.

This function returns RTNORM or an error code.

Example

sds_name entity1;

sds_point point1;

sds_entsel("\nPick another object: ",entity1,point1);

sds_redraw(NULL,4); \\ Un-highlights everything.

sds_redraw(entity1,3); \\ Highlights selected object.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_grclear


sds_regapp

int sds_regapp (const char *appname);

Register extended entity data.

This function adds the application name to the drawing's list of registered applications. You can register as many applications as you like in each drawing.

The appname argument is the name of the application to be registered. This argument is limited to 32 characters.

This function returns RTNORM or an error code if the application is already registered

Example

sds_regapp("mybase");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_regfunc


sds_regfunc

int sds_regfunc (int (*function) (void), int funcode);

Register an external function.

You can register any function that is in your SDS application but outside of main. This allows you to call it directly, without going through the dispatch loop. To be used in this way, the function must not require any arguments (be of type "(void)" ), and must return an int.

The argument int (*function) (void) is the name of the function just as in the code, and not necessarily the same as the name you specified when you defined the function using sds_defun.

The argument funcode is the code number you specified for the function in sds_defun.

This function returns RTNORM or RTERROR.

Example

sds_defun("C:MYCOMMAND" ,6);

sds_regfunc(MYCMDFUNC ,6);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_regapp


sds_relrb

int sds_relrb (struct sds_resbuf *buffer);

Release this result buffer.

This function releases a result buffer structure, as well as all following result buffers that appear in a linked list. Use this function each time you are done with a result buffer.

The argument buffer is the result buffer to be freed.

This function returns RTNORM or an error code.

Example

struct sds_resbuf *entlist = NULL;

. . .

if (entlist != NULL) // If there's anything in the entlist...

sds_relrb(entlist); // Release it.

entlist = NULL; // Make it a NULL pointer - a good idea.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retint

int sds_retint (int integer);

Return this integer to LISP.

This function returns an integer value to LISP. The argument integer is an integer. This function returns RTNORM.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retlist

int sds_retlist (const struct sds_resbuf *list);

Return this list to LISP.

This function returns a list to LISP.

The argument list is a pointer to the first structure in a linked list that is to be returned to LISP as a list. The list can be of any length but must contain only these result codes: RT3DPOINT, RTANG, RTDOTE., RTENAME, RTLB, RTLE, RTNIL, RTORINT, RTPICKS, RTPOINT, RTREAL, RTSHORT, RTSTR, and RTT.

This function returns RTNORM (when it is successful) or returns RTERROR (when there is an error is list argument).

Example

struct sds_resbuf *listbuf;

listbuf=sds_buildlist(RTREAL,3.57,RTSHORT,12,RTSTR,"Test String",RTNONE);

sds_printf("\nsds_retlist returns: ");

sds_retlist(listbuf);

sds_relrb(listbuf); //Release memory

// LISP receives: (3.57 12 "Test String")

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_buildlist


sds_retname

int sds_retname (const sds_name name, int flag);

Return this set or object to LISP.

This function returns the name of a selection set or object to LISP.

The argument name is the name of the object or selection set.

The argument flag can be:

Flag | Meaning
SDS_RTENAME | name is the name of an object.
SDS_RTPICKS | name is the name of a selection set.

This function returns RTNORM (if it is successful) or RTERROR (when it fails or name is null).

Example

sds_name itsname;

int itstype;

sds_entlast(itsname);

sds_printf("\nsds_retname(itsname,itstype) returns: ");

sds_retname(itsname,itstype);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retnil

int sds_retnil (void);

Return nil to LISP.

This command returns nil to LISP.

NOTE Although the raison d'etre of this function at first seems unclear, it does have a purpose. The sds_retnil function can signal an error, an empty list, or the success of an external void function.

Example

sds_retnil;

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retpoint

int sds_retpoint (const sds_point point);

Return this 3D point to LISP.

This function returns a point to LISP.

The argument point represents the 3-D point to be returned to LISP. It must be an array of three double-precision real numbers.

This function returns just RTNORM.

Example

sds_point point1;

point1[0]=10.0;

point1[1]=5.75;

point1[2]=0.0;

sds_retpoint(point1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retreal

int sds_retreal (double real);

Return this real number to LISP.

This function returns a real value to LISP.

The argument real is the real value to be returned to LISP. It must be a double-precision real number.

This function returns just RTNORM.

Example

sds_retreal(12.3456789);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retstr

int sds_retstr (const char *string);

Return this string to LISP.

This function returns a string to LISP.

The argument string is the string to be returned to LISP. It must be no longer than 503 characters; the 504th character is the end-of-string character.

This function returns RTNORM, or RTERROR if the string is a NULL pointer or if sds_retstr fails.

Example

sds_retstr("A string");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_rett

int sds_rett (void);

Return True to LISP.

This function returns the T (short for true) symbol to LISP.

This function returns just RTNORM.

Example

sds_rett();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retval

int sds_retval (const struct sds_resbuf *value);

Return this value to LISP.

This function returns the value contained in the result buffer to LISP.

The argument value is a result buffer containing any of the usual types, which may be returned to the calling LISP function.

This function returns RTNORM or RTERROR.

Example

struct sds_resbuf *argbuf;

sds_getsym("argument",&argbuf);

if(argbuf==NULL) return(RTERROR);

sds_printf("\nThe type is %i.",argbuf->restype);

switch(argbuf->restype){

case RTREAL:

sds_printf("\nThe value is %f. ",argbuf->resval.rreal);

break;

// And so on through the other cases.

}

sds_retval(argbuf);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_retvoid

int sds_retvoid (void);

Return void to LISP.

This function returns nothing to LISP. Since LISP only returns the last value sent to it, you can use sds_retvoid to cause LISP to return nothing. Use this as the last function to keep from printing what would have otherwise been the last function.

This function returns just RTNORM.

Example

sds_retvoid();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_rtos

*int sds_rtos (double real, int format, int places, char *string);

Change this real number to a string.

This function converts a given real number to a string, formatted in one of five ways.

The argument real is the real number to be converted.

The argument format is the type of string to which sds_rtos will convert the given real number:

Format | Meaning | Example
1 | Scientific units | 635e-1
2 | Decimal units | 63.500
3 | Engineering units | 5'3.5"
4 | Architectural units | 5'3-1/2"
5 | Fractional units | 63-1/2"

The argument places represents the number of decimal places to which the number in the string is displayed. To use the default (as specified by the LUPREC system variable), use -1.

The argument string is the given number, converted to a string, according to the specified format and number of decimal places.

This function returns RTNORM or an error code.

Example

int format=1;

sds_real real1;

char string1[512];

sds_getreal("\nEnter any real number: ",&real1);

sds_rtos(real1,format,-1,string1);

sds_printf("\nThat's %s in scientific notation.",string1);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_sendmessage

int sds_sendmessage (const *string);

Send a message.

This function sends a message to the IntelliCAD command line. The sds_sendmessage function is unique to IntelliCAD's implementation of SDS™.

The argument *string is the message you want to send to the command line.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_setcallbackfunc

int sds_setcallbackfunc (int [int flag, void *arg1, void *arg2, void *arg3]);

IntelliCAD... call me at this function.

This function intercepts callbacks from IntelliCAD commands and sends them to a specified function. For example, IntelliCAD sends a callback that it is going to erase an entity before doing so. This callback could be sent to the function specified by sds_setcallbackfunc..

The sds_setcallbackfunc function is unique to the implementation of SDS™ for IntelliCAD.

Example

Suppose you need to know whenever the ERASE command is used in IntelliCAD so that application-specific data can be stripped from entities before they are erased. You create a function named cbfunc to monitor callbacks from IntelliCAD so you can trap all uses of the ERASE command.

First, you would issue the following when your SDS application is loaded:

sds_setcallbackfunc(cbfunc);

From then on, all callbacks from IntelliCAD will pass through cbfunc. When the ERASE command is used in IntelliCAD, cbfunc will detect it, as in the following section of code:

int cbfunc(int flag,void *arg1,void *arg2,void *arg3)

{

int res = RTNORM;

switch (flag) {

// Command Start/End.

case SDS_CBCMDBEGIN:

// arg1="command name" cast as (char *)

// Callback return RTERROR will cause command to not be called.

// Any processing needed for the erase command goes here.

// For example, if you wanted to disable the erase command to

// prevent users from erasing entities, you could use the

// following code:

if (!stricmp(arg1, "erase"))

res = RTERROR;

break;

case default:

break;

}

return res;

}

As the comment above indicates, the callback return of RTERROR will cause the command not to be issued. This is because IntelliCAD broadcasted the fact that it is about to run the ERASE command. The program intercepted ERASE so a different action could be taken. If you wanted to know when the ERASE command had been completed, you could add a case for SDS_CBCMDBEGIN and compare the argument sent by IntellCAD to see if it is what you are looking for.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_setfunhelp

int sds_setfunhelp (char *function, char *helpfile, char *topic, int flag);

Register help for SDS™ commands.

This function registers help topics for SDS™ commands that are used in IntelliCAD. This function works with any SDS and LISP command prefixed by C: (to turn it into a command).

The argument function is the name of the SDS or LISP function.

The argument helpfile is the name of the HLP file containing the help text.

The argument topic is the name of a topic within the help file, such as a command name. When this argument is missing, IntelliCAD displays the first topic of the help file.

The argument flag displays one of the following:

Flag | Meaning
help_contents | Display the initial topic in the HLP file.
help_helponhelp | Display help on using help.
help_partialkey | Display the Search dialog box using topic as the search text.

This function returns RTNORM or RTERROR.

NOTES

  • Use the sds_help function to call Help from a dialog box Help button.
  • For more information about creating a dialog box with a Help button, see these topics in the DCL Programming Reference: ok_cancel_help , ok_cancel_help_errtile , ok_cancel_help_info .

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_setvar

int sds_setvar (const char *sysvar, const struct sds_resbuf *result);

Set this variable to this value.

This function sets an IntelliCAD system variable to a new value.

The argument sysvar represents the system variable whose value is to be set.

The result argument is the new value for the above variable.

This function returns RTNORM or RTERROR.

Example

char sysvar[512];

struct sds_resbuf rb1;

sds_getstring(0,"\nEnter a variable name: ",sysvar);

sds_getvar(sysvar,&rb1);

switch(rb1.restype){

. . .

case RTREAL:

sds_printf("\n %s is currently %f. ",sysvar,rb1.resval.rreal);

sds_getreal("\nEnter a new real number: ",&rb1.resval.rreal);

sds_setvar(sysvar,&rb1);

sds_printf("\n%s is now set at %f. ",sysvar,rb1.resval.rreal);

break;

. . .

}

Tell me about...

Programming Overview of LISP (LISt Processing) Language

sds_getvar


sds_setview

int sds_setview (const struct sds_resbuf *views, int vport);

Set a 3-D viewpoint.

This function changes the 3-D viewpoint of a specified viewport.

The views argument is pointer to a list of result buffers. It does not look like the simple x,y,z coordinates, such as '(1.0 2.0 3.0), that you might expect from the Viewpoint command. Instead, views requires the view descriptor table as returned by the sds_tblsearch function.

One way to create the viewpoint data is with the View Save command.

The vport argument is specifies the viewport number. When you have a single viewport, its value is 2. To use the current viewport, set vport to 0. To get the number of the current viewport, use the Cvport system variable.

This function returns RTNORM or RTERROR.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_snvalid

int sds_snvalid (const char *tblname, int pipe);

Determine whether the symbol table has valid characters.

This function determines whether the symbol table contains valid characters.

The tblname argument is the name of a table, including "LAYER", "LTYPE", "VIEW", "STYLE", "BLOCK", "UCS", "VPORT", "DIMSTYLE", and "APPID."

The pipe argument toggles whether the vertical bar ( | or "pipe") character is valid:

Flag | Meaning
0 | Vertical bar is not permitted.
1 | Vertical bar is permitted.

This function returns RTNORM or an error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ssadd

int sds_ssadd (const sds_name entity-name, const sds_name setname1, sds_name setname2);

Add this object to that selection set.

This function adds an object to the specified selection set and stores the updated set by another name. If an object is given, but no name, the sds_ssadd function creates a new set containing only the given object.

The argument entity-name is the entity name of the object to be included in the set.

The argument setname1 is the existing selection set and can be NULL.

The argument setname2 is the resulting selection set. The object has been added to this set..

This function returns RTNORM or an error code.

Example

sds_name entname1,entname2,setname1,setname2;

sds_point point1;

sds_entsel("\nPick an object: ",entname1,point1);

sds_ssadd(entname1,NULL,setname1);

sds_entsel("\nPick another object to add to the set: ",entname2,point1);

sds_ssadd(entname2,setname1,setname2);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_ssdel


sds_ssdel

int sds_ssdel (const sds_name entity-name, const sds_name setname);

Remove this object from this selection set.

This function removes a given object from a given selection set.

The argument entity-name is the object to be removed from the selection set.

The argument setname is the set from which the object will be removed.

This function returns RTNORM or an error code.

Example

sds_printf("\nNow removing the first object from the set...");

sds_ssdel(entname1,setname1); // Delete the first object.

returni=sds_ssmemb(entname1,setname1); // Is the first object there?

if (returni==RTNORM)

sds_printf("\nAn error has occured...the first object was not deleted. ");

else

sds_printf("\nThe first object was successfully deleted from the set. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_ssadd


sds_ssfree

int sds_ssfree (sds_name setname);

End use of this selection set. Free it.

This function frees the selection set since IntelliCAD is limited to having 128 selection sets total.

The argument setname is the selection set to be freed.

This function returns RTNORM or an error code.

Example

int returni = sds_ssfree(setname1);

if (returni != RTNORM)

sds_printf("\nAn error has occured... the set was not freed. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ssget

int sds_ssget (const char *mode, const void *point1, const void *point2, const struct sds_resbuf *filter, sds_name setname);

Make a new set of objects, based on this.

This function gets a whole new selection set of objects, using the specified selection method and is limited by a filter.

The mode argument specifies the object selection method:

Mode | Meaning | Points
NULL | (none) Single pick point | point1
"C" | Crossing | point1 point2
"CC" | Crossing Circle | point1 point2
"CP" | Crossing Polygon | points-list
"F" | Fence | points-list
"I" | Implied | none
"L" | Last | none
"O" | Outside | points-list
"OC" | Outside Circle | point1 point2
"OP" | Outside Polygon | points-list
"P" | Previous | none
"PO" | POint | point1
"W" | Window | point1 point2
"WC" | Window Circle | point1 point2
"WP" | Window Polygon | points-list
"X" | All | none

NOTES

  • The "I" mode creates an "implied" selection set of objects selected while system variable PICKFIRST is on.
  • The "PO" mode selects all closed objects covering the specified point.
  • The point1 (and many times point2) argument specifies the pick point for the selection mode, as noted in the table above.

The filter argument is a list that specifies object properties in dotted pair format, such as selecting all circles colored red (color 1). In addition, the special dotted-pair of -4 lets you include a relational test, which selects all red circles less than 15 units in radius. The operators recognized by IntelliCAD are:

Operator | Meaning
"=" | Equals.
"!=" | Not equal to.
"/=" | Not equal to.
"<>" | Not equal to.
"<" | Less than.
"<=" | Less than or equal to.
">" | Greater than.
">=" | Greater than or equal to.
"*" | All.

The following are not used with real numbers:

    • "&" Bitwise AND (integers only).
    • "&=" Bitwise masked equals (integers only).
    • The "*" operator is the only that can be used with strings.

The setname argument holds the resulting selection set.

NOTES

  • The current object snap setting is ignored by the sds_ssget function.
  • When the selection set is used in model space, paper space objects are not selected, and vice versa: objects from the drawing space not currently in effect are filtered out.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ssgetfirst

int sds_ssgetfirst (struct sds_resbuf **gripped, struct sds_resbuf **selected);

Determine which objects are highlighted and/or gripped.

This function reports the number of objects in drawing that are highlighted (selected) and gripped. Grips are the small squares that surround an object. The sds_ssgetfirst function returns a list with two elements: the first element a selection set of objects that are gripped but not selected; the second element is a selection set of objects that are gripped and selected.

The gripped argument points to a result buffer containing a selection set of objects that are currently gripped in the drawing. When no objects are gripped, the result is null.

The selected argument points to a result buffer containing a selection set of objects that are currently selected in the drawing. When no objects are selected, the result is null.

This function returns RTNORM or RTREJ.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_sslength

int sds_sslength (const sds_name setname, long *number);

Determine the number of objects in this set.

This function finds the number of objects in a selection set.

The argument setname is the selection set for which you wish to find the number of objects.

The argument number represents the number of objects in the selection set. Note that this is a long, not an int, because there can be more objects in a set than an integer (65,535) can represent.

This function returns RTNORM or an error code.

Example

long setlen;

sds_name setname1;

sds_sslength(setname1,&setlen);

sds_printf("\nThere are %li objects in the set. ",setlen);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ssmemb

int sds_ssmemb (const sds_name entity-name, const sds_name setname);

Determine whether this object is in this set.

This function determines whether an object is a member of the selection set.

The argument entity-name represents the object in question.

The setname argument represents the selection set.

This function returns RTNORM or RTERROR. Check system variable ERRNO for the error code.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_ssname

int sds_ssname (const sds_name setname, long index, sds_name entity-name);

Get the nth object from this set.

This function gets the name of an object, given the selection set name and the index for the item.

The argument setname is the selection set from which you want to get the object.

The argument index represents the object from the set. The first item is #0, the second item is #1. Use the sds_sslength function to first determine the number of items in the selection set, and then subtract 1 to get the highest index number. Since there may be more than 65,535 items in the selection set, this argument is a long integer.

The entity-name argument represents the name of the object at the position index in the set.

This function returns RTNORM or an error code.

Example

int returni;

long setlen,index;

char string1[512];

sds_name entnameX,setname1;

while (index < setlen){

returni=sds_ssname(setname1,index,entnameX);

if (returni != RTNORM)

sds_getstring(0,"\nNot able to find the object. ",string1);

else{

sds_redraw(entnameX,3); // Highlights the object.

index++;

}

}

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_sssetfirst

int sds_sssetfirst (const sds_name grips, const sds_name select);

Highlight and/or grip these objects.

This function causes objects in a drawing to be gripped and/or highlighted (selected). Grips are the small selection squares that surround an object.

The grips argument is a selection set of objects to be gripped in the drawing.

The select argument is a selection set of objects to be selected in the drawing

This function returns RTNORM or RTREJ.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_swapscreen

int sds_swapscreen (void);

Display the other window.

This function displays the other window. IntelliCAD has two windows: the drawing window and the Prompt History window. When one is covered by the other, this function displays the hidden window.

The sds_swapscreen function is unique to IntelliCAD.

The function has no arguments.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_tblnext

struct sds_resbuf *sds_tblnext (const char *tablename, int flag);

Get me the next item in the table.

This function finds the first (or next, depending on the flag) instance of a symbol type in the drawing table.

The argument tablename represents the name of symbol type to search for. Valid tablenames are:

Table Name | Meaning
"appid" | Application identification.
"block" | Block names.
"dimstyle | "Dimension style names.
"layer" | Layer names.
"ltype" | Linetype names.
"style" | Text style names.
"view" | View names.
"ucs" | UCS names.
"vport" | Viewport names.

The sds_tblnext function first returns the first specified symbol in the table. When the symbol is found, it is returned as a list of dotted pairs. Used repeatedly, the next symbol is returned in order. When no more symbols exist in the list, nil is returned.

When the flag argument is supplied (typically 1), the search begins from the top (beginning) of the table.

This function sets a value in system variable ERRNO describing the error.

Example

char *tablename[]={"APPID", "BLOCK", "DIMSTYLE", "STYLE", "LAYER",

"LTYPE", "UCS", "VIEW", "VPORT"};

char lookfor[512];

int types;

struct sds_resbuf *nextbuf = NULL;

for (types=0; types<sizeof(tablename)/sizeof(tablename[0]); types++) {

for (nextbuf=sds_tblnext(tablename[types],1); nextbuf!=NULL;

nextbuf=sds_tblnext(tablename[types],0)) {

ob_listdxf(nextbuf);

sds_relrb(nextbuf); // release the buffer

}

sds_printf("\nTested %s.",tablename[types]);

}

nextbuf=NULL;

sds_printf("\nDone testing sds_tblnext. ");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_tblobjname

int sds_tblobjname (const char *tblname, const char *this-entity, sds_name entity-name);

Determine the name of the object associated with that symbol.

This function returns the entity name of a specified symbol table entry. The tblobjname function searches the symbol table tblname for entity-name. It returns entity-name of that symbol table entry.

Valid tblnames are:

Table Name | Meaning
"appid" | Application identification.
"block" | Block names.
"dimstyle" | Dimension style names.
"layer" | Layer names.
"ltype" | Linetype names.
"style" | Text style names.
"view" | View names.
"ucs" | UCS names.
"vport" | Viewport names.

Default symbol names are:

Symbol | Meaning
"CONTINUOUS" | Default linetype.
"0" | Default layer.
"STANDARD" | Default text style.
"STANDARD" | Default dimension style.

This function returns an error code, depending on the success or failure of locating the entity name.

NOTE This function is typically used to pass an entity name to the sds_entget and sds_entmod functions.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_tblsearch

struct sds_resbuf *sds_tblsearch (const char *tblname, const char *symbol, int flag);

Search a table for a symbol.

This function obtains information about a known symbol from a drawing tblname. After entering in the tblname argument and the known symbol name, a list is returned containing dotted pairs for the symbol.

The flag (when set non-nil, such as 1) lets the sds_tblnext function retrieve the next item in the table:

The list returned is exactly like that returned from sds_tblnext.

This function returns the data as a linked list of result buffers, using DXF group codes and values. Otherwise, it returns NULL.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_textbox

int sds_textbox (const struct sds_resbuf *entity-name, sds_point point1, sds_point point2);

Determine the x,y-dimensions of this text object.

This function returns the relative two-dimensional coordinates of a box that encloses a text object. The lower-left corner is always (0,0).

The argument entity-name must refer to a text object or attributes, but not text in dimensions and blocks.

This function sets point1 to 0,0 and sets point2 to the maximum coordinates of a rectangle bounding the text.

This function returns RTNORM or RTERROR with an error number in system variable ERRNO.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_textpage

int sds_textpage (void);

Switch to the cleared text window.

This function switches to the text window from the graphics window. This functions differs from sds_textscr in that this function clears the text screen first.

This function returns RTNORM or RTERROR.

Example

char string1[512];

sds_getstring(0,"\nTo switch to the text screen, press Enter. ",string1);

sds_textpage();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_graphscr

sds_textscr


sds_textscr

int sds_textscr (void);

Switch to the text window with text.

This function switches to the text screen from the graphics screen. This function differs from sds_textpage in that this function does not first clear the text screen.

This function returns RTNORM or RTERROR

Example

char string1[512];

sds_getstring(0,"\nTo switch to the text screen, press Enter. ",string1);

sds_textscr();

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_graphscr

sds_textpage


sds_tolower

int sds_tolower (int value);

Change this character to lower-case.

This function converts a given character from upper- to lower-case.

The argument value is the ASCII value of a character.

This function returns the ASCII value for its lower case counterpart when the character is upper-case. If the given character is lower-case already, sds_tolower leaves it as it is.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter an upper case character: ");

returni=sds_tolower(string1[0]);

sds_printf("\nsds_tolower returned %i",returni);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_islower

sds_isupper

sds_toupper


sds_toupper

int sds_toupper (int value);

Change this character to upper-case.

This command converts a given character from lower- to upper-case.

The argument value is the ASCII value of a character.

This function returns the ASCII value for its uppercase counterpart when the given character is lower-case. If the given character is upper-case already, sds_toupper leaves it as it is.

Example

int returni;

char string1[512];

sds_getstring(1,"\nEnter a lower case character: ",string1);

returni=sds_toupper(string1[0]);

sds_printf("\nsds_toupper returned %i",returni);

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_islower

sds_isupper

sds_tolower


sds_trans

int sds_trans (const sds_point point, const struct sds_resbuf *from, const struct sds_resbuf *to, int disp, sds_point answer);

Translate this point from one coordinate system to another.

This function translates (moves) a point from to another coordinate system.

The point argument is a 3-D point in list format. The meaning of this argument depends on the setting of from and to.

The from argument describes the current coordinate system. The to argument describes the destination coordinate system, using the same codes as from. Unlike the LISP version of the trans function, the from and to hold other arguments:

    • Entity Name (RTENAME) specifies the Entity Coordinate System used by the entity.
    • 3D Extrusion Vector (RT3DPOINT) is a 3-D displacement vector.
    • Integer Code (RTSHORT) is another form of displacement vector, as described below:

Code | Coordinate System
0 | World coordinate system (WCS).
1 | Current user-defined coordinate system (UCS).
2 | Display coordinate system ( DCS) of current viewport-with code 0 or 1. DCS of current model space viewport-with code 3.
3 | Paper space DCS.

This function returns RTNORM or an error code in system variable ERRNO.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_undef

int sds_undef (const char *funname, short funcode);

Undefine a previously defined SDS™ function.

This function undefines an previously defined SDS function, which was previously defined by the sds_defun function. This function requires the same arguments as sds_defun.

The argument funname represents the command name for the function to be undefined.

The argument funcode is the function code by which sds_getfuncode would access this function.

This function returns RTNORM or an error code in system variable ERRNO.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_defun

sds_getfuncode


sds_usrbrk

int sds_usrbrk (void);

Determine whether the user pressed Esc.

This function checks to see if the user has pressed the Esc key. If so, this function returns 1; if not, it returns 0.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_vports

int sds_vports (struct sds_resbuf **vlist);

Get information about this viewport.

This function returns a description of all current viewports. The description returned by the sds_vports function is a list that includes the viewport identification number, followed by viewport coordinates. These coordinates vary, depending on the setting of Tilemode:

  • When TileMode = 1, the list consists of the viewports created by the VPorts command. Coordinates of the viewport's corners, ranging from (0.0, 0.0) for the lower-left corner, to (1.0, 1.0) for the upper-right corner.
  • When TileMode = 0, the list consists of the viewports created with the MView command. The corners are described by paper space coordinates.

NOTE In model space, the first viewport number is #2; viewport #1 is paper space when Tilemode = 0. The current viewport is listed first.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_wcmatch

int sds_wcmatch (const char *string, const char *match);

Determine whether this matches that.

This function checks to see if one string matches another string. It can be used to find an exact literal match, or by using any of the wildcard options listed below.

The argument string is the string to be tested.

The argument match is the string against which string is checked. This function is case-sensitive. The string match may contain any of the following special characters:

Character | Description
` (reverse single-quote) | Forces sds_wcmatch to check against the next character exactly. Use this with any special characters if you want to disregard their special meanings and interpret them literally.
~ (tilde) | Causes sds_wcmatch to match anything that is not the same as matchthat. It must be the first character in the string. If you have a tilde at any other point in the string, sds_wcmatch looks to match it with a tilde.
* | The asterisk is an unlimited wildcard. Use it to match any character, or series of characters, at any place in matchthat.
? | The question mark works just like the asterisk, but for just one character at a time, as opposed to a series of characters.
# @ | At, pound, and period are limited wildcards. They can be used to match single characters of specific types:
@ (at) | Any alphabetic character (A-Z)
- (hyphen) | Indicates a range of characters, such as sds_wcmatch(3-7).
, (comma) | You can use more than one pattern in matchthat. Just use the comma to separate the patterns. Sds_wcmatch looks for a match to any of the patterns (a OR b), but not necessarily all of them.
# (pound) | Any numeric character (0-9)
. (period) | Any non-alphanumeric character (&,%,+, etc.)

In addition to the above, the square brackets allow even greater flexibility:

  • [xyz123] looks for a match between doesthis and any of the characters enclosed in the brackets.
  • [~xyz123] finds something that is not a match between doesthis and any of the characters enclosed in the brackets; use the tilde just as with any other characters.

This function returns RTNORM if the strings match, and RTERROR if they do not.

Example

The following example tries to match this string: char *doesthis = "1A2B3C";

sds_wcmatch(doesthis,"[CAT],[~DOG]");

This would return RTNORM because the string "1A2B3C" does include characters from the first set: C, A, or T. Since the comma works as an OR, sds_wcmatch would return RTNORM whether or not there was a match in the second pattern.

sds_wcmatch(doesthis,"1a2b3c");

This would return RTERROR because upper- and lower-case characters do not match.

sds_wcmatch(doesthis,"#@#@??");

This would return RTNORM because the string "1A2B3C" does match the pattern of numeric character, alpha character, followed by any other 4 characters.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_xdroom

int sds_xdroom (const sds_name entity-name, long *memavail);

Determine how much space is left for EED.

This function reports the amount of extended entity data (or "xdata") space still free in the object identified by entity-name. All objects in IntelliCAD have 16KB (actually, 16,383 bytes) each to store any kind of user-defined data. This function tells you how many bytes are still remaining.

The argument entity-name is the object name for the object you wish to check.

The argument memavil the amount of memory, in bytes, still available for extended object data.

This function returns RTNORM or an error code in system variable ERRNO.

Example

sds_name EntName;

sds_point Point1;

struct sds_resbuf *EntList = NULL;

long MemLeft = 0l;

ReturnI=sds_entsel("\nPick an object: ",EntName,Point1);

if (ReturnI == RTNORM){

sds_xdroom(EntName,&MemLeft);

sds_printf("\n %ld bytes are availablefor EED on this object. ",MemLeft);

} else

sds_printf("\nNo object was found. Press Enter to try again.");

sds_relrb(EntList);

EntList = NULL;

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_xdsize


sds_xdsize

int sds_xdsize (const struct sds_resbuf *entity-data, long *memused);

Determine how much space this xdata takes up.

This function returns the size (in bytes) that extended entity data takes up in an object.

The argument entity-data is a result buffer containing only the extended entity data for the object in question.

The argument memused is the amount of memory, in bytes, used by the extended entity data.

This function returns RTNORM or an error code in system variable ERRNO.

Example

sds_name last;

sds_entlast(last);

sds_resbuf * rbApps = sds_buildlist(RTSTR, "*", RTNONE);

sds_resbuf * rbData = sds_entgetx(last, rbApps);

sds_resbuf * rbXData = entitem(rbData, -3);

long lUsed;

int rc = sds_xdsize(rbXData, &lUsed);

switch (rc)

{

case RTERROR:

sds_printf("\nThe last entity does not have any XData.");

break;

case RTNORM:

sds_printf("\nThe XData in the last entity takes up %li bytes.", lUsed);

break;

default:

sds_printf("\nsds_xdsize returned %i.", rc);

break;

}

sds_relrb(rbData);

rbData = NULL;

sds_relrb(rbApps);

rbApps = NULL;

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_xdroom


sds_xformss

int sds_xformss (const sds_name setname, sds_matrix transform);

Change this set according to this matrix.

This function changes the positional information for a selection set using the transformation matrix. The sds_xformss function can be used to scale, rotate, or move the selection, as long as the relative proportions of the set are maintained (aspect ratio). This function will not accept a matrix that attempts to change the x-, y-, and z-axes by different values.

The argument setname is the name of the selection set to be transformed.

The argument transform is the transformation matrix to be applied to setname. The matrix may scale the selection set, as long as the scaling factors for each axis are the same.

This function returns RTNORM or an error code in system variable ERRNO.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_xload

int sds_xload (const char *appname);

Load this SDS™ application.

This function loads an SDS application. If the program is already loaded, this function ignores the request to load it again.

The argument appname is the name of the application to load.

This function returns RTNORM or an error code in system variable ERRNO.

Example

if ((sds_xload("myapp")) != RTNORM)

sds_printf("\nThe file \"myapp\" was not loaded.");

else

sds_printf("\n\"myapp\" was loaded successfully.");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_loaded

sds_xunload


sds_xstrcase

int sds_xstrcase (const char *string);

Convert a string to UPPER-CASE.

This function converts strings to upper-case, to make it compatible with the DWG file format.

The argument string is the text string to be converted.

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)


sds_xunload

int sds_xunload (const char *appname);

Unload this SDS™ application.

This function unloads an SDS program application. If that program is not currently loaded, this function ignores the request to unload it and returns RTERROR.

The argument appname is the name of the application to be unloaded.

This function returns RTNORM or an error code in system variable ERRNO.

Example

if ((sds_xunload("myapp")) != RTNORM)

sds_printf("\nThe file \"myapp\" was not unloaded.");

else

sds_printf("\n\"myapp\" was unloaded successfully.");

Tell me about...

Programming Overview of SDS™ (Solutions Development System™)

sds_loaded

sds_xload


Using IntelliCAD VBA

Microsoft® Visual Basic for Applications (VBA) is an object-based programming environment designed to allow rapid development of custom solutions. In addition to being included within IntelliCAD, VBA is a core component of Microsoft® Office applications such as Excel, Word, and PowerPoint. IntelliCAD VBA has full Visual Basic language syntax, standard forms, and support for ActiveX Controls. Since it is an in-process controller, VBA within IntelliCAD generally produces better performance than external programming environments. It also provides application integration with other VBA-enabled applications using ActiveX Automation techniques.


Overview of Automation

Automation is a technology used to program individual applications such as IntelliCAD. You can use Automation to manipulate IntelliCAD objects both from within IntelliCAD and from other environments that incorporate ActiveX Automation:

Tell me about...

Using ActiveX Automation

Using IntelliCAD VBA


Using ActiveX Automation

ActiveX Automation, formerly known as OLE (Object Linking and Embedding) Automation, allows you to manipulate programmable objects from internal environments such as Visual Basic for Applications (VBA) or external environments such as Microsoft® Visual Basic and other applications that incorporate VBA. Using ActiveX Automation, you can create and manipulate IntelliCAD objects from any application that serves as an automation controller. With ActiveX Automation, you can combine the features of many applications in a single application for communication with other programs.

Within IntelliCAD, you can use VBA to edit and manipulate embedded ActiveX objects - including Microsoft® Word documents and Microsoft Excel charts - contained in IntelliCAD drawings.

The stand-alone editions of Visual Basic, which must be purchased separately, complement IntelliCAD VBA with additional components such as an external database engine and report-writing capabilities.

Tell me about...

Using IntelliCAD VBA


Using the Object Model

Objects are the main building blocks of VBA applications. Each exposed object represents a precise part of IntelliCAD, such as the active document, the active window, and various drawing entities, including lines, arcs, and text. The objects are structured in a hierarchical fashion called the object model. The object model shows you which object provides access to the next level of objects.

You manipulate IntelliCAD objects through properties and methods applicable to each object. A diagram of the IntelliCAD object model and a description of the objects, properties, and methods applicable to IntelliCAD can be found in The Object Model.


Starting VBA

If you have included VBA in your IntelliCAD installation options, you can start it as follows:

To start VBA

  1. From the Tools menu, choose Visual Basic and click Visual Basic Editor.
    2. The VBA Interactive Development Environment (IDE) is displayed.

Tell me about...

Managing VBA Projects


Inserting UserForms

One of the first tasks you will want to perform when building a VBA program is to insert a UserForm. This is the area where you develop the interface, or window that users will see when they run the program.

To insert a UserForm

  1. From the Insert menu in the VBA Editor, click UserForm. A blank UserForm is displayed, along with the Toolbox , which contains controls that you can insert on your UserForm.

Tell me about...

Adding Controls to a Userform


Adding Controls to a UserForm

After you have inserted a UserForm , you will generally want to add controls - the buttons, text boxes, and other items contained in your user interface. You place controls by dragging them from the Toolbox onto your UserForm.

A blank UserForm displayed in the VBA IDE, along with the Toolbox.


Creating Code

Program code -- the statements that tell the program what to do - is contained in the Code window of the VBA IDE. It can be displayed any of the following methods:

  • From the View menu in VBA, click Code.
  • Press the F7 key.
  • Double-click any control on a UserForm.

Once inside the Code window, you can create code by typing in VBA statements, copying and pasting code from other sources, or using Intellisense to place items. If you open the Code window by double-clicking a control that has no code yet associated with it, the first and last lines of a subroutine are created for the control, such as the following lines for a command button:

Private Sub CommandButton1_Click()

End Sub

Tell me about...

Adding Controls to a UserForm


Using Modules

A module contains procedures, data and type declarations, and definitions. Your VBA project does not need to include a module, but there are advantages to doing so. By creating a module, you can include multiple UserForms in your project and you can also run your project as a macro from the Tools menu in IntelliCAD or by using the VBARUN command.

To insert and use a module

  1. From the Insert menu in VBA, click Module.
  2. In the Properties window, type a name for your module. (You can also accept the default name Module1, Module2, etc.)
  3. Create code in the Code window just as you would for your controls. Module-level code generally contains just the general statements and macro assignments, as shown in the following code:

Public myVariable as Double

Sub anyMacro ()

UserForm1.Show

End Sub

Tell me about...

Adding Controls to a UserForm


Managing VBA Projects

IntelliCAD VBA projects are not stored as separate files, but are saved either:

  • within the drawing file
  • in common projects, which are available to multiple drawing files.

Macros contained within the drawing or in the common project file are not directly compatible with stand-alone Visual Basic projects (VBP files); however, forms, modules, and classes can be exchanged between dissimilar projects using the IMPORT and EXPORT VBA commands in the VBA IDE.

To save a macro within the drawing file

  1. From the File menu in either IntelliCAD or IntelliCAD VBA, click Save.
    2. or: click the Save icon in the Toolbar.
    or: press Ctrl + S.
    The drawing is saved under the selected name.
  2. If the drawing has not been previously saved, the Save As dialog box appears. Type a name in the File Name box and click Save.

To save a macro in the Common Project File

  1. Common projects can contain document-independent macros and are saved in a separate file called CommonProjects.VBI. This file is loaded automatically when IntelliCAD is first started.


Running a VBA Program

To run a program from the VBA IDE

  1. Do one of the following:
    • From the Run menu, click Run Sub/UserForm.
    • Click the Run icon in the Toolbar.
    • Press F5.

To run a program as a macro:

  1. From the Tools menu in IntelliCAD, point to Visual Basic and click Macros.
  2. Highlight the macro you wish to run. (You must have included a module and a macro name to run a macro.)
  3. Click Run.


Drawing Lines

A line is defined by its starting and ending point. You can create lines in VBA by specifying starting and ending points, and define certain properties such as color, linetype, and layer. To create new lines, use one of the following methods:

AddLine | Creates a line passing through two points and adds it to the drawing.
AddInfiniteline | Creates an infinite line passing through two points and adds it to the drawing.

Examples ...

AddInfiniteLine Method Example

AddLine Method Example


Drawing Polylines

A polyline is a connected sequence of lines and arcs that is treated as a single entity. You create polylines in VBA by specifying coordinates for each vertex of the polyline. To create polylines, use one of the following methods:

Add3Dpoly | Creates a 3D polyline and adds it to the drawing.
AddPolyline | Creates a polyline and adds it to the drawing.


Drawing Arcs

An arc is defined by its center point, radius, start angle, and end angle. You can create an arc using the following method:

AddArc

Creates an arc and adds it to the drawing.

Tell me about...

Drawing Circles

Examples ...

AddArc Method Example


Drawing Circles

A circle is actually a special case of an arc - one that sweeps a full 360-degree arc. You can create a circle with the following method:

AddCircle

Creates a circle and adds it to the drawing.

Tell me about...

Drawing Arcs

Examples ...

AddArc Method Example


The object model

A diagram of the IntelliCAD object model is shown below.


The VBA Interactive Development Environment


Creating Points

A point is a location in space specified by its x, y, and z coordinates. An IntelliCAD point entity consists of a single x-, y-, and z-coordinate location, and is represented by one of several symbols . You can create both Point objects -- which are not visible on screen -- and PointEntity objects -- which are visible on screen. To create points and point entities, use one of the following methods:

CreatePoint | Creates a Point object.
AddPointEntity | Creates a PointEntity object and adds it to the drawing.

To change the appearance of point entities, change the PDMODE and PDSIZE system variables using the SetVariable method.


Creating Splines

A spline is a curve generated along the path of three or more control points. The curve passes through the start and end points, but does not necessarily pass through the intermediate control points. To create splines, use the AddSpline method.


Point Symbols

Point symbols are set using the PDMODE system variable.


Adding Hatching

Hatching fills a specified area with lines, crosshatching, or other hatch patterns.

The first step in hatching an area is to create the Hatch object. Once this is done, you specify the hatch boundaries.

Creating a Hatch Object

To create a hatch object, use the AddHatch method.


Creating Single-Line Text

Single-line text is an individual line of text contained in one Text object. It is useful for labels and short notes. If you have longer notes that may exceed one line, use paragraph text (Mtext). To create single-line text, use the AddText method. In either case, you need to provide three values as input: the text string, the insertion point, and the height of the text.

The text string is the text you wish displayed - entered as either a string variable or as a literal string enclosed in quotes. The insertion point is a Point object indicating the coordinate location for placing the text. The text height is a real number defining the height of the upper-case characters in drawing units.

Tell me about...

Creating Paragraph Text

Examples ...

AddMtext Method Example


Creating Paragraph Text

Paragraph text, or multi-line text, is a paragraph of characters that fits within a boundary and is contained in the Mtext object. It is useful for long notes and other entries that may extend onto several lines. To create a Mtext object, use the AddMtext method. You need to provide three input parameters: the insertion point, the width of the text window, and the text string.

The insertion point is a Point object indicating the coordinate location for placing the text. The width is a real number defining the width of the text window in drawing units. The text string is the text you wish displayed - entered as either a string variable or as a literal string enclosed in quotes.

Tell me about...

Creating Single-Line Text

Examples ...

AddMtext Method Example


Working with Text Styles

Each text object has a style associated with it. The current text style sets the font, size, angle, orientation, and other text characteristics -- all contained in the TextStyle object.

Except for the default STANDARD style, you must create any text style you want to use. New text uses properties from the current text style. To create a text style, use the Add method to create a new TextStyle object and add it to the TextStyles Collection object. The Add method takes a TextStyle name as input.

If you change an existing style's font or orientation, all text using that style is changed to use the new font or orientation. Changing text height, width factor, and oblique angle does not change existing text but does change subsequently created text objects.

Tell me about...

TextStyle object

TextStyles Collection


Using Named Views

Just as you can name and save a view in an IntelliCAD drawing, you can also do this through VBA.

Creating and Naming Views

Views are named when they are created. To create a new view, use the Add method to add a new view to the Views collection object. When you save the drawing, the viewing position and scale of the view are saved. When you no longer need the view, you can delete it.

Deleting Views

To delete a named view, use the Delete method. The Delete method for the View object lies on the View object itself, not its parent. For example, to delete a view (SIDEVIEW) from the current views collection, use the following line of code:

SideView.Delete

You can also delete named view (FRONTVIEW), as shown in the following line of code:

ThisDocument.Views("FRONTVIEW").Delete

Either of the above methods can be used at any time. If you have saved a reference to a view you can delete the view directly. Otherwise, you can always go through the Views collection to delete the view.

Tell me about...

Views collection object


Using Viewports

A Viewport is a window that displays all or part of a drawing's model space. To modify viewport settings, use the methods and properties of the Viewport object.

Tell me about...

Viewport object


Creating Three-Dimensional Objects

IntelliCAD allows you to create a variety of three-dimensional objects using Automation. You create and edit 3D objects much like you do 2D objects, using methods and properties applicable to specific objects. With 3D objects, however, you deal with a Z-value in addition to X and Y values.

To create 3D objects, use the following methods:

Add3Dface

Add3Dpoly

AddBox

AddCone

AddCylinder

AddPolyfaceMesh

AddSolid

AddSphere

AddTorus

AddWedge


3DFace object

The 3DFace object represents a 3D triangle or quadrilateral plane section. To create a 3DFace, use the Add3DFace method. To edit or query a 3DFace, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetInvisibleEdge | Handle
GetXdata | Layer
Highlight | Linetype
IntersectWith | LinetypeScale
Mirror | Parent
Mirror3D | VisibilityEdge1
Move | VisibilityEdge2
Rotate | VisibilityEdge3
Rotate3D | VisibilityEdge4
ScaleEntity | Visible
SetXData |
SetInvisibleEdge |
TransformBy |
Update |


3DPoly object

The 3DPoly object represents a polyline with three dimensional characteristics. To access the 3DPoly object, use the following methods and properties.

Methods | Properties
AppendVertex | Application
ArrayPolar | Closed
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
Explode | EntityType
GetBoundingBox | Handle
GetXdata | Layer
Highlight | Length
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | Parent
Move | Visible
Rotate |
Rotate3D |
ScaleEntity |
SetXData |
TransformBy |
Update |


Application object

The Application object represents an instance of the IntelliCAD application.

The properties associated with the Application object reflect the properties of the main application window. The methods control the loading or listing of the currently loaded external applications and interface objects. The active document (IntelliCAD drawing) can be accessed using the ActiveDocument property.

Use the Quit method to end the IntelliCAD session.

Methods | Properties
DefineFunction | ActiveDocument
GetInterfaceobject | ActiveWindow
Help | Application
IsFunctionLoaded | Caption
ListSDS | DefaultFilePath
LoadLISP | Document
LoadSDS | FullName
Quit | Height
RunCommand | Left
RunScript | Library
UndefineFunction | LocaleID
UnloadSDS | Name
 | Parent
 | Path
 | PlotManager
 | Preferences
 | StatusBar
 | Top
 | VBE
 | Version
 | Visible
 | Width
 | Windows
 | Workspace


ApplicationPreferences object

The ApplicationPreferences object contains certain settings for the current session of IntelliCAD. Access these settings with the following properties:

Methods | Properties
 | AltFontFile
 | Application
 | AutoSaveInterval
 | CursorSize
 | CursorXColor
 | CursorYColor
 | CursorZColor
 | DisplayScrollBars
 | DockedVisibleLines
 | GraphicsWinBackgrndColor
 | HistoryLines
 | LogFileName
 | LogFileOn
 | MaxIntelliCADWindow
 | Parent


Arc object

The Arc object represents a segment of a circle or ellipse. To create an arc, use either the AddArc method. To access the Arc object, use the following methods and properties.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Area
Copy | Center
Delete | Coordinates
Erase | Color
GetBoundingBox | Document
GetXdata | EndAngle
Highlight | EndPoint
IntersectWith | EntityName
Mirror | EntityType
Mirror3D | Handle
Move | Layer
Offset | Linetype
Rotate | LinetypeScale
Rotate3D | Normal
ScaleEntity | Parent
SetXData | Radius
TransformBy | StartAngle
Update | StartPoint
 | Thickness
 | Visible


Attribute Definition object

An Attribute Definition defines the prompt, tag string, default value, and display characteristics of an attribute. When you insert a block into a drawing you get a BlockInsert object. If the BlockInsert "has attributes," you can iterate through the Attribute objects in the Attributes collection using the Has Attributes method. Each Attribute is an individual instantiation of the AttributeDef object in the Block. It is this Attribute object that contains the value of the attribute.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Constant
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | FieldLength
Highlight | Handle
IntersectWith | Height
Mirror | HorizontalAlignment
Mirror3D | InsertionPoint
Move | Invisible
Rotate | Layer
Rotate3D | Linetype
ScaleEntity | LinetypeScale
SetXData | Mode
TransformBy | Normal
Update | ObliqueAngle
 | Parent
 | Preset
 | PromptString
 | Rotation
 | ScaleFactor
 | StyleName
 | TagString
 | TextAlignmentPoint
 | TextGenerationFlag
 | TextString
 | Thickness
 | Verify
 | VerticalAlignment
 | Visible


Attribute object

The Attribute object represents a block component that contains specific text or numeric information. To access the Attribute object, use the following methods and properties.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Constant
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | FieldLength
Highlight | Handle
IntersectWith | Height
Mirror | HorizontalAlignment
Mirror3D | InsertionPoint
Move | Invisible
Rotate | Layer
Rotate3D | Linetype
TransformBy | LinetypeScale
Update | Normal
 | ObliqueAngle
 | Parent
 | Preset
 | Rotation
 | ScaleFactor
 | StyleName
 | TagString
 | TextAlignmentPoint
 | TextGenerationFlag
 | TextString
 | Thickness
 | Value
 | VerticalAlignment
 | Visible


Attributes collection object

The Attributes collection object is the collection of all attributes in a drawing. To access the Attributes collection object, use the following methods and properties:

Methods | Properties
Add | Application
 | Count
 | Item
 | Parent


Block object

The Block object represents one or more entities grouped together to create a single entity. The Block definition contains a name and a set of entities. To insert a block into a drawing, use the InsertBlock method. To edit or query a block definition, use the following methods and properties:

Methods | Properties
Add3DFace | Application
Add3DMesh | Count
Add3DPoly | IsXRef
AddArc | Name
AddAttributeDef | Origin
AddBox | Parent
AddCircle |
AddCone |
AddCylinder |
AddDim3PointAngular |
AddDimAligned |
AddDimAngular |
AddDimDiametric |
AddDimOrdinate |
AddDimRadial |
AddDimRotated |
AddEllipse |
AddHatch |
AddImage |
AddInfiniteLine |
AddItems |
AddLeader |
AddLightWeightPolyline |
AddLine |
AddMText |
AddPointEntity |
AddPolyfaceMesh |
AddPolyline |
AddRay |
AddSolid |
AddSphere |
AddSpline |
AddText |
AddTolerance |
AddTorus |
AddTrace |
AddWedge |
AttachExternalReference |
Bind |
Delete |
Detach |
GetXdata |
InsertBlock |
Item |
Reload |
SetXData |
Unload |
WBlock |


BlockInsert object

The BlockInsert object represents an instance of a block definition inserted into a drawing. To create a block reference, use the InsertBlock method. To query or edit an existing block reference, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Document
Delete | EntityName
Erase | EntityType
Explode | Handle
GetAttributes | HasAttributes
GetBoundingBox | InsertionPoint
GetXdata | Layer
Highlight | Linetype
IntersectWith | LinetypeScale
Mirror | Name
Mirror3D | Normal
Move | Parent
Rotate | Rotation
Rotate3D | Visible
ScaleEntity | XScaleFactor
SetXData | YScaleFactor
TransformBy | ZScaleFactor
Update |


Blocks collection object

The Blocks collection object is the collection of all blocks in a drawing. To access the Blocks collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Circle object

The Circle object represents a full circle. To create a circle use the AddCircle method. To access the Circle object, use the following methods and properties.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Area
Copy | Center
Delete | Circumference
Erase | Color
GetBoundingBox | Document
GetXdata | EntityName
Highlight | EntityType
IntersectWith | Handle
Mirror | Layer
Mirror3D | Linetype
Move | LinetypeScale
Rotate | Normal
Rotate3D | Parent
ScaleEntity | Radius
SetXData | Thickness
TransformBy | Visible
Update |


Dimension object

The Dimension object represents a dimension in a drawing. Dimensions may be angular, linear, radial, or one of several other types. To create a dimension, use one of the AddDimXXX methods. To query or edit an existing dimension, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | ArrowheadSize
Copy | Color
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | ExtensionLineOffset
Highlight | Handle
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Normal
Rotate | Parent
Rotate3D | Rotation
ScaleEntity | ScaleFactor
SetXData | StyleName
TransformBy | SuppressLeadingZeroes
Update | SuppressTrailingZeroes
 | TextColor
 | TextGap
 | TextHeight
 | TextMovement
 | TextOverride
 | TextPosition
 | TextPrefix
 | TextRotation
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | TolearanceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimensionStyle object

The DimensionStyle object contains the settings that determine the appearance of a dimension. To access the DimensionStyle object, use the following methods and properties:

Methods | Properties
Delete | Application
GetXdata | Document
SetXData | Handle
 | Name
 | Parent


DimensionStyles collection object

The DimensionStyles collection object is the collection of all dimension styles in a drawing. To access the DimensionStyles collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Document object

The Document object represents the active IntelliCAD drawing. The active document (IntelliCAD drawing) can be accessed using ThisDocument in VBA or through the ActiveDocument property in VB.

To create or open a Document object, use the New or Open methods. To edit or query a Document object, use the following methods and properties:

Methods | Properties
Activate | Active
Close | ActiveDimStyle
EvaluateLispExpression | ActiveLayer
Export | ActiveLinetype
GetLispVariable | ActivePViewport
GetVariable | ActiveSelectionSet
HandleToobject | ActiveSpace
ImportI | ActiveTextStyle
NewWindow | ActiveUCS
PrintDrawing | ActiveViewport
PrintPreview | Application
PurgeAll | Blocks
Regen | DimensionStyles
RevertToSaved | ElevationModelSpace
Save | ElevationPaperSpace
SaveAs | FullName
SetLispVariable | Layers
SetVariable | Limits
WriteBlock | Linetypes
 | ModelSpace
 | MSpace
 | Name
 | objectSnapMode
 | PaperSpace
 | Parent
 | Path
 | Preferences
 | ReadOnly
 | RegisteredApplications
 | Saved
 | SelectionSets
 | Textstyles
 | UCSs
 | Utility
 | Viewports
 | Views
 | Visible


DocumentPreferences object

The DocumentPreferences object contains certain settings for the active document (drawing). Access these settings with the following properties:

Methods | Properties
 | Application
 | ContourLinesPerSurface
 | DisplaySilhouette
 | MaxActiveViewports
 | ObjectSnapMode
 | Parent
 | RenderSmoothness
 | SegmentPerPolyline
 | SolidFill
 | TextFrameDisplay
 | XRefLayerVisibility


Documents collection object

The Documents collection object is the collection of all open documents (drawings). To access the Documents collection object, use the following methods and properties:

Methods | Properties
Add | Application
CloseAll | Count
Item | Parent
Open |
SaveAll |


Ellipse object

The Ellipse object represents an elliptical arc or full ellipse. To create an ellipse use the AddEllipse method. To access the Ellipse object, use the following methods and properties.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Area
Copy | Center
Delete | Color
Erase | Document
GetBoundingBox | EndAngle
GetXdata | EndParameter
Highlight | EndPoint
IntersectWith | EntityName
Mirror | EntityType
Mirror3D | Handle
Move | Layer
Offset | Length
Rotate | Linetype
Rotate3D | LinetypeScale
ScaleEntity | MajorAxis
SetXData | MinorAxis
TransformBy | Normal
Update | Parent
 | RadiusRatio
 | StartAngle
 | StartParameter
 | StartPoint
 | Visible


ExternalReference object

An instance of an external reference inserted into a drawing. To query or edit an existing external reference, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Document
Delete | EntityName
Erase | EntityType
GetAttributes | Handle
GetBoundingBox | HasAttributes
GetXdata | InsertionPoint
Highlight | Layer
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | Name
Move | Normal
Rotate | Parent
Rotate3D | Path
ScaleEntity | Rotation
SetXData | Visible
TransformBy | XScaleFactor
Update | YScaleFactor
 | ZScaleFactor


Hatch object

The Hatch object represents an area fill consisting of a pattern of lines. To create a hatch, first create the Hatch object using the AddHatch method. To query or edit an existing block reference, use the following methods and properties:

Methods | Properties
ApplyHatch | Application
ArrayPolar | AssociativeHatch
ArrayRectangular | Color
Copy | Document
Delete | EntityName
Erase | EntityType
GetBoundingBox | Handle
GetXdata | HatchStyle
Highlight | Layer
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | Normal
Move | Parent
Rotate | PatternAngle
Rotate3D | PatternDouble
ScaleEntity | PatternName
SetPattern | PatternScale
SetXData | PatternSpace
TransformBy | PatternType
Update | Visible


Image object

The Image object represents a raster image consisting of a rectangular grid of small squares or dots known as pixels. To create a raster image use the AddImage method. To edit or query a raster image, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Document
Delete | EntityName
Erase | EntityType
GetBoundingBox | Handle
GetXdata | Height
Highlight | ImageFile
IntersectWith | ImageHeight
Mirror | ImageVisibility
Mirror3D | ImageWidth
Move | Layer
Offset | Linetype
Rotate | LinetypeScale
Rotate3D | Origin
ScaleEntity | Parent
SetXData | Visible
TransformBy | Width
Update |


InfiniteLine object

The InfiteLine object represents an line extending infinitely in both directions. To create an infinite line, use the AddInfiniteLine method. To access the Ellipse object, use the following methods and properties.

Methods | Properties
ArrayPolar | Application
ArrayRectangular | BasePoint
Copy | Color
Delete | DirectionVector
Erase | Document
GetBoundingBox | EntityName
GetXdata | EntityType
Highlight | Handle
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Parent
Offset | Visible
Rotate |
Rotate3D |
ScaleEntity |
SetXData |
TransformBy |
Update |


Layer object

A layer is a grouping of drawing entities into logical sets. The Layer object provides access to various methods and properties for setting and obtaining layer characteristics such as color, linetype, and on/off status. To access the Layer object, use the following methods and

Methods | Properties
Delete | Application
GetXdata | Color
SetXData | Document
 | Freeze
 | Handle
 | LayerOn
 | Linetype
 | Lock
 | Name
 | Parent


Layers collection object

The Layers collection object is the collection of all layers in a drawing. To access the Layers collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Leader object

The Leader object represents a line leading from a feature of the drawing to an annotation, such as a dimension. To create a leader, use the AddLeader method. To access the Leader object, use the following methods and properties:

Methods | Properties
ArrayPolar | Annotation
ArrayRectangular | Application
Copy | Color
Delete | Coordinates
Erase | Document
GetBoundingBox | EntityName
GetXdata | EntityType
Highlight | Handle
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Normal
Rotate | Parent
Rotate3D | StyleName
ScaleEntity | Type
SetXData | Visible
TransformBy |
Update |


Library object

The Library object provides access to methods that enable compatibility with Solutions Development System (SDS) library functions. To access the Library object, use the following methods and properties:

Methods | Properties
AddVectors | Application
ApplyMatrix | Parent
CalculateDistance |
ComposeMatrix |
ConvertArrayToMatrix |
ConvertArrayToPoint |
ConvertArrayToPoints |
ConvertArrayToVector |
ConvertMatrixToArray |
ConvertPointsToArray |
ConvertPointToArray |
ConvertVectorToArray |
CreateIdentityMatrix |
CreateMirrorMatrix |
CreatePoint |
CreatePoints |
CreateRotationMatrix |
CreateScaleMatrix |
CreateTranslationMatrix |
CreateVector |
DistanceBetweenVectors |
InvertMatrix |
SubtractVectors |
VectorCrossProduct |
VectorDotProduct |
VectorLength |
VectorScalarMultiply |
VectorUnitize |


Line object

The Line object represents a single line segment. To create a line, use the AddLine method. To edit or obtain information about a line, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Document
Delete | EndPoint
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | Handle
Highlight | Layer
IntersectWith | Length
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Normal
Offset | Parent
Rotate | StartPoint
Rotate3D | Thickness
ScaleEntity | Visible
SetXData |
TransformBy |
Update |


Linetype object

The Linetype object defines the appearance of a line. A line can be solid (continuous) or a pattern of dashes, dots, and blank spaces. To access the Linetype object, use the following methods and properties:

Methods | Properties
Delete | Application
GetXdata | Description
SetXData | Document
Save | Handle
 | Name
 | nSegments
 | Parent
 | PatternLength
 | Scale
 | SegmentLength
 | Xoffset
 | YOffset


Linetypes collection object

The Linetypes collection object is the collection of all line types in a drawing. To access the Linetypes collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


LWPolyline object

The LWPolyline (lightweight polyline) object represents a drawing entity composed of one or more connected line or arc segments treated as a single entity. To create a polyline, use the AddPolyline method. To edit or obtain information about a line, use the following methods and properties:

Methods | Properties
AddVertex | Application
ArrayPolar | Area
ArrayRectangular | Closed
Copy | Color
Delete | Coordinates
Erase | Document
Explode | EntityName
GetBoundingBox | EntityType
GetBulge | Handle
GetWidth | Layer
GetXdata | Length
Highlight | Linetype
IntersectWith | LinetypeScale
Mirror | Normal
Mirror3D | Parent
Move | Thickness
Offset | Type
Rotate | Visible
Rotate3D |
ScaleEntity |
SetBulge |
SetWidth |
SetXData |
TransformBy |
Update |


Matrix object

Methods | Properties
 | Application
 | Parent
 | GetValue
 | SetValue


ModelSpace object

The ModelSpace object is a special collection object containing all model space entities. The model space is one of two primary spaces where IntelliCAD objects reside. (The other is paper space.)

To edit or query the ModelSpaceEntities collection object, use the following methods and properties:

Methods | Properties
Add3DFace | Application
Add3DMesh | Count
Add3DPoly | Parent
AddArc |
AddAttributeDef |
AddBox |
AddCircle |
AddCone |
AddCylinder |
AddDim3Point |
AddDimAligned |
AddDimAngular |
AddDimDiametric |
AddDimOrdinate |
AddDimRadial |
AddDimRotated |
AddEllipse |
AddHatch |
AddImage |
AddInfiniteLine |
AddLeader |
AddLightWeight |
AddLine |
AddMText |
AddPointEntity |
AddPolyfaceMesh |
AddPolyline |
AddPViewport |
AddRay |
AddSolid |
AddSphere |
AddSpline |
AddText |
AddTolerance |
AddTorus |
AddTrace |
AddWedge |
AttachExternalReference |
InsertBlock |
Item |


Mtext object

The Mtext object represents multi-line text, or a paragraph of characters that fits within a boundary. To create an Mtext object, use the AddMtext or method. To modify or obtain information about a point entity, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | AttachmentPoint
Copy | Color
Delete | Document
Erase | DrawingDirection
GetBoundingBox | EntityName
GetXdata | EntityType
Highlight | Handle
IntersectWith | Height
Mirror | InsertionPoint
Mirror3D | Layer
Move | Linetype
Rotate | LinetypeScale
Rotate3D | Normal
ScaleEntity | Parent
SetXData | Rotation
TransformBy | StyleName
Update | TextString
 | Visible
 | Width


PaperSpace object

The PaperSpace object is a special collection object containing all paper space entities. The paper space is one of two primary spaces where IntelliCAD objects reside. (The other is model space.)

To edit or query the PaperSpaceEntities collection object, use the following methods and properties:

Methods | Properties
Add3DFace | Application
Add3DMesh | Count
Add3DPoly | Parent
AddArc |
AddAttributeDef |
AddBox |
AddCircle |
AddCone |
AddCylinder |
AddDim3PointAngular |
AddDimAligned |
AddDimAngular |
AddDimDiametric |
AddDimOrdinate |
AddDimRadial |
AddDimRotated |
AddEllipse |
AddHatch |
AddImage |
AddInfiniteLine |
AddLeader |
AddLightWeightPolyline |
AddLine |
AddMText |
AddPointEntity |
AddPolyfaceMesh |
AddPolyline |
AddPViewport |
AddRay |
AddSolid |
AddSphere |
AddSpline |
AddText |
AddTolerance |
AddTorus |
AddTrace |
AddWedge |
AttachExternalReference |
InsertBlock |
Item |


PlotManager object

The PlotManager object provides a means of obtaining and setting plot parameters, such as paper size, orientation, and other properties. To access the PlotManager object, use the following methods and properties:

Methods | Properties
ExportPlotProperties | Area
GetPaperSize | CenterOnPage
GetWindow | Footer
ImportPlotProperties | Header
Preview | HideLines
Print | OnlyWindowArea
SetPaperSize | PaperOrientation
SetWindow | PlotProperties
 | View


PlotProperties object

The PlotProperties object contains a group of parameters related to a plot, such as the scale, origin, and pen characteristics. The PlotProperties object has no applicable methods, but can be accessed with the following properties:

Methods | Properties
 | OptimizeLevel
 | OriginX
 | OriginY
 | Pens
 | PenWidth
 | Rotate
 | Scale
 | Units
 | Version


PlotterPen object

The PlotterPenobject contains parameters related to pens in a plotter. You can use the PlotterPen object to set or return the following properties:

Methods | Properties
 | Linetype
 | Number
 | Weight


PlotterPens object

The PlotterPens collection object is the collection of all PlotterPen objects in a drawing. To access the PlotterPens collection object, use the following properties:

Methods | Properties
 | Count
 | Item


Point object

The Point object contains data describing a single x, y, z-coordinate location. It should not be confused with the PointEntity object, which represents an actual drawing entity. To set or obtain information about a point object, use the following properties:

Methods | Properties
 | Application
 | Parent
 | X
 | Y
 | Z


PointEntity object

The PointEntity object represents a drawing entity consisting of a single x, y, z-coordinate location and displayed as one of several point symbols. It should not be confused with the Point object, which contains point data but does not display a point symbol on the screen.

To create a new point entity at a given location, use the AddPointEntity method. To create a new Point object, use the CreatePoint method. To modify or obtain information about a point entity, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | Handle
Highlight | Layer
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | Normal
Move | Parent
Rotate | Thickness
Rotate3D | Visible
ScaleEntity |
SetXData |
TransformBy |
Update |


Points collection object

The Points collection object is the collection of all points in a drawing. To access the Points collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


PolyfaceMesh object

The PolyfaceMesh object is a 3D mesh consisting of a series of connected polygon faces. To create a PolyfaceMesh object, use the AddPolyfaceMesh method. To access a PolyfaceMesh object, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
Explode | EntityType
GetBoundingBox | Handle
GetXdata | Layer
Highlight | Linetype
IntersectWith | LinetypeScale
Mirror | NumberOfFaces
Mirror3D | NumberOfVertices
Move | Parent
Rotate | Visible
Rotate3D |
ScaleEntity |
SetXData |
TransformBy |
Update |


PolygonMesh object

The PolygonMesh object is a free-form mesh consisting of a series of connected polygon faces. It is identified as an M x N mesh where M represents the number of vertices in a row of the mesh and N represents the number of vertices in a column of the mesh. A mesh can be open or closed in either or both the M and N directions. A mesh that is closed in a given direction is considered to be continuous from the last row or column on to the first row or column.

To create a PolygonMesh object, use the Add3DMesh method. To access a PolygonMesh object, use the following methods and properties:

Methods | Properties
AppendVertex | Application
ArrayPolar | Color
ArrayRectangular | Coordinates
Copy | Document
Delete | EntityName
Erase | EntityType
Explode | Handle
GetBoundingBox | Layer
GetXdata | Linetype
Highlight | LinetypeScale
IntersectWith | MClose
Mirror | MDensity
Mirror3D | MVertexCount
Move | Nclose
Rotate | NDensity
Rotate3D | NVertexCount
ScaleEntity | Parent
SetXData | Type
TransformBy | Visible
Update |


Polyline object

The Polyline object represents a drawing entity composed of one or more connected line or arc segments treated as a single entity. To create a polyline, use the AddPolyline method. To edit or obtain information about a line, use the following methods and properties:

Methods | Properties
AppendVertex | Application
ArrayPolar | Area
ArrayRectangular | Closed
Copy | Color
Delete | Coordinates
Erase | Document
Explode | EntityName
GetBoundingBox | EntityType
GetBulge | Handle
GetWidth | Layer
GetXdata | Length
Highlight | Linetype
IntersectWith | LinetypeScale
Mirror | Normal
Mirror3D | Parent
Move | Thickness
Offset | Type
Rotate | Visible
Rotate3D |
ScaleEntity |
SetBulge |
SetWidth |
SetXData |
TransformBy |
Update |


PViewport object

The PViewport object represents a window that displays all or part of a drawing's paper space. To access the PViewport object, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Center
Copy | Color
Delete | Direction
Display | Document
Erase | EntityName
GetBoundingBox | EntityType
GetGridSpacing | GridOn
GetSnapSpacing | Handle
GetXdata | Height
Highlight | Layer
IntersectWith | LensLength
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Parent
Rotate | RemoveHiddenLines
Rotate3D | SnapBasePoint
ScaleEntity | SnapOn
SetGridSpacing | SnapRotationAngle
SetSnapSpacing | Target
SetView | TwistAngle
SetXData | UCSIconAtOrigin
TransformBy | UCSIcon
Update | Visible
ZoomAll | Width
ZoomCenter |
ZoomExtents |
ZoomPickWindow |
ZoomScaled |
ZoomWindow |


Ray object

The Ray object is a line that starts at a designated point and runs infinitely. To create a Ray object, use the AddRay method. To access a ray, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | DirectionVector
Delete | Document
Erase | EndPoint
GetBoundingBox | EntityName
GetXdata | EntityType
Highlight | Handle
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Parent
Offset | Visible
Rotate |
Rotate3D |
ScaleEntity |
SetXData |
TransformBy |
Update |


RegisteredApplication object

An external application that has been added to the drawing. To register an application, add it to the RegisteredApplicationcollection using the Add method. To edit or query a RegisteredApplication object, use the following methods and properties:

Methods | Properties
Delete | Application
GetXdata | Document
SetXData | Handle
 | Parent


RegisteredApplications object

The collection of all registered applications (external applications added to the drawing). To work with members of the RegisteredApplications collection, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


SelectionSet object

The SelectionSet object represents one or more drawing entities which can be operated on as a single unit. To access the SelectionSet object, use the following methods and properties:

Methods | Properties
AddItems | Application
Clear | Color
Copy | Count
Delete | Document
Erase | Layer
Highlight | Linetype object
Item | Name
Mirror | Parent
Mirror3D | Visible
Move |
RemoveItems |
Rotate |
Rotate3D |
ScaleEntity |
Select |
SelectAtPoint |
SelectByPolygon |
SelectOnScreen |
TransformBy |
Update |


SelectionSets collection object

The SelectionSets collection object is the collection of all selection sets in a drawing. To access the SelectionSets object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Solid object

The Solid object is a solid-filled polygon. To create a Solid object, use the AddSolid or CreateSolid methods. To access a solid, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | Handle
Highlight | Layer
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | Normal
Move | Parent
Rotate | Thickness
Rotate3D | Visible
ScaleEntity |
SetXData |
TransformBy |
Update |


Spline object

The Spline object is a free-form curve generated along the path of three or more control points. The curve passes through the start and end points, but does not necessarily pass through the intermediate control points. To create a Spline object, use the AddSpline or method. To access a spline, use the following methods and properties:

Methods | Properties
AddFitPoint | Application
ArrayPolar | Area
ArrayRectangular | Closed
Copy | Color
Delete | Degree
DeleteFitPoint | Document
ElevateOrder | EndTangent
Erase | EntityName
GetBoundingBox | EntityType
GetControlPoint | FitTolerance
GetFitPoint | Handle
GetWeight | IsRational
GetXdata | Layer
Highlight | Length
IntersectWith | Linetype
Mirror | LinetypeScale
Mirror3D | NumberOfControlPoints
Move | NumberOfFitPoints
Offset | Parent
PurgeFitData | StartTangent
Reverse | Visible
Rotate |
Rotate3D |
ScaleEntity |
SetControlPoint |
SetFitPoint |
SetWeight |
SetXData |
TransformBy |
Update |


Text object

The Text object represents single-line text. To create text, use the AddText or CreateText methods. To modify or obtain information about text, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Document
Delete | EntityName
Erase | EntityType
GetBoundingBox | Handle
GetXdata | Height
Highlight | HorizontalAlignment
IntersectWith | InsertionPoint
Mirror | Layer
Mirror3D | Linetype
Move | LinetypeScale
Rotate | Normal
Rotate3D | ObliqueAngle
ScaleEntity | Parent
SetXData | Rotation
TransformBy | ScaleFactor
Update | StyleName
 | TextAlignmentPoint
 | TextGenerationFlag
 | TextString
 | Thickness
 | VerticalAlignment
 | Visible
 | Width


TextStyle object

The TextStyle object contains the settings that determine the appearance of text. To access the TextStyle object, use the following methods and properties.

Methods | Properties
Delete | Application
GetXdata | BigFontFile
SetXData | Document
 | FontFile
 | Handle
 | Height
 | LastHeight
 | Name
 | ObliqueAngle
 | Parent
 | TextGenerationFlag
 | Width


TextStyles collection object

The TextStyles collection object is the collection of all text styles in a drawing. To access the TextStyles collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Tolerance object

The Tolerance object represents geometric tolerance. To create tolerance, use the AddTolerance or CreateTolerance methods. To modify or obtain information about a Tolerance object, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | DirectionVector
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | Handle
Highlight | InsertionPoint
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Normal
Rotate | Parent
Rotate3D | StyleName
ScaleEntity | TextHeight
SetXData | TextString
TransformBy | Thickness
Update | VerticalAlignment
 | Visible


Trace object

The Trace object is a 2D solid line of specified width. To create tolerance, use the AddTrace or CreateTrace methods. To modify or obtain information about a Trace object, use the following methods and properties:

Methods | Properties
ArrayPolar | Application
ArrayRectangular | Color
Copy | Coordinates
Delete | Document
Erase | EntityName
GetBoundingBox | EntityType
GetXdata | Handle
Highlight | InsertionPoint
IntersectWith | Layer
Mirror | Linetype
Mirror3D | LinetypeScale
Move | Normal
Rotate | Parent
Rotate3D | Thickness
ScaleEntity | Visible
SetXData |
TransformBy |
Update |


UserCoordSystem object

The UserCoordSystem object represents a coordinate system defined by the user for determining the orientation of the X, Y, and Z axes. To access the UserCoordSystem object, use the following methods and properties:

Methods | Properties
Delete | Application
GetUCSMatrix | Document
GetXdata | Handle
SetXData | Name
 | Origin
 | Parent
 | Xvector
 | Yvector
 | Zvector


UserCoordSystems collection object

The UserCoordSystems collection object is the collection of all user coordinate systems in a drawing. To access the UserCoordSystems collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Utility object

The Utility object provides access to a series of properties and methods for user input and data conversion.

Methods | Properties
Alert | Application
AngleFromX | Parent
AngleToReal |
DistanceToReal |
RealToString |
AngleToString |
Prompt |
ConvertUnit |
EntitySnap |
FindFile |
GetAngle |
GetCorner |
GetDistance |
GetEntity |
GetSubEntity |
GetInput |
GetInteger |
GetOrientation |
GetPoint |
GetReal |
GetString |
TranslateCoordinates |
InitializeUserInput |
GetKeyword |
PolarPoint |
PaintLine |
ShowGraphicScreen |
ShowTextScreen |
WildCardMatch |


Vector object

The Vector object contains data describing an entity with both magnitude and direction. To set or obtain information about a Vector object, use the following properties:

Properties

Application

Parent

X

Y

Z


View object

The View object defines a representation of a drawing or a portion of a drawing from a specific viewpoint in three-dimensional space. To access the View object, use the following methods and properties:

Methods | Properties
Delete | Application
GetXdata | Center
SetXData | Direction
 | Document
 | Handle
 | Height
 | LensLength
 | Mode
 | Name
 | ParentTwistAngle
 | Width


Viewport object

The Viewport object represents a window that displays all or part of a drawing's model space. To access the Viewport object, use the following methods and properties:

Methods | Properties
Delete | Application
GetGridSpacing | Center
GetSnapSpacing | Direction
GetXdata | Document
SetGridSpacing | GridOn
SetSnapSpacing | Handle
SetView | Height
SetXData | LowerLeftCorner
Split | Name
ZoomAll | OrthoOn
ZoomCenter | Parent
ZoomExtents | SnapBasePoint
ZoomPickWindow | SnapOn
ZoomScaled | SnapRotationAngle
ZoomWindow | Target
 | UCSIcon
 | UCSIconAtOrigin
 | UpperRightCorner
 | Width


Viewports collection object

The Viewports collection object is the collection of all viewports in a drawing. To access the Viewports collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Views collection object

The Views collection object is the collection of all views in a drawing. To access the Views collection object, use the following methods and properties:

Methods | Properties
Add | Application
Item | Count
 | Parent


Window object

The Window object represents an open window in an IntelliCAD session. To access the Window object, use the following methods and properties:

Methods | Properties
Activate | Application
Close | Caption
GetWindowRect | Document
Scroll | Parent
SetWindowRect | Visible
 | WindowHandle32
 | WindowState


Windows collection object

The Windows collection object is the collection of all open windows. To access the Windows collection object, use the following methods and properties:

Methods | Properties
Add | Application
Arrange | Count
CloseAll | Parent
Item |


Workspace object

The Workspace object contains certain settings for the space used for working with drawing information. Types of workspaces are paper space and model space. Access these settings with the following properties:

Methods | Properties
ActiveDocument | AddinRun
Application | BeforeExit
Name | Exit
Parent | New
 | Startup


Dim3PointAngular object

A dimension measuring the angular distance between three points. To create a 3-point angular dimension, use the AddDim3PointAngular method. To access the Dim3PointAngular object, use the following methods and properties:

Methods | Properties
ArrayPolar | AngleFormat
ArrayRectangular | AngleVertex
Copy | Application
Delete | Arrowhead1Block
Erase | Arrowhead1Type
GetBoundingBox | Arrowhead2Block
GetXdata | Arrowhead2Type
Highlight | ArrowheadSize
IntersectWith | Color
Mirror | DecimalSeparator
Mirror3D | DimensionLineColor
Move | DimLine1Suppress
Rotate | DimLine2Suppress
Rotate3D | DimLineInside
ScaleEntity | Document
SetXData | EntityName
TransformBy | EntityType
Update | ExtensionLineColor
 | ExtensionLineExtend
 | ExtensionLineOffset
 | ExtLine1EndPoint
 | ExtLine1StartPoint
 | ExtLine1Suppress
 | ExtLine2EndPoint
 | ExtLine2StartPoint
 | ExtLine2Suppress
 | Fit
 | ForceLineInside
 | Handle
 | Highlight
 | HorizontalTextPosition
 | Layer
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | Rotation
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimAligned object

A linear dimension displayed along a line parallel with a line connecting two points. To create an aligned dimension, use the AddDimAligned method. To access the DimAligned object, use the following methods and properties:

Methods | Properties
ArrayPolar | AltRoundDistance
ArrayRectangular | AltSuppressLeadingZeroes
Copy | AltSuppressTrailingZeroes
Delete | AltSuppressZeroFeet
Erase | AltSuppressZeroInches
GetBoundingBox | AltTextPrefix
GetXdata | AltTextSuffix
Highlight | AltTolerancePrecision
IntersectWith | AltToleranceSuppressLeadingZeroes
Mirror | AltToleranceSuppressTrailingZeroes
Mirror3D | AltToleranceSuppressZeroFeet
Move | AltToleranceSuppressZeroInches
Rotate | AltUnits
Rotate3D | AltUnitsFormat
ScaleEntity | AltUnitsPrecision
SetXData | AltUnitsScale
TransformBy | Application
Update | Arrowhead1Block
 | Arrowhead1Type
 | Arrowhead2Block
 | Arrowhead2Type
 | ArrowheadSize
 | Color
 | DecimalSeparator
 | DimensionLineColor
 | DimLine1Suppress
 | DimLine2Suppress
 | DimLineInside
 | Document
 | EntityName
 | EntityType
 | ExtensionLineColor
 | ExtensionLineExtend
 | ExtensionLineOffset
 | ExtLine1EndPoint
 | ExtLine1StartPoint
 | ExtLine1Suppress
 | ExtLine2EndPoint
 | ExtLine2StartPoint
 | ExtLine2Suppress
 | Fit
 | ForceLineInside
 | FractionFormat
 | Handle
 | HorizontalTextPosition
 | Layer
 | LinearScaleFactor
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | PrimaryUnitsPrecision
 | RoundDistance
 | Rotation
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | SuppressZeroFeet
 | SuppressZeroInches
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimAngular object

A dimension measuring the angular distance between two lines or between the angle of a circular arc. To create an angular dimension, use the AddDimAngular method. To access the Dim3PointAngular object, use the following methods and properties:

Methods | Properties
ArrayPolar | AngleFormat
ArrayRectangular | Application
Copy | Arrowhead1Block
Delete | Arrowhead1Type
Erase | Arrowhead2Block
GetBoundingBox | Arrowhead2Type
GetXdata | ArrowheadSize
Highlight | Color
IntersectWith | DecimalSeparator
Mirror | DimensionLineColor
Mirror3D | DimLine1Suppress
Move | DimLine2Suppress
Rotate | DimLineInside
Rotate3D | Document
ScaleEntity | EntityName
SetXData | EntityType
TransformBy | ExtensionLineColor
Update | ExtensionLineExtend
 | ExtensionLineOffset
 | ExtLine1EndPoint
 | ExtLine1StartPoint
 | ExtLine1Suppress
 | ExtLine2EndPoint
 | ExtLine2StartPoint
 | ExtLine2Suppress
 | Fit
 | ForceLineInside
 | Handle
 | Highlight
 | HorizontalTextPosition
 | Layer
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | Rotation
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimDiametric object

A dimension measuring the diameter of a circle. To create a diametric dimension, use the AddDimDiametric method. To access the DimDiametric object, use the following methods and properties:

Methods | Properties
ArrayPolar | AltRoundDistance
ArrayRectangular | AltSuppressLeadingZeroes
Copy | AltSuppressTrailingZeroes
Delete | AltSuppressZeroFeet
Erase | AltSuppressZeroInches
GetBoundingBox | AltTextPrefix
GetXdata | AltTextSuffix
Highlight | AltTolerancePrecision
IntersectWith | AltToleranceSuppressLeadingZeroes
Mirror | AltToleranceSuppressTrailingZeroes
Mirror3D | AltToleranceSuppressZeroFeet
Move | AltToleranceSuppressZeroInches
Rotate | AltUnits
Rotate3D | AltUnitsFormat
ScaleEntity | AltUnitsPrecision
SetXData | AltUnitsScale
TransformBy | Application
Update | Arrowhead1Block
 | Arrowhead1Type
 | Arrowhead2Block
 | Arrowhead2Type
 | ArrowheadSize
 | Color
 | DecimalSeparator
 | DimensionLineColor
 | DimLine1Suppress
 | DimLine2Suppress
 | Document
 | EntityName
 | EntityType
 | ExtensionLineOffset
 | Fit
 | FractionFormat
 | ForceLineInside
 | Handle
 | HorizontalTextPosition
 | Layer
 | LeaderLength
 | LinearScaleFactor
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | PrimaryUnitsPrecision
 | RoundDistance
 | Rotation
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | SuppressZeroFeet
 | SuppressZeroInches
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimOrdinate object

A linear dimension measuring the absolute X or Y position of a point from the origin. To create an ordinate dimension, use the AddDimOrdinate method. To access the DimOrdinate object, use the following methods and properties:

Methods | Properties
ArrayPolar | AltRoundDistance
ArrayRectangular | AltSuppressLeadingZeroes
Copy | AltSuppressTrailingZeroes
Delete | AltSuppressZeroFeet
Erase | AltSuppressZeroInches
GetBoundingBox | AltTextPrefix
GetXdata | AltTextSuffix
Highlight | AltTolerancePrecision
IntersectWith | AltToleranceSuppressLeadingZeroes
Mirror | AltToleranceSuppressTrailingZeroes
Mirror3D | AltToleranceSuppressZeroFeet
Move | AltToleranceSuppressZeroInches
Rotate | AltUnits
Rotate3D | AltUnitsFormat
ScaleEntity | AltUnitsPrecision
SetXData | AltUnitsScale
TransformBy | Application
Update | ArrowheadSize
 | Color
 | DecimalSeparator
 | Document
 | EntityName
 | EntityType
 | ExtensionLineColor
 | ExtensionLineOffset
 | FractionFormat
 | Handle
 | Layer
 | LinearScaleFactor
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | PrimaryUnitsPrecision
 | Rotation
 | RoundDistance
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | SuppressZeroFeet
 | SuppressZeroInches
 | TextColor
 | TextGap
 | TextHeight
 | TextMovement
 | TextOverride
 | TextPosition
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimRadial object

A dimension measuring the radius of a circle or arc. To create a radial dimension, use the AddDimRadial method. To access the DimRadial object, use the following methods and properties:

Methods | Properties
ArrayPolar | AltRoundDistance
ArrayRectangular | AltSuppressLeadingZeroes
Copy | AltSuppressTrailingZeroes
Delete | AltSuppressZeroFeet
Erase | AltSuppressZeroInches
GetBoundingBox | AltTextPrefix
GetXdata | AltTextSuffix
Highlight | AltTolerancePrecision
IntersectWith | AltToleranceSuppressLeadingZeroes
Mirror | AltToleranceSuppressTrailingZeroes
Mirror3D | AltToleranceSuppressZeroFeet
Move | AltToleranceSuppressZeroInches
Rotate | AltUnits
Rotate3D | AltUnitsFormat
ScaleEntity | AltUnitsPrecision
SetXData | AltUnitsScale
TransformBy | Application
Update | ArrowheadBlock
 | ArrowheadSize
 | ArrowheadType
 | CenterMarkSize
 | CenterType
 | Color
 | DecimalSeparator
 | DimensionLineColor
 | DimLineSuppress
 | Document
 | EntityName
 | EntityType
 | ExtensionLineOffset
 | Fit
 | ForceLineInside
 | FractionFormat
 | Handle
 | HorizontalTextPosition
 | Layer
 | LeaderLength
 | LinearScaleFactor
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | PrimaryUnitsPrecision
 | Rotation
 | RoundDistance
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | SuppressZeroFeet
 | SuppressZeroInches
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


DimRotated object

A dimension measuring the radius of a circle or arc. To create a radial dimension, use the AddDimRadial method. To access the DimRadial object, use the following methods and properties:

Methods | Properties
ArrayPolar | AltRoundDistance
ArrayRectangular | AltSuppressLeadingZeroes
Copy | AltSuppressTrailingZeroes
Delete | AltSuppressZeroFeet
Erase | AltSuppressZeroInches
GetBoundingBox | AltTextPrefix
GetXdata | AltTextSuffix
Highlight | AltTolerancePrecision
IntersectWith | AltToleranceSuppressLeadingZeroes
Mirror | AltToleranceSuppressTrailingZeroes
Mirror3D | AltToleranceSuppressZeroFeet
Move | AltToleranceSuppressZeroInches
Rotate | AltUnits
Rotate3D | AltUnitsFormat
ScaleEntity | AltUnitsPrecision
SetXData | AltUnitsScale
TransformBy | Application
Update | Arrowhead1Block
 | Arrowhead1Type
 | Arrowhead2Block
 | Arrowhead2Type
 | ArrowheadSize
 | Color
 | DecimalSeparator
 | DimensionLineColor
 | DimensionLineExtend
 | DimLine1Suppress
 | DimLine2Suppress
 | DimLineInside
 | Document
 | EntityName
 | EntityType
 | ExtensionLineColor
 | ExtensionLineExtend
 | ExtensionLineOffset
 | ExtLine1Suppress
 | ExtLine2Suppress
 | Fit
 | FractionFormat
 | ForceLineInside
 | Handle
 | HorizontalTextPosition
 | Layer
 | LinearScaleFactor
 | Linetype
 | LinetypeScale
 | Measurement
 | Normal
 | Parent
 | PrimaryUnitsPrecision
 | RoundDistance
 | Rotation
 | ScaleFactor
 | StyleName
 | SuppressLeadingZeroes
 | SuppressTrailingZeroes
 | SuppressZeroFeet
 | SuppressZeroInches
 | TextColor
 | TextGap
 | TextHeight
 | TextInside
 | TextInsideAlign
 | TextMovement
 | TextOutsideAlign
 | TextOverride
 | TextPosition
 | TextPrecision
 | TextPrefix
 | TextRotation
 | TextString
 | TextStyle
 | TextSuffix
 | ToleranceDisplay
 | ToleranceHeightScale
 | ToleranceJustification
 | ToleranceLowerLimit
 | TolerancePrecision
 | ToleranceSuppressLeadingZeroes
 | ToleranceSuppressTrailingZeroes
 | ToleranceSuppressZeroFeet
 | ToleranceSuppressZeroInches
 | ToleranceUpperLimit
 | UnitsFormat
 | VerticalTextPosition
 | Visible


Activate method

Activates the first window associated with the document.

Syntax

Sub Activate()

Examples ...

Activate method example


Add method

Creates a member object and adds it to the appropriate collection. The syntax varies depending on which object is being created.

Syntax

For the following collection objects: DimensionStyles, Layers, Linetypes, SelectionSets, TextStyles, Views, and Viewports, use the following syntax:

objectVariable = object.Add(Name)

For the Blocks collection object:

objectVariable = object.Add(InsertionPoint,Name)

For the UCSs collection object:

objectVariable = object.Add(Origin, XAxisPoint, YAxisPoint, Name)

Where:

Name is a string representing the name of the object to be created;

InsertionPoint is a Point object representing the coordinates where the Blocks Collection object will be added;

Origin is a Point object representing the coordinates where the UCS will be added;

Xaxis and Yaxis are Vector objects representing the respective axes of the UCS.

Examples ...

InsertBlock method example


Add3dFace method

Creates a 3D face object and adds it to the drawing. Input parameters are: default (Null) or three to four vertices; the fourth vertex is optional.

Syntax

object.Add3DFace(Point1, Point2, Point3, Point4)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Point1, Point2, Point3, and Point4 are Point objects specifying locations of the 3DFace corners.

Examples ...

Add3dFace method example


Add3dFace method example

Private Sub Add3dFaceExample()

' This example creates and adds a 3D face to the drawing.

Dim faceObj As IntelliCAD.Face3D

Dim icadDoc As IntelliCAD.Document

Dim Pt1 As IntelliCAD.Point

Dim Pt2 As IntelliCAD.Point

Dim Pt3 As IntelliCAD.Point

Dim Pt4 As IntelliCAD.Point

Dim myObj As Object

Set icadDoc = ActiveDocument

' Define the four coordinates of the face

Set Pt1 = Library.CreatePoint(0, 0, 0)

Set Pt2 = Library.CreatePoint(3, 0, 2)

Set Pt3 = Library.CreatePoint(6, 5, 0)

Set Pt4 = Library.CreatePoint(4, 4, 2)

' Add the 3DFace object

Set faceObj = icadDoc.ModelSpace.Add3DFace(Pt1, Pt2, Pt3, Pt4)

faceObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


Add3DMesh method

Adds a 3DMesh given the coordinates and mesh information.

Syntax

objectVariable = object.Add3DMesh(M, N, Vertices)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

M and N are Long integer variables representing the size of the mesh (the dimensions of the point array);

Vertices are a series of Point objects specifying coordinate locations for each vertex of the mesh;

You can also input the number of vertices in each direction and their coordinates.


Add3dPoly method

Creates a 3D polyline and adds it to the drawing. Input parameters are vertices for the polyline.

Syntax

object.Add3DPoly(Vertices)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Vertices are a series of Point objects specifying coordinate locations for each polyline vertex.

Examples ...

Add3dPoly method example


Add3dPoly method example

Private Sub 3DPolyline_Example()

Dim myDoc As IntelliCAD.Document

Dim myPline3D As Polyline3D

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(7, 2, 3)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(9, 8, 7)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline3D = ThisDocument.ModelSpace.Add3DPolyline(myPoints)

myPline3D.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddArc method

Creates a new arc object and adds it to the drawing.

Syntax

objectVariable = object.AddArc(Center, Radius, StartAngle, EndAngle)

Where:

objectVariable is an Arc object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object representing the center of the arc;

Radius is a double-precision variable or number representing the radius of the arc;

StartAngle and EndAngle are double-precision variables or numbers representing the starting and ending angles of the arc.

Examples ...

AddArc method example


AddArc method example

Private Sub AddArcExample()

' This example adds an arc to the drawing using the AddArc method.

Dim icadDoc As Document

Dim myArc As Arc

Dim cenPt As Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Arc created w/ center point at 4,2."

End Sub


AddBox method

Adds a box given the origin, length, width and height. The box is drawn as a polygon mesh.

Syntax

objectVariable = object.AddBox(Origin, Length, Width, Height)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Origin is a Point object identifying the origin of the box;

Length is a double-precision variable representing the length of the box;

Width is a double-precision variable representing the width of the box;

Height is a double-precision variable representing the height of the box;

Examples ...

AddBox method example


AddBox method example

Private Sub AddBox_Example()

' This example adds a box to the drawing using the AddBox method.

Dim myDoc As IntelliCAD.Document

Dim boxObj As IntelliCAD.PolygonMesh

Dim pt As Point

Set myDoc = ActiveDocument

Set pt = Library.CreatePoint(1, 1, 0)

Set boxObj = ThisDocument.ModelSpace.AddBox(pt, 3, 3, 4)

boxObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddAttributeDef method

Adds an Attribute Definition at the given insertion point and other attribute information.

Syntax

objectVariable = object.AddAttributeDef(Height, Mode, Prompt, InsertionPoint, Tag, Value)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Height is a double-precision variable representing the height (in drawing units) of the attribute text.

Mode is one of the following attribute modes:

vicAttributeModeNormal

vicAttributeModeInvisible

vicAttributeModeConstant

vicAttributeModeVerify

vicAttributeModePreset

Prompt is a string variable representing the text to be displayed to the user;

InsertionPoint is a Point object representing the location of the attribute;

Tag is a string variable identifying each occurrence of the attribute;

Value is a string variable representing the default value of the attribute.


AddCircle method

Creates a new circle and adds it to the drawing.

Syntax

objectVariable = object.AddCircle(Center, Radius)

Where:

objectVariable is a Circle object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object representing the center of the circle;

Radius is a double-precision variable or number representing the radius of the circle.

Examples ...

AddCircle method example


AddCircle method example

Private Sub AddCircleExample()

' This example creates a circle with a radius of 4 and adds it to the

'drawing using the AddCircle method.

Dim icadDoc As IntelliCAD.Document

Dim icadCircle As IntelliCAD.Circle

Dim cenPt As IntelliCAD.Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(1, 2)

'Add the circle to the .dwg

Set icadCircle = icadDoc.ModelSpace.AddCircle(cenPt, 4)

' Display the entity

icadCircle.Update

MsgBox "Circle created w/ center point at 1,2."

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddCone method

Adds a cone given the center, base radius, and height. The cone is drawn as a polygon mesh.

Syntax

objectVariable = object.AddCone(Center, BaseRadius, Height)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object identifying the center of the cone;

BaseRadius is a double-precision variable representing the radius of the cone at its base;

Height is a double-precision variable representing the height of the cone.

Examples ...

AddCone method example


AddCone method example

Private Sub AddCone_Example()

' This example adds a cone to the drawing using the AddCone method.

Dim myDoc As IntelliCAD.Document

Dim coneObj As IntelliCAD.PolygonMesh

Dim pt As Point

Set myDoc = ActiveDocument

Set pt = Library.CreatePoint(2, 2, 0)

Set coneObj = ThisDocument.ModelSpace.AddCone(pt, 3, 4)

coneObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddCylinder method

Adds a cylinder given the center, base radius, and height. The cylinder is drawn as a polygon mesh.

Syntax

objectVariable = object.AddCylinder(Center, Radius, Height)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object identifying the center of the cylinder;

Radius is a double-precision variable representing the radius of the cylinder;

Height is a double-precision variable representing the height of the cylinder.

Examples ...

AddCylinder method example


AddCylinder method example

Private Sub AddCylinder_Example()

' This example adds a cylinder to the drawing using the AddCylinder method.

Dim myDoc As IntelliCAD.Document

Dim cylObj As IntelliCAD.PolygonMesh

Dim pt As Point

Set myDoc = ActiveDocument

Set pt = Library.CreatePoint(2, 2, 0)

Set cylObj = ThisDocument.ModelSpace.AddCylinder(pt, 3, 5)

cylObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddDimAligned method

Adds an Aligned dimension object.

Syntax

objectVariable = object.AddDimAligned(ExtPoint1, ExtPoint2, TextLocation)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

ExtPoint1 is a Point object identifying the first endpoint of the extension line;

ExtPoint2 is a Point object identifying the second endpoint of the extension line;

TextLocation is a Point object identifying the location of the text.


AddDim3PointAngular method

Adds a 3 Point Angular dimension object.

Syntax

objectVariable = object.AddDim3PointAngular(AngleVertex, FirstEndPoint, SecondEndPoint, TextLocation)

Where:

AngleVertex is a Point object identifying the center of the circle or arc, or the common vertex between the two dimensioned lines;

FirstEndPoint is a Point object identifying the point through which the first extension line passes;

SecondEndPoint is a Point object identifying the point through which the second extension line passes;

TextLocation is a Point object identifying the location of the text.


AddDimAngular method

Adds an Angular dimension object.

Syntax

objectVariable = object.AddDimAngular(AngleVertex, FirstEndPoint, SecondEndPoint, TextLocation)

Where:

AngleVertex is a Point object identifying the center of the circle or arc, or the common vertex between the two dimensioned lines;

FirstEndPoint is a Point object identifying the point through which the first extension line passes;

SecondEndPoint is a Point object identifying the point through which the second extension line passes;

TextLocation is a Point object identifying the location of the text.


AddDimDiametric method

Adds a Diameter dimension object.

Syntax

objectVariable = object.AddDimDiametric(ChordPoint, FarChordPoint, LeaderLength)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

ChordPoint is a Point object identifying the first diameter point on the circle or arc;

FarChordPoint is a Point object identifying the second diameter point on the circle or arc;

LeaderLength is a double-precision variable specifying the length from the ChordPoint to the annotation text or dogleg.


AddDimOrdinate method

Adds an Ordinate dimension object.

Syntax

Function AddDimOrdinate(DefintionPoint, LeaderEndPoint, UseXAxis)

Where:

DefinitionPoint is a Point object identifying the point to be dimensioned;

LeaderEndPoint is a Point object identifying the endpoint of the leader, where the dimension text is displayed;

UseXAxis is a Boolean value specifying whether or not to display the X-axis value;

TRUE: Creates an ordinate dimension displaying the X-axis value;

FALSE: Creates an ordinate dimension displaying the Y-axis value.


AddDimRadial method

Adds a Radius dimension object.

Syntax

objectVariable = object.AddDimRadial(Center, ChordPoint, LeaderLength)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object identifying the center point on the arc;

ChordPoint is a Point object identifying the point on the circle or arc to attach the leader line;

LeaderLength is a double-precision variable specifying the length from the ChordPoint to the annotation text or dogleg.


AddDimRotated method

Adds a Rotated dimension object.

Syntax

objectVariable = object.AddDimRotated(ExtPoint1, ExtPoint2, DimLineLocation, Rotation)

Where:

ExtPoint1 is a Point object identifying the first endpoint of the extension line;

ExtPoint2 is a Point object identifying the second endpoint of the extension line;

DimLineLocation is a Point object identifying a point on the dimension line;

Rotation is a double-precision angle, in radians, of rotation displaying the linear dimension.


AddEllipse method

Creates a new ellipse and adds it to the drawing.

Syntax

objectVariable = object.AddEllipse(Center, MajorAxis, RadiusRatio)

Where:

objectVariable is an Ellipse object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object representing the center of the ellipse;

MajorAxis is a Vector object representing the orientation of the major axis (the line which defines the longest distance across an ellipse, from one end to the other);

RadiusRatio is a double-precision variable or number defining the major to minor axis ratio of an ellipse. A radius ratio of 1.0 defines a circle.

Examples ...

AddEllipse method example


AddEllipse method example

Private Sub AddEllipseExample()

' This example creates an ellipse and adds it to the drawing using the

' AddEllipse method.

Dim icadDoc As Document

Dim myEllipse As Ellipse

Dim Pt1 As Point

Dim Vect1 As Vector

Set icadDoc = ActiveDocument

Set Pt1 = Library.CreatePoint(3, 4)

Set Vect1 = Library.CreateVector(0, 0, 0, 1, 1, 0)

Set myEllipse = icadDoc.ModelSpace.AddEllipse(Pt1, Vect1, 4)

'Add the ellipse to the .dwg

' Display the entity

myEllipse.Update

MsgBox "Ellipse created w/ major/minor axis ratio of 4."

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddFitPoint method

Adds a fit point to the spline.

Syntax

object.AddFitPoint(Index, FitPoint)

Where:

object is an IntelliCAD Spline object;

Index is a Long Integer variable (or value) identifying the position in which to add the fit point. If the index is a negative number, then the point is added to the beginning of the spline. If the index exceeds the number of fit points in the spline, then the point is added to the end of the spline.

FitPoint is the IntelliCAD Point object to be added.


AddHatch method

Creates a new hatch object and adds it to the drawing.

Syntax

objectVariable = object.AddHatch(PatternType, PatternName)

Where:

objectVariable is a Hatch object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

PatternType is a Long integer representing one of the following HatchType constants:

0 PreDefinedHatchPattern

1 UserDefinedHatchPattern

2 CustomDefinedHatchPattern

PatternName is a String representing the name of the hatch pattern to be used.


AddImage method

Adds a raster image to the drawing.

Syntax

objectVariable = object.AddImage(ImageFile, [InsertionPoint, ScaleFactor, RotationAngle])

Where:

ImageFile is a string representing the full path and file name of the image;

InsertionPoint is a Point object identifying the point at which the image will be inserted;

ScaleFactor is a double-precision variable (or value) representing the raster image scale factor. The default image scale factor is 1. The scale factor must be a positive number.

RotationAngle is a double-precision variable (or value) representing the rotation angle in radians for the raster image.

Examples ...

AddImage method example


AddInfiniteLine method

Creates a new infinite line and adds it to the drawing.

Syntax

objectVariable = object.AddInfiniteLine(Point1, Point2)

Where:

objectVariable is an InfiniteLine object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Point1 is a Point object representing one point on the line;

Point2 is a Point object representing a second point on the line.

Examples ...

AddInfiniteLine method example


AddInfiniteLine method example

Private Sub InfiniteLineExample()

' This example creates an infinite line and adds it to the drawing using the

' AddInfiniteLine method.

Dim myDoc As IntelliCAD.Document

Dim myInfline As IntelliCAD.InfiniteLine

Dim Pt1 As IntelliCAD.Point

Dim Pt2 As IntelliCAD.Point

Set myDoc = ActiveDocument

Set Pt1 = Library.CreatePoint(2, 2)

Set Pt2 = Library.CreatePoint(1, 3)

Set myInfline = myDoc.ModelSpace.AddInfiniteLine(Pt1, Pt2)

myInfline.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddItems method

Adds a group of entities to a block or selection set.

Syntax

object.AddItems(Entities, [DeleteOriginals])

Where:

object is a Block or SelectionSet object;

Entities is a selection set object to which the items are to be added;

DeleteOriginals is a Boolean variable (or value) indicating whether or not to delete the original objects.

TRUE = Objects will be deleted.

FALSE = Objects will not be deleted.

Examples ...

AddItems method example


AddItems method example

Private Sub AddItems_Example()

' This example creates a selection set, and a line and circle objects.

' It then adds the objects to the selection set and clears the set.

Dim ssetObj As IntelliCAD.SelectionSet

Dim I As Integer

Dim lineObj As IntelliCAD.Line

Dim startPoint As IntelliCAD.Point

Dim endPoint As IntelliCAD.Point

Dim circObj As IntelliCAD.Circle

Dim centerPt As IntelliCAD.Point

Dim radius As Double

Dim ssetName

ssetName = InputBox("Type a name for the selection set:")

Set ssetObj = ThisDocument.SelectionSets.Add(ssetName)

' Create a line object in model space

Set startPoint = Library.CreatePoint(3, 1, 0)

Set endPoint = Library.CreatePoint(5, 5, 0)

Set lineObj = ThisDocument.ModelSpace.AddLine(startPoint, endPoint)

' Create a circle object in model space

Set centerPt = Library.CreatePoint(3, 1, 0)

radius = 5

Set circObj = ThisDocument.ModelSpace.AddCircle(centerPt, radius)

' Collect the objects into an array of objects

' to be added to the selection set.

ReDim ssobjs(1 To ThisDocument.ModelSpace.Count) As IntelliCAD.Entity

For I = 1 To ThisDocument.ModelSpace.Count

Set ssobjs(I) = ThisDocument.ModelSpace.Item(I)

Next I

' Add the array of objects to the selection set

ssetObj.AddItems ssobjs

MsgBox "No. of items in sel. set = " & ssetObj.Count

ssetObj.Clear

MsgBox "No. of items in sel. set (after clearing) = " & ssetObj.Count

End Sub


AddLeader method

Creates a leader and adds it to the drawing.

Syntax

objectVariable = object.AddLeader(Points, Annotation, type)

Where:

objectVariable is a Leader object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Points is a collection of points defining the leader line;

Annotation is a String of text or a dimension to be associated with the leader;

type is a Long integer representing one of the following LeaderType constants:

0 LeaderLineWithNoArrow

1 LeaderLineWithArrow

Examples ...

AddLeader method example


AddLeader method example

Private Sub Leader_Example()

' This example adds a point entity to the drawing using the AddLeader

' method. A type 2 leader (line w/ arrow is used).

Dim myDoc As IntelliCAD.Document

Dim myLeader As Leader

Dim myPoints As Points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(3, 4, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myLeader = ThisDocument.ModelSpace.AddLeader(myPoints, "testldr", 2)

myLeader.Update

End Sub


AddLightWeightPolyline method

Creates a lightweight polyline and adds it to the drawing.

Syntax

objectVariable = object.AddLightWeightPolyline(Vertices)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Vertices are a series of Point objects specifying coordinate locations for each polyline vertex.

Examples ...

AddLightWeightPolyline method example


AddLightWeightPolyline method example

Private Sub AddLWP_Example()

' This example adds a lightweight polyline to the drawing.

Dim myDoc As IntelliCAD.Document

Dim myPline As IntelliCAD.LWPolyline

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 1, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(3, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddLine method

Creates a line and adds it to the drawing.

Syntax

objectVariable = object.AddLine(StartPoint, EndPoint)

Where:

objectVariable is a Line object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

StartPoint is a Point object representing the starting point of the line;

EndPoint is a Point object representing the ending point of the line.

Examples ...

AddLine method example


AddLine method example

Private Sub AddLineExample()

' This example creates a line and adds it to the drawing using the AddLine

' method. It then uses the Redraw method to update the screen.

Dim myDoc As IntelliCAD.Document

Dim myLine As IntelliCAD.Line

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

myLine.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Line created from 4,4 to 7,1."

' ' The following lines demonstrate another way to create the line.

' Dim myStartPt As IntelliCAD.Point

' Dim myEndPt As IntelliCAD.Point

' Set myStartPt = Library.CreatePoint(4, 4)

' Set myEndPt = Library.CreatePoint(7, 1)

' Set myLine = myDoc.ModelSpace.AddLine(myStartPt, myEndPt)

End Sub


AddMtext method

Creates an Mtext (multi-line text) object and adds it to the drawing.

Syntax

objectVariable = object.AddMtext(InsertionPoint, Width, Text)

Where:

objectVariable is an Mtext object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

InsertionPoint is a Point object representing the location to insert the text;

Width is a double-precision variable or number representing the width of the bounding box;

Text is a String representing the text to appear in the window.

Examples ...

AddMtext method example


AddMtext method example

Private Sub AddMtextExample()

' This example creates Mtext and adds it to the drawing using the

' AddMtext method.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim mtextObj As IntelliCAD.MText

Dim corner As IntelliCAD.Point

Dim width As Double

Set icadDoc = ActiveDocument

Set corner = Library.CreatePoint(0, 9)

width = 10

myText = "Test string for the AddMtext method"

' Add the mtext Object

Set mtextObj = icadDoc.ModelSpace.AddMText(corner, width, myText)

mtextObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddPointEntity method

Creates a point entity and adds it to the drawing.

Syntax

objectVariable = object.AddPointEntity(Point)

Where:

objectVariable is a PointEntity object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Point is a Point object representing the location to insert the PointEntity.

Examples ...

AddPointEntity method example


AddPointEntity method example

Private Sub AddPointEntityExample()

' This example adds a point entity to the drawing using the AddPointEntity ' method.

Dim icadDoc As IntelliCAD.Document

Dim myPoint As IntelliCAD.Point

Dim myPtEnt As IntelliCAD.PointEntity

Set icadDoc = ActiveDocument

Set myPoint = Library.CreatePoint(4, 2)

Set myPtEnt = icadDoc.ModelSpace.AddPointEntity(myPoint)

myPtEnt.Update

MsgBox "Point created at 4,2."

End Sub


AddPolyfaceMesh method

Creates a new polyface mesh object and adds it to the drawing.

Syntax

objectVariable = object.Entities.AddPolyfaceMesh(M, N, Vertices)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

M and N are Long integer variables representing the size of the mesh (the dimensions of the point array);

Vertices are a series of Point objects specifying coordinate locations for each vertex of the mesh.

You can also input the number of vertices in each direction and their coordinates.

Examples ...

AddPolyfaceMesh method example


AddPolyfaceMesh method example

Private Sub AddPolyfaceMeshExample()

' This example creates and adds a polyface mesh to the drawing.

Dim faceObj As IntelliCAD.PolyfaceMesh

Dim icadDoc As IntelliCAD.Document

Dim Pt1 As IntelliCAD.Point

Dim Pt2 As IntelliCAD.Point

Dim Pt3 As IntelliCAD.Point

Dim Pt4 As IntelliCAD.Point

Dim myPoints As Points

Dim myObj As Object

Set icadDoc = ActiveDocument

' Define the four coordinates of the face

Set myPoints = Library.CreatePoints

Set Pt1 = Library.CreatePoint(0, 0, 0)

myPoints.Add

myPoints(myPoints.Count).x = Pt1.x

myPoints(myPoints.Count).y = Pt1.y

myPoints(myPoints.Count).z = Pt1.z

Set Pt2 = Library.CreatePoint(3, 0, 2)

myPoints.Add

myPoints(myPoints.Count).x = Pt2.x

myPoints(myPoints.Count).y = Pt2.y

myPoints(myPoints.Count).z = Pt2.z

Set Pt3 = Library.CreatePoint(6, 5, 0)

myPoints.Add

myPoints(myPoints.Count).x = Pt3.x

myPoints(myPoints.Count).y = Pt3.y

myPoints(myPoints.Count).z = Pt3.z

Set Pt4 = Library.CreatePoint(4, 4, 2)

myPoints.Add

myPoints(myPoints.Count).x = Pt4.x

myPoints(myPoints.Count).y = Pt4.y

myPoints(myPoints.Count).z = Pt4.z

' Add the 3DFace object

Set faceObj = icadDoc.ModelSpace.AddPolyfaceMesh(myPoints)

' DEFINE ADDITIONAL FACE INFO HERE

faceObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddPolyline method

Creates a polyline and adds it to the drawing.

Syntax

objectVariable = object.AddPolyline(Vertices)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Vertices are a series of Point objects specifying coordinate locations for each polyline vertex.

Examples ...

AddPolyline method example


AddPolyline method example

Private Sub Polyline_Example()

' This example adds a polyline to the drawing using the AddPolyline method.

Dim myDoc As IntelliCAD.Document

Dim myPline As Polyline

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 1, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(3, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddPViewport method

Adds a Paperspace Viewport given the center, width and height.

Syntax

objectVariable = object.AddPViewport([Center], [Width], [Height])

where:

Center is a Point object specifying the coordinate location for viewport center;

Width and Height are double-precision variables representing the dimensions of the viewport.

Examples ...

Add PViewport method example


AddRay method

Creates a ray and adds it to the drawing.

Syntax

objectVariable = object.AddRay(Point1, Point2)

Where:

objectVariable is a Ray object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Point1 is a Point object representing the starting point of the ray;

Point2 is a Point object representing the second point of the ray.

Examples ...

AddRay method example


AddRay method example

Private Sub AddRayExample()

' This example creates a ray and adds it to the drawing using the AddRay

' method.

Dim myDoc As IntelliCAD.Document

Dim myRay As IntelliCAD.Ray

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Set myDoc = ActiveDocument

Set myStartPt = Library.CreatePoint(3, 3)

Set myEndPt = Library.CreatePoint(7, 4)

Set myRay = myDoc.ModelSpace.AddRay(myStartPt, myEndPt)

myRay.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddSolid method

Adds a two-dimensional solid polygon.

Syntax

objectVariable = object.AddSolid([Point1], [Point2], [Point3], [Point4])

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Point1, Point2, etc. are Point objects specifying coordinate locations for each solid vertex.

Examples ...

AddSolid method example


AddSolid method example

Private Sub AddSolid_Example()

Dim solidObj As IntelliCAD.Solid

Dim pt1, pt2, pt3, pt4 As Point

Set myDoc = ActiveDocument

Set pt1 = Library.CreatePoint(1, 1, 0)

Set pt2 = Library.CreatePoint(3, 3, 0)

Set pt3 = Library.CreatePoint(4, 2, 0)

Set pt4 = Library.CreatePoint(3, 1, 0)

' Create the solid object in model space

Set solidObj = ThisDocument.ModelSpace.AddSolid(pt1, pt2, pt3, pt4)

solidObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddSphere method

Adds a sphere given the center point and radius. The sphere object is created as a polygon mesh.

Syntax

objectVariable = object.AddSphere(Center, Radius)

Where:

Center is a Point object representing the center of the sphere;

Radius is a double-precision variable or number representing the radius of the sphere.

Examples ...

AddSphere method example


AddSphere method example

Private Sub AddSphereExample()

'This example adds a sphere to the drawing.

' It then zooms to the extents of the drawing.

Dim myDoc As IntelliCAD.Document

Dim sphereObj As IntelliCAD.PolygonMesh

Dim pt As Point

Set myDoc = ActiveDocument

Set pt = Library.CreatePoint(4, 4, 0)

Set sphereObj = ThisDocument.ModelSpace.AddSphere(pt, 5)

sphereObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddSpline method

Adds a spline object given the input coordinates as a points collection.

Syntax

objectVariable = object.AddSpline(Points, StartTangent, EndTangent)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Points is a collection of points for defining the spline curve.

StartTangent and EndTangent are vector objects indicating the tangents at the two ends of the spline.


AddText method

Creates a text object and adds it to the drawing.

Syntax

objectVariable = object.AddText(TextString, InsertionPoint, Height)

Where:

objectVariable is an Mtext object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

TextString is a String representing the text to place in the drawing;

InsertionPoint is a Point object representing the location to insert the text;

Height is a double-precision variable or number representing the height of the text.

Examples ...

AddText method example


AddText method example

Private Sub AddText_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then zooms to the center of the drawing.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim mtextObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set mtextObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

mtextObj.Update

ThisDocument.ActiveViewport.ZoomCenter insPt, 20

End Sub


AddTolerance method

Creates a Tolerance entity.

Syntax

objectVariable = object.AddTolerance([Text], [InsertionPoint], [Direction])

Where:

objectVariable is an Mtext object;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Text is a String representing the tolerance text;

InsertionPoint is a Point object representing the location to insert the tolerance;

Direction is a Vector object representing the direction of the tolerance symbol.

Examples ...

AddTolerance method example


AddTolerance method example

Private Sub AddTolerance_Example()

' This example creates a tolerance object in model space.

Dim toleranceObj As IntelliCAD.Tolerance

Dim textString As String

Dim insPt As Point

Dim dirVect As Vector

Set insPt = Library.CreatePoint(1, 2)

Set dirVect = Library.CreateVector(0.5, 0.5)

' Define the tolerance object

textString = "Test Tolerance"

' Create the tolerance object in model space

Set toleranceObj = ThisDocument.ModelSpace.AddTolerance(textString, insPt, dirVect)

End Sub


AddTorus method

Adds a torus given the location, torus radius and tube radius. The torus object is created as a polygon mesh.

Syntax

objectVariable = object.AddTorus([Center], [TorusRadius], [TubeRadius])

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Center is a Point object representing the center point of the torus;

TorusRadius is a double-precision variable representing the radius of the torus (distance from center of torus to center of tube);

TubeRadius is a double-precision variable representing the radius of the tube.

Examples ...

AddTorus method example


AddTorus method example

Private Sub AddTorus_Example()

' This example adds a torus to the drawing.

Dim myDoc As IntelliCAD.Document

Dim boxObj As IntelliCAD.PolygonMesh

Dim cenPt As Point

Set myDoc = ActiveDocument

Set cenPt = Library.CreatePoint(1, 1, 0)

Set torusObj = ThisDocument.ModelSpace.AddTorus(cenPt, 4, 2)

torusObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


AddTrace method

Adds a Trace entity given the coordinates as a points collection.

Syntax

objectVariable = object.AddTrace(Points)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Points is a collection of points for defining the trace object.


AddVectors method

Adds two vectors.

Syntax

objectVariable = object.AddVectors(Vector1, Vector2)

Where:

object is the IntelliCAD Library object;

Vector1 and Vector2 are IntelliCAD Vector objects to be added together.

Examples ...

AddVectors method example


AddVectors method example

Private Sub AddVectorsExample()

' This example creates two vectors and adds them together.

' It then subtracts them and displays the result.

Dim icadDoc As IntelliCAD.Document

Set icadDoc = ActiveDocument

Dim Vect1 As Vector

Dim Vect2 As Vector

Dim Vect3 As Vector

Dim Vect4 As Vector

Set Vect1 = Library.CreateVector(0, 0, 0, 1, 1, 0)

Set Vect2 = Library.CreateVector(0, 0, 0, 2, 1, 0)

Set Vect3 = Library.AddVectors(Vect1, Vect2)

Set Vect4 = Library.SubtractVectors(Vect1, Vect2)

MsgBox "Properties of vector sum:" & Chr(13) & Vect3.x & ", " & Vect3.y & ", " & Vect3.z

MsgBox "Properties of vector difference:" & Chr(13) & Vect4.x & ", " & Vect4.y & ", " & Vect4.z

End Sub


AddVertex method

Adds a vertex to a lightweight polyline.

Syntax

Sub AddVertex(Index, Point)

Where:

Index is an Integer variable (or value) defining where the vertex will be added in the lightweight polyline.

Point is an IntelliCAD Point object locating the vertex to be appended.

Examples ...

AddVertex method example


AddVertex method example

Sub AddVertexExample()

' This example creates a light weight polyline in model space.

' It then adds a vertex to the polyline.

Dim myDoc As IntelliCAD.Document

Dim myPline As IntelliCAD.LWPolyline

Dim myPoints As IntelliCAD.points

Dim pt As IntelliCAD.Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(6, 2, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(9, 7, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomAll

Dim newVertex As IntelliCAD.Point

Me.hide

Set newVertex = ThisDocument.Utility.GetPoint(, "Pick a point for a new vertex.")

myPline.AddVertex 2, newVertex

ThisDocument.ActiveViewport.ZoomAll

End Sub


AddWedge method

Adds a Polygon Mesh wedge given the length, width and height.

Syntax

objectVariable = object.AddWedge(Origin, Length, Width, Height)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Origin is a Point object identifying the origin of the wedge;

Length is a double-precision variable representing the length of the wedge;

Width is a double-precision variable representing the width of the wedge;

Height is a double-precision variable representing the height of the wedge;

Examples ...

AddWedge method example


AddWedge method example

Private Sub AddWedge_Example()

' This example adds a wedge to the drawing using the AddWedge method.

Dim myDoc As IntelliCAD.Document

Dim wedgeObj As IntelliCAD.PolygonMesh

Dim origPt As Point

Set myDoc = ActiveDocument

Set origPt = Library.CreatePoint(2, 1, 0)

Set wedgeObj = ThisDocument.ModelSpace.AddWedge(origPt, 3, 2, 2)

wedgeObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


Alert method

Displays an alert box on the screen containing a user specified string.

Syntax

object.Alert(message)

Where:

object is the name of the object to be deleted;

message is a String to be displayed in the alert box.


AngleFromXAxis method

Returns the angle of a line from the X-axis; The angle is measured counterclockwise.

Syntax

object.AngleFromXAxis(Point1, Point2)

Where:

object is the Utility object;

Point1 is the start point of the line;

Point2 is the end point of the line;


AngleToReal method

Converts a string to an angle.

Syntax

object.AngleToReal(Angle, [Unit])

Where:

object is the Utility object;

Angle is a String representation of an angle;

Unit is one of the following AngleUnits to which the string will be converted:

vicDegreeMinuteSeconds = 1

vicDegrees = 0

vicGrads = 2

vicRadians = 3

vicSurveyorUnits = 4


AngleToString method

Converts an angle to a string.

Syntax

object.AngleToString(Angle, [Unit], Precision)

Where:

object is the Utility object;

Angle is a double-precision variable (or value) representing an angle;

Unit is one of the following AngleUnits from which the angle will be converted:

vicDegreeMinuteSeconds = 1

vicDegrees = 0

vicGrads = 2

vicRadians = 3

vicSurveyorUnits = 4

Precision is a Long integer variable (or value) representing the number of decimal places for the angle.


AppendVertex method

Adds a vertex to a polyline, 3D polyline, or polygon mesh.

Syntax

Sub AppendVertex(Vertex)

Where:

Vertex is an IntelliCAD Point object locating the vertex to be appended.

Examples ...

AppendVertex method example


AppendVertex method example

Sub Example_AppendVertex()

' This example creates a polyline in model space and appends a vertex to it.

Dim myDoc As IntelliCAD.Document

Dim myPline As IntelliCAD.Polyline

Dim myPoints As IntelliCAD.points

Dim pt As IntelliCAD.Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(7, 2, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(9, 8, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomAll

Dim newVertex As IntelliCAD.Point

Me.hide

Set newVertex = ThisDocument.Utility.GetPoint(, "Pick a point for a new vertex.")

myPline.AppendVertex newVertex

ThisDocument.ActiveViewport.ZoomAll

End Sub


Apply Matrix method

Applies a transformation matrix to a point, thereby moving, rotating, or otherwise modifying the point.

Syntax

objectVariable = object.ApplyMatrix(Matrix, Point)

Where:

object is the IntelliCAD Library object;

Matrix is an IntelliCAD Matrix object;

Point is an IntelliCAD Point object;


ApplyHatch method

Applies the hatch to the specified objects.

Syntax

object.ApplyHatch(ObjectsToHatch)

Where:

object is the name of the object to be deleted;.

ObjectsToHatch is a SelectionSet object containing the objects to which hatching is applied.


Arrange method

Arranges the windows in the collection.

Syntax

objectVariable = Arrange(Style)

Where:

Style is an IntelliCAD constant indicating the type of arrangement, as follows:

vicArrangeCascade = 3

vicArrangeTileHorizontal = 2

vicArrangeTileVertical = 1


ArrayPolar method

Creates a polar array.

Syntax

objectVariable = object.ArrayRectangular(NumberOfObjects, IncludedAngle, CenterPoint, [PointOnAxis], [RotateObjects])

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

NumberOfObjects is the number of objects in the array;

IncludedAngle is the angle to fill in radians, with a positive value specifiyingc ounterclockwise rotation;

CenterPoint is an IntelliCAD Point object specifying the center point of the polar array;

PointOnAxis is an optional point on the axis of rotation.

RotateObjects is an optional Boolean variable indicating whether to rotate objects or not. The default is False (no rotation).

Examples ...

ArrayPolar method example


ArrayPolar method example

Sub Example_ArrayPolar()

' This example creates a line and a polar array based on that line.

Dim myLine As IntelliCAD.Line

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

myLine.Update

ThisDocument.ActiveViewport.ZoomExtents

Dim noOfObjects As Integer

Dim angleToFill As Double

Dim basePt As IntelliCAD.Point

noOfObjects = 6

angleToFill = 4.72 ' 270 degrees

Set basePt = Library.CreatePoint(4, 2, 0)

' Create 6 copies of an object by rotating and copying it about the point (4,2,0).

Dim retObj As Variant

Set retObj = myLine.ArrayPolar(noOfObjects, angleToFill, basePt)

retObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Polar array constructed."

End Sub


ArrayRectangular method

Creates a rectangular array.

Syntax

objectVariable = object.ArrayRectangular(NumberOfRows, NumberOfColumns, [NumberOfLevels], GapBetweenRows, GapBetweenColumns, [GapBetweenLevels])

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

NumberOfRows is the number of rows (horizontal elements) in the array;

NumberOfColumns is the number of rows (vertical elements) in the array;

NumberOfLevels is the number of levels in a 3D array;

GapBetweenRows is the distance between rows. A positive number causes the array to be built to the right of the source object, while a negative number causes the array to be built to the left.

GapBetweenColumns is the distance between rows. A positive number causes the array to be built upward, while a negative number causes the array to be built downward.

GapBetweenLevels is the distance between levels. A positive number causes the array to be expanded in the positive direction, while a negative number causes the array to be expanded in a negative direction.

Examples ...

ArrayRectangular method example


ArrayRectangular method example

Sub Example_ArrayRectangular()

' This example creates a line and a rectangular array based on that line.

Dim myLine As IntelliCAD.Line

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 2), Library.CreatePoint(7, 2))

myLine.Update

ThisDocument.ActiveViewport.ZoomExtents

' Create a 4x3 array of an object.

Dim retObj As Variant

Set retObj = myLine.ArrayRectangular(4, 3, 1, 3, 2, 2)

retObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Rectangular array constructed."

End Sub


AttachExternalReference method

Attaches a specified drawing as an ExternalReference.

Syntax

objectVariable = object.AttachExternalReference(PathName, [Name], [InsertionPoint], [XScale], [YScale], [Zscale], [Rotation], [bOverlay])

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

PathName is a string representing the full path and file name of the drawing;

Name is a string representing the name of external reference to be created;

InsertionPoint is a Point object representing the point at which the drawing will be inserted;

XScale, YScale, and ZScale are double-precision variables (or values) representing the scaling factors for the drawing along each coordinate plane;

Rotation is a double-precision variable (or value) representing the rotation angle (in radians) for the external reference;

bOverlay is a Boolean variable (or value) indicating whether the reference is an overlay or attachment

TRUE: The xref instance is an overlay.

FALSE: The xref instance is an attachment.

Examples ...

AttachExternalReference method example


AttachExternalReference method example

Private Sub AddXRef_Example()

' This example adds an external reference using the MAP.DWG file

' found in the Samples folder. You may need to change the path and

' filename for your system.

Dim insPt As IntelliCAD.Point

Dim insertedXRef As IntelliCAD.ExternalReference

Dim msg As String, PathName As String, XrefName As String

XrefName = InputBox("Type an XRef name")

Set insPt = Library.CreatePoint(1, 1, 0)

PathName = "c:\program files\IntelliCAD2001\Samples\map.dwg"

' Add the external reference to the drawing

Set insertedXRef = ThisDocument.ModelSpace.AttachExternalReference(PathName, XrefName, insPt, 1, 1, 1, 0, False)

MsgBox "The external reference '" & XrefName & "' is attached."

End Sub


Bind method

Binds an external reference (xref) to a drawing.

Syntax

Sub Bind()


CalculateDistance method

Calculates the distance between two user specified points.

Syntax

objectVariable = object.CalculateDistance(Point1, Point2)

Where:

object is the IntelliCAD Library object;

Point1 and Point2 are IntelliCAD Point objects.

Examples ...

CalculateDistance method example


CalculateDistance method example

Private Sub CalculateDistance_Example()

Dim icadDoc As IntelliCAD.Document

Dim Pt1 As IntelliCAD.Point

Dim Pt2 As IntelliCAD.Point

Dim dist As Double

Set icadDoc = ActiveDocument

Set Pt1 = Library.CreatePoint(0, 0, 0)

Set Pt2 = Library.CreatePoint(2, 2, 0)

dist = Library.CalculateDistance(Pt1, Pt2)

MsgBox "Distance = " & dist

End Sub


Caption property

Returns the title of the Application window or Window object.

Syntax

stringVariable = object.Caption

where:

stringVariable is a variable for storing the contents of the Caption.

object is the Application or Window object.

Examples ...

Caption property example


Caption property example

The following example demonstrates how to return the Caption property.

Private Sub CaptionPropExample()

Dim myCaption As String

myCaption = Application.Caption

MsgBox ("Caption is: " & myCaption)

End Sub


Clear method

Empties the selection set. The selection set will still exist, but will contain no items.

Syntax

object.Clear()

Where:

object is a SelectionSet object.

Examples ...

AddItems method example


Close method

Closes the document and all associated windows.

Syntax

Close([SaveChanges], [File])

Where:

SaveChanges is an optional Boolean variable indicating whether to save changes made since the last save (A value of True saves the changes, while a value of False does not);

File is an optional string naming the file to be saved.

Examples ...

Close method example


Close method example

The following example demonstrates how to use the Close method.

Private Sub CloseMethod()

Dim icadDoc As IntelliCAD.Document

Close

End Sub


CloseAll method

Closes all documents in the collection and removes them from the collection.

Syntax

CloseAll([AskSave])

Where:

AskSave is an optional Boolean variable indicating whether to save changes made since the last save (A value of True saves the changes, while a value of False does not).

Examples ...

CloseAll method example


CloseAll method example

Private Sub CloseAllMethod()

' This example closes all IntelliCAD documents with the CloseAll method.

IntelliCAD.Documents.CloseAll

End Sub


ComposeMatrix method

Multiplies, or composes, two matrices to compound their effects. For example, if the first matrix represents a 30 degree rotation and the second represents a 15 degree rotation the resultant matrix will represent a 45 degree rotation.

Syntax

objectVariable = object.ComposeMatrix(Matrix1, Matrix2)

Where:

object is an IntelliCAD object;

Matrix1 and Matrix2 are IntelliCAD Matrix objects.


ConvertArrayToMatrix method

Converts an array of doubles to a Matrix object.

Syntax

objectVariable = object.ConvertArrayToMatrix(ArrayOf16Doubles)

Where:

object is the IntelliCAD Library object;

ArrayOf16Doubles is an array of double-precision variables (or values).


ConvertArrayToPoint method

Converts an array of doubles to a Point object.

Syntax

objectVariable = object.ConvertArrayToPoint(ArrayOfDoubles, Is3DPoint)

Where:

object is the IntelliCAD Library object;

ArrayOf16Doubles is a 4x4 array of double-precision variables (or values);

Is3Dpoint is a Boolean variable (or value) indicating whether or not the point is 3D.


ConvertArrayToPoints method

Converts an array of doubles to a collection of Points.

Syntax

objectVariable = object.ConvertArrayToPoints(ArrayOfDoubles, Is3DPoint)

Where:

object is the IntelliCAD Library object;

ArrayOfDoubles is an array of double-precision variables (or values);

Is3DPoint is a Boolean variable (or value) indicating whether or not the points are 3D.


ConvertArrayToVector method

Converts an array of doubles to a Vector object.

Syntax

objectVariable = object.ConvertArrayToVector(ArrayOfDoubles, Is3DVector)

Where:

object is the IntelliCAD Library object;

ArrayOf16Doubles is a 4x4 array of double-precision variables (or values);

Is3DPoint is a Boolean variable (or value) indicating whether or not the vector is 3D.


ConvertMatrixToArray method

Converts a Matrix object to an Array of doubles.

Syntax

objectVariable = object.ConvertMatrixToArray(Matrix)

Where:

object is the IntelliCAD Library object;

Matrix is an IntelliCAD Matrix object.


ConvertPointToArray method

Converts an IntelliCAD Point object to an Array of doubles.

Syntax

objectVariable = object.ConvertPointToArray(Point,Is3DPoint)

Where:

object is the IntelliCAD Library object;

Point is an IntelliCAD Point object;

Is3DPoint is a Boolean variable (or value) indicating whether or not the point is 3D.


ConvertPointsToArray method

Converts a Points collection object to an Array of doubles.

Syntax

objectVariable = object.ConvertPointsToArray(Points,Is3DPoint)

Where:

object is the IntelliCAD Library object;

Points is a Points collection object;

Is3DPoint is a Boolean variable (or value) indicating whether or not the points are 3D.


ConvertUnit method

Translates one unit of measure to another.

Syntax

object.ConvertUnit(Value, From, To)

Where:

object is the Utility object;

Value is a double-precision variable (or value) representing the item to be converted;

From is a String representing the unit from which the conversion will be made;

To is a String representing the unit to which the conversion will be made.


ConvertVectorToArray method

Converts a Points collection object to an Array of doubles.

Syntax

objectVariable = object.ConvertVectorToArray(Vector,Is3DVector)

Where:

object is the IntelliCAD Library object;

Vector is an IntelliCAD Vector object;

Is3Dvector is a Boolean variable (or value) indicating whether or not the Vector is 3D.


Copy method

Creates a copy of the entity.

Syntax

objectVariable = object.Copy

Where:

object is the entity to be copied.

Examples ...

Copy method example


Copy method example

Private Sub Copy_and_Rotate_Example()

' This example creates a line and then copies it.

' The new line is then rotated 10 radians.

' Create the line

Dim myDoc As IntelliCAD.Document

Dim myLine As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Set myDoc = Application.ActiveDocument

Set myStartPt = Library.CreatePoint(4, 4)

Set myEndPt = Library.CreatePoint(7, 3)

Set myLine = myDoc.ModelSpace.AddLine(myStartPt, myEndPt)

myLine.Update

' Copy and rotate the line

Dim copymyLine As IntelliCAD.Line

Set copymyLine = myLine.Copy()

copymyLine.Rotate myStartPt, 10

MsgBox "Rotated the copied line 10 radians."

ThisDocument.ActiveViewport.ZoomExtents

End Sub


CreateIdentityMatrix method

Returns an identity matrix.

Syntax

objectVariable = object.CreateIdentityMatrix()

Where:

object is the IntelliCAD Library object;


CreateMirrorMatrix method

Returns the resulting matrix object with a reflection along the x, y, or z axes.

Syntax

objectVariable = object.CreateMirrorMatrix([MirrorX], [MirrorY], [MirrorZ])

Where:

object is the IntelliCAD Library object;

MirrorX, MirrorY, and MirrorZ are Boolean variables (or values) indicating whether the object should be mirrored along the x, y, or z axes.


CreatePoint method

Creates a new Point object.

NOTE: The CreatePoint method should not be confused with either the CreatePoints method, which is used to create a new Points collection object, or the AddPointEntity method, which is used to create a point that is visible on the screen.

Syntax

objectVariable = Library.CreatePoint (X, Y, Z)

Where:

objectVariable is a variable representing a Point object.

X, Y, and Z are double-precision variables representing the x, y, and z coordinates of the point.

Tell me about...

CreatePoints method

Examples ...

AddPointEntity method example

CreatePoint method example


CreatePoint method example

Private Sub GetCornerExample()

' This example creates a point using the CreatePoint method.

Dim icadDoc As IntelliCAD.Document

Dim myPoint As IntelliCAD.Point

Set icadDoc = ActiveDocument

Set myPoint = Library.CreatePoint(4, 2)

MsgBox "Point created at 4,2."

End Sub


CreatePoints method

Creates a new, empty points collection object.

NOTE: The CreatePoints method should not be confused with either the CreatePoint method, which is used to create a single Point object, or the AddPointEntity method, which is used to create a point that is visible on the screen.

Syntax

objectVariable = Library.CreatePoints

Where:

objectVariable is a variable representing a Points collection object.

Examples ...

CreatePoints method example


CreatePoints method example

Private Sub CreatePoints_Example()

Dim myDoc As IntelliCAD.Document

Dim myPoints As Points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(7, 2, 3)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

End Sub


CreateRotationMatrix method

Returns a matrix equivalent to a rotation angle about an axis specified by two points.

Syntax

objectVariable = object.CreateRotationMatrix(Angle, AxisEnd, [AxisStart])

Where:

object is the IntelliCAD Library object;

Angle is a double-precision variable (or value) representing the angle in radians;

AxisEnd is a Point object representing the end point of the axis;

AxisStart is a Point object representing the start point of the axis.


CreateScaleMatrix method

Returns the resulting matrix object scaled about the x, y, or z axes.

Syntax

objectVariable = object.CreateScaleMatrix([x = 1], [y = 1], [z = 1])

Where:

object is the IntelliCAD Library object;

x, y, and z are doubles indicating which axis is to be used for scaling.


CreateTranslationMatrix method

Returns the resulting matrix object with a translation of x, y, and z along the axes.

Syntax

objectVariable = object.CreateTranslationMatrix([x], [y], [z])

Where:

object is the IntelliCAD Library object;

x, y, and z are doubles indicating which axis is to be used for translating.


CreateVector method

Returns a Vector object based on (X2-X1), Y2-Y1), (Z2-Z1). The values for X1, Y1, and Z1 default to 0, 0, 0.

Syntax

objectVariable = Library.CreateVector(X2, Y2, [Z2], [X1], [Y1], [Z1])

Where:

objectVariable is a variable representing a Vector object.

X1, Y1, and Z1 are double-precision variables representing the x, y, and z coordinates of the first point of the vector.

X2, Y2, and Z2 are double-precision variables representing the x, y, and z coordinates of the second point.

Examples ...

AddVectors method example


Delete method

Deletes a specified object, such as a drawing entity or a block, layer, or linetype.

Syntax

object.Delete

Where:

object is the name of the object to be deleted. The object may be one of the following:

Any Drawing Entity, Block, Layer, Linetype, Pviewport, SelectionSet, TextStyle, UCS, View, Viewport.

Examples ...

Delete method example


Delete method example

Private Sub Delete_Example()

' This example creates a Layer named by the user.

' It then deletes the layer.

Dim newLayer As IntelliCAD.Layer

Dim lName As String

lName = InputBox("Type a layer name")

' Create the new layer

Set newLayer = ThisDocument.Layers.Add(lName)

MsgBox "Layer " & newLayer.Name & " has been added."

' Delete the layer

newLayer.Delete

MsgBox "Layer " & newLayer.Name & " has been deleted."

End Sub


DefineFunction method

Adds a macro to the IntelliCAD command list. It is similar to (defun c:cmd) in LISP.

Syntax

Sub DefineFunction(FunctionName, FunctionPointer)

Where:

FunctionName is a string variable representing the name of the macro.

FunctionPointer is the address of the function to be called.


DeleteFitPoint method

Deletes a fit point from the spline.

Syntax

object.DeleteFitPoint(Index)

Where:

object is an IntelliCAD Spline object;

Index is a Long Integer variable (or value) identifying the position in which to delete the fit point.


Detach method

Detachs an external reference (xref) from a drawing.

Syntax

XRef.Detach()

Where:

XRef is the name of the external reference to detach.

Examples ...

Detach method example


Detach method example

Private Sub Detach_Example()

' This example adds and detaches an external reference using the MAP.DWG ' file found in the Samples folder. You may need to change the path and

' filename for your system.

Dim insPt As IntelliCAD.Point

Dim insertedXRef As IntelliCAD.ExternalReference

Dim msg As String, PathName As String, XrefName As String

XrefName = InputBox("Type an XRef name")

Set insPt = Library.CreatePoint(1, 1, 0)

PathName = "c:\program files\IntelliCAD2001\Samples\map.dwg"

' Add the external reference to the drawing

Set insertedXRef = ThisDocument.ModelSpace.AttachExternalReference(PathName, XrefName, insPt, 1, 1, 1, 0, False)

MsgBox "The external reference '" & insertedXRef.name & "' is attached."

' Detach the external reference definition

Dim name As String

name = insertedXRef.name

ThisDocument.Blocks.Item(name).Detach

MsgBox "The external reference '" & XrefName & "' is detached."

End Sub


Display method

Display the viewport, or hide it.

Syntax

object.Display(Status)

Where:

object is the name of the viewport;

Status is a Boolean variable specifying whether to display (True) or hide (False) the viewport.

Examples ...

Display method example


Display method example

Private Sub DisplayMethodExample()

' This example creates a paperspace viewport and makes it active.

Dim newPViewport As IntelliCAD.PViewport

Dim cenPt As Point

Set cenPt = Library.CreatePoint(5, 5, 0)

' Create a paperspace Viewport object

ThisDocument.ActiveSpace = vicPaperSpace

Set newPViewport = ThisDocument.PaperSpace.AddPViewport(cenPt, 50, 60)

newPViewport.Display True

End Sub


DistanceBetweenVectors method

Calculates the distance between two vectors.

Syntax

objectVariable = object.DistanceBetweenVectors(Vector1, Vector2)

Where:

object is the IntelliCAD Library object;

Vector1 and Vector2 are the or objects between which the distance is measured.


Erase method

Erases the display of the entity. The entity is not deleted from the database.

Syntax

object.Erase()

Where:

object is an IntelliCAD entity.

Examples ...

Erase method example


Erase method example

Sub Example_Erase()

' This example creates text and then erases it.

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Temporary text to be erased"

' Add the Text object

Set textObj = ThisDocument.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

' Erase the line

textObj.Erase

End Sub


EvaluateLispExpression method

Evaluates a LISP expression on the command line.

Syntax

Function EvaluateLispExpression(LispExpression)

Where:

LispExpression is a string variable representing the name of the Lisp expression to evaluate.


Explode method

Explodes the entity into sub-entities.

Syntax

object.Explode()

Where:

object is an IntelliCAD entity.


Export method

Exports the file to any of the supported formats. Optionally, pass in a selection set to export only a part of the file. Format is based on the extension in the FileName (default is the DXF format)

Syntax

Sub Export(FileName, Extension, [SelectionSet])

Where:

FileName is a string variable representing the name of the file to export.

Extension is a string variable representing the extension of the file name.

SelectionSet is an IntelliCAD selection set to be exported (optional).


GetAngle method

Allows the user to specify the angle on the graphics window.

Syntax

object.GetAngle([Point], [Prompt])

Where:

object is the Utility object;

Point is a Point object representing the base point for the angle;

Prompt is is a String prompting the user to pick the angle.

Examples ...

GetAngle method example


GetAngle method example

Sub Example_GetAngle()

' This example obtains an angle from the user using the GetAngle method.

Dim retAngle As Double

Dim pnt As IntelliCAD.Point

Set pnt = Library.CreatePoint(0, 0, 0)

' Return the angle in radians with a prompt

Me.hide

retAngle = ThisDocument.Utility.GetAngle(pnt, "Enter an angle: ")

MsgBox "The angle entered was " & retAngle, , "GetAngle Example"

End Sub


GetAttributes method

Returns the attributes in a BlockInsert or External Reference.

Syntax

objectVariable = object.GetAttributes

Where:

object is the IntelliCAD BlockInsert or ExternalReference object.


GetBoundingBox method

Returns the corners of the box that encloses a specified entity.

Syntax

object.GetBoundingBox(MinPoint, MaxPoint)

Where:

object is an IntelliCAD Viewport or PViewport object;

MinPoint and MaxPoint are IntelliCAD Pooint objects representing the lower-left and upper-right corners of a box enclosing a particular object.

Examples ...

GetBoundingBox method example


GetBoundingBox method example

Sub Example_GetBoundingBox()

' This example creates text and finds the bounding box for the text.

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set insPt = Library.CreatePoint(3, 7)

height = 5

myText = "Test string for bounding box"

' Add the Text object

Set textObj = ThisDocument.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

' Return the bounding box for the text and return the lower left

' and upper right corners of the box.

Dim LL As Point

Dim UR As Point

textObj.GetBoundingBox LL, UR

MsgBox "The extents of the bounding box for the text are:" & Chr(13) & "Lower Left: " & LL.x & ", " & LL.y & Chr(13) & "Max Extent: " & UR.x & ", " & UR.y

End Sub


GetBulge method

Returns the bulge value at a given vertex of a polyline or lightweight polyline.

Syntax

object.GetBulge(Index)

Where:

object is an IntelliCAD polyline or lightweight polyline object;

Index is a Long integer variable (or value) specifying the polyline segment.

Examples ...

GetBulge method example


GetBulge method example

Private Sub GetBulge_Example()

' This example adds a polyline to the drawing.

' It then uses the GetBulge method to obtain the bulge factor

' and the SetBulge to change it.

Dim myDoc As IntelliCAD.Document

Dim myPline As IntelliCAD.LWPolyline

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 1, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(3, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(7, 4, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomExtents

' Find the bulge of the 2nd segment

Dim currentBulge As Double

currentBulge = myPline.GetBulge(2)

MsgBox "The bulge for the second segment is " & currentBulge, , "Get/SetBulge Example"

' Change the bulge of the 2nd segment

myPline.SetBulge 2, 1.3

myPline.Update

MsgBox "The bulge for the second segment is now " & myPline.GetBulge(2), , "Get/SetBulge Example"

End Sub


GetControlPoint method

Returns the control point to the spline at the given index.

Syntax

objectVariable = object.GetControlPoint(Index)

Where:

object is an IntelliCAD Spline object;

Index is a Long integer variable (or value) specifying the position of the control point.


GetCorner method

Returns a specified corner of a 3DFace entity. The returned value is in the form of a Point object.

Syntax

object.GetCorner(Index)

Where:

object is a 3DFace object;

Index is an integer value representing the corner number of the 3D face.

Examples ...

GetCorner method example


GetCorner method example

Private Sub GetCornerExample()

' This example gets the corner data for any 3dFace objects.

Dim ents As IntelliCAD.Entities

Dim ent As Object

Dim FaceCorner As Point

Set ents = ActiveDocument.Entities

For Each ent In ents

Select Case ent.EntityType

Case Icad3dFace

Set FaceCorner = ent.GetCorner(3)

MsgBox "The coordinates for the third corner are: " & Chr(13) & "x = " & FaceCorner.x & Chr(13) & "y = " & FaceCorner.y & Chr(13) & "z = " & FaceCorner.z

End Select

Next ent

End Sub


GetGridSpacing method

Sets or returns the current grid spacing setting value.

Syntax

object.GetGridSpacing(Xspacing, Yspacing)

Where:

object is an IntelliCAD Viewport or PViewport object;

Xspacing and Yspacing are double-precision variables (or values) representing the spacing of grids along the x and y axes.

Examples ...

GetGridSpacing method example


GetGridSpacing method example

Sub GetGridSpacing_Example()

' This example turns on the grid for the current viewport.

' It then finds and displays a message with the current grid spacing.

Dim viewportObj As IntelliCAD.Viewport

Dim XGrid As Double

Dim YGrid As Double

Set viewportObj = ThisDocument.ActiveViewport

' Turn on the grid and reset the viewport to see it come on.

viewportObj.GridOn = True

ThisDocument.ActiveViewport = viewportObj

' Find the current grid spacing

viewportObj.GetGridSpacing XGrid, YGrid

MsgBox "X Grid spacing = " & XGrid & " Y Grid spacing = " & YGrid

End Sub


GetInterfaceObject method

Creates an object specified by the ProgID and returns its Dispatch interface pointer. Objects are defined in the registry and identified by their ProgID. For example, the ProgID for Intellicad is Icad.Application.

Syntax

Function GetInterfaceObject(ProgID)

Where:

ProgID is a string variable representing the program's definition in the registry.


GetInvisibleEdge method

Gets the visibility setting for a 3DFace edge at a given index.

Syntax

object.GetInvisibleEdge(Index)

Where:

object is an IntelliCAD Viewport or PViewport object;

Index is an Integer representing the index number of the face.

Examples ...

GetInvisibleEdge method example


GetInvisibleEdge / SetInvisibleEdge example

Private Sub GetInvisibleEdge_Example()

' This example adds a 3D face to the drawing.

' It then uses the GetInvisibleEdge and SetInvisibleEdge methods.

Dim faceObj As IntelliCAD.Face3D

Dim icadDoc As IntelliCAD.Document

Dim Pt1 As IntelliCAD.Point

Dim Pt2 As IntelliCAD.Point

Dim Pt3 As IntelliCAD.Point

Dim Pt4 As IntelliCAD.Point

Dim myObj As Object

Dim visStatus As Boolean

Set icadDoc = ActiveDocument

' Define the four coordinates of the face

Set Pt1 = Library.CreatePoint(0, 0, 0)

Set Pt2 = Library.CreatePoint(3, 0, 2)

Set Pt3 = Library.CreatePoint(6, 5, 0)

Set Pt4 = Library.CreatePoint(4, 4, 2)

' Add the 3DFace object

Set faceObj = icadDoc.ModelSpace.Add3DFace(Pt1, Pt2, Pt3, Pt4)

faceObj.Update

ThisDocument.ActiveViewport.ZoomExtents

visStatus = faceObj.GetInvisibleEdge(0)

MsgBox "The visibility status of the face is currently: " & visStatus

' Toggle the visibility of the first edge of the face

faceObj.SetInvisibleEdge 0, Not (visStatus)

faceObj.Update

MsgBox "The visibility status of the face is now: " & visStatus

End Sub


GetLispVariable method

Returns the value of a LISP variable.

Syntax

Function GetLispVariable(Name)

Where:

Name is a string representing the name of the variable.


GetSnapSpacing method

Sets or returns the current snap spacing setting value.

Syntax

object.GetSnapSpacing(Xspacing, Yspacing)

Where:

object is an IntelliCAD Viewport or PViewport object;

Xspacing and Yspacing are double-precision variables (or values) representing the spacing of grids along the x and y axes.

Examples ...

GetSnapSpacing method example


GetSnapSpacing method example

Sub GetSnapSpacing_Example()

' This example finds the current Snap spacing.

' First, find the current active viewport

Dim viewportObj As IntelliCAD.Viewport

Dim XSnap As Double

Dim YSnap As Double

Set viewportObj = ThisDocument.ActiveViewport

' Turn on Snap and reset the viewport.

viewportObj.SnapOn = True

ThisDocument.ActiveViewport = viewportObj

' Find the current Snap spacing

viewportObj.GetSnapSpacing XSnap, YSnap

MsgBox "X Snap Spacing = " & XSnap & " Y Snap Spacing = " & YSnap

End Sub


GetUCSMatrix method

Returns the transformation matrix associated with a User Coordinate System.

Syntax

object.GetUCSMatrix()

Where:

object is an IntelliCAD Matrix object.

Examples ...

GetUCSMatrix method example


GetUCSMatrix method example

Private Sub cmdGetUCS_Click()

'Sub Example_GetUCSMatrix()

' This example creates a new UCS and finds the UCS matrix for it.

' Define a new UCS and turn on the UCS icon at the origin.

Dim ucsObj As IntelliCAD.UserCoordSystem

Dim originPt As Point

Dim xAxisVector As Vector

Dim yAxisVector As Vector

Dim UCSName As String

' Set the origin and axes vectors.

Set originPt = Library.CreatePoint(0, 0, 0)

Set xAxisVector = Library.CreateVector(0, 0, 0, 1, 1, 0)

Set yAxisVector = Library.CreateVector(0, 2, 0, 1, 1, 0)

UCSName = InputBox("Type a name for the user coordinate system:")

Set ucsObj = ThisDocument.UserCoordinateSystems.Add(originPt, xAxisVector, yAxisVector, UCSName)

ThisDocument.ActiveUCS = ucsObj

ThisDocument.ActiveViewport.UCSIconOn = True

ThisDocument.ActiveViewport.UCSIconAtOrigin = True

MsgBox "Origin coordinates: " & ucsObj.origin.x & ", " & ucsObj.origin.y & ", " & ucsObj.origin.z

' Get the UCS transformation matrix

Dim TransMatrix As Matrix

Set TransMatrix = ucsObj.GetUCSMatrix()

MsgBox "First two values of matrix: " TransMatrix.GetValue(0, 1) & " " & TransMatrix.GetValue(1, 2)

End Sub


GetVariable method

Returns the value of a system variable.

Syntax

Function GetVariable(Name)

Where:

Name is a string representing the name of the variable.


GetWidth method

Returns the start and end width for a polyline or lightweight polyline.

Syntax

object.GetWidth(Index, StartWidth, EndWidth)

Where:

object is an IntelliCAD polyline or lightweight polyline object;

Index is a Long integer variable (or value) specifying the polyline segment.

StartWidth and EndWidth are double-precision variables representing the starting width and ending width, respectively, of the polyline.

Examples ...

GetWidth method example


GetWidth method example

Private Sub GetWidth_Example()

' This example adds a polyline and determines its width.

Dim myDoc As IntelliCAD.Document

Dim myPline As IntelliCAD.LWPolyline

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 1, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(3, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(7, 4, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddLightWeightPolyline(myPoints)

myPline.Update

ThisDocument.ActiveViewport.ZoomExtents

' Find the width of the 2nd segment

Dim sw As Double

Dim ew As Double

myPline.GetWidth 2, sw, ew

MsgBox "The starting width for the second segment is " & sw, , "Get/SetWidth Example"

' Change the starting width of the 2nd segment

myPline.SetWidth 2, 1.2, ew

myPline.GetWidth 2, sw, ew

myPline.Update

MsgBox "The starting width for the second segment is now " & sw, , "Get/SetWidth Example"

End Sub


GetWindowRect method

Gets the size and position of the client area of the window.

Syntax

object.GetWindowRect(Left, Top, Width, Height)

Where:

object is an IntelliCAD Window object;

Left is a Long integer variable defining the left position of the window;

Top is a Long integer variable defining the top position of the window;

Width is a Long integer variable defining the width of the window;

Height is a Long integer variable defining the height of the window.


GetXData and SetXData method example

Option Explicit

Private Const APP_NAME As String = "TEST_APP"

' This example gets an entity and its Xdata (if it exists) and prints the

' info in the debug window.

Sub ReadXData()

' get the entity.

Dim anObj As Object

Dim pt As IntelliCAD.Point

ActiveDocument.Utility.GetEntity anObj, pt, "Select an entity: "

' get its xdata.

Dim xdataType As Variant

Dim xdataValue As Variant

Dim appName As String

anObj.GetXData APP_NAME, xdataType, xdataValue

' iterate through the XData.

Dim lbnd As Integer, ubnd As Integer

Dim i As Integer

If (vbEmpty <> VarType(xdataType)) Then

lbnd = LBound(xdataType)

ubnd = UBound(xdataType)

For i = lbnd To ubnd

If ( _

(1010 = xdataType(i)) _

Or _

(1011 = xdataType(i)) _

Or _

(1012 = xdataType(i)) _

Or _

(1013 = xdataType(i)) _

) Then

Dim ptX As IntelliCAD.Point

Set ptX = xdataValue(i)

Debug.Print "XData Type: " & xdataType(i) & " Xdata Value: " & ptX.x & "," & ptX.y & "," & ptX.z

Set ptX = Nothing

Else

Debug.Print "XData Type: " & xdataType(i) & " Xdata Value: " & xdataValue(i)

End If

Next i

Else

Debug.Print "No XData for " & APP_NAME

End If

Set anObj = Nothing

End Sub

Sub AppendXData()

' get the entity.

Dim anObj As Object

Dim pt As IntelliCAD.Point

ActiveDocument.Utility.GetEntity anObj, pt, "Select an entity: "

' get its xdata.

Dim xdataType As Variant

Dim xdataValue As Variant

anObj.GetXData APP_NAME, xdataType, xdataValue

If (vbEmpty = VarType(xdataType)) Then

Dim tmp(0 To 0) As Integer

xdataType = tmp

ReDim xdataValue(0 To 0)

' the first item in the XData should be a 1001

' code giving the app's name.

xdataType(0) = 1001

xdataValue(0) = APP_NAME

End If

' redimension the XData arrays, preserving their

' contents.

ReDim Preserve xdataType(LBound(xdataType) _

To (UBound(xdataType) + 1))

ReDim Preserve xdataValue(LBound(xdataValue) _

To (UBound(xdataValue) + 1))

' stuff some new data in.

xdataType(UBound(xdataType)) = 1000

xdataValue(UBound(xdataValue)) = "Hi, I was added!"

' store the data.

anObj.SetXData xdataType, xdataValue

Set anObj = Nothing

End Sub


GetXData method

Returns the extended entity data (Xdata) associated with an object. VBA sees XData as a pair of arrays. The first array tells you what type of data (e.g., string or 3D point) is in the corresponding location in the second array (e.g., "Hi there" or 3,0,0). To get an entity's XData, you pass two empty arrays to GetXData. GetXData populates these arrays with the entity's XData. You can then iterate through the arrays and read the data. VBA uses the same datatype codes (1000 for a string, 1003 for a layer name, and so on) as Lisp.

Syntax

Sub GetXData(AppName, TypeArray, DataArray)

Where:

AppName is a string representing the name of the application.

Examples ...

GetXData method example


HandleToObject method

Finds an object with the given handle.

Syntax

Function HandleToObject(Handle) As Object

Where:

Handle is a string representing the name of the object.


Help method

Displays help information from a designated help file.

Syntax

Sub Help(HelpFile, [HelpTopic], [HelpCommand])

Where:

HelpFile is a string variable representing the name of the help file.

HelpTopic is a string variable representing the name of the help topic.

HelpCommand is a long-integer variable representing the name of the help command. It is defined in winuser.h and can be HELP_CONTENTS, HELP_HELPONHELP or HELP_PARTIALKEY

To simply bring up help, you can use this method with no optional parameters as follows:

Call Application.Help("icadvba.hlp")

Intellicad will search for the file in all known locations (as defined by the search path). If the hlp file is not found, this method will fail. You can also provide the full path to the help file in which case, this method will succeed. Using the 2nd and 3rd optional arguments, you can bring up help on a specific topic. The following constants are defined in winuser.h (a Windows system file).

#define HELP_CONTENTS 0x0003L

#define HELP_HELPONHELP 0x0004L /* Display help on using help */

#define HELP_PARTIALKEY 0x0105L

In VBA:

Call Application.Help("icadvba.hlp", "Colors", 261)

This will bring up the Colors topic. Note that 261 is HELP_PARTIALKEY(0x0105) in decimal

Call Application.Help("icadvba.hlp", , 3)

will bring up the contents

Call Application.Help("icadvba.hlp", , 4)

will bring up help on help.


Highlight method

Highlights (or dehighlights) an entity.

Syntax

object.Erase(HighlightFlag As Boolean)

Where:

object is an IntelliCAD entity.

Examples ...

Highlight method example


Highlight method example

Private Sub Highlight_Example()

' This example creates a line and a circle and highlights all lines.

Dim lineObj As IntelliCAD.Line

Dim startpoint As IntelliCAD.Point

Dim endpoint As IntelliCAD.Point

Dim circObj As IntelliCAD.Circle

Dim centerPt As IntelliCAD.Point

Dim radius As Double

' Create a line object in model space

Set startpoint = Library.CreatePoint(3, 2, 0)

Set endpoint = Library.CreatePoint(4, 5, 0)

Set lineObj = ThisDocument.ModelSpace.AddLine(startpoint, endpoint)

' Create a circle object in model space

Set centerPt = Library.CreatePoint(3, 4, 0)

radius = 5

Set circObj = ThisDocument.ModelSpace.AddCircle(centerPt, radius)

Dim entName As String

Dim ent As Object

For Each ent In ThisDocument.ModelSpace

If ent.EntityName = "Line" Then ent.Highlight (True)

Next

MsgBox "All lines have been highlighted."

For Each ent In ThisDocument.ModelSpace

If ent.EntityName = "Line" Then ent.Highlight (False)

Next

End Sub


Import method

Imports files in DXF and other supported formats.

Syntax

Sub Import(FileName, [InsertionPoint], [ScaleFactor = 1])

Where:

FileName is a string representing the name of the file to be imported.

InsertionPoint is a Point object (optional) representing the location to insert the file. A location of 0,0 is assumed if this parameter is omitted.

ScaleFactor is a double-precision variable representing the scale factor for the imported information. The default value is 1.0.


InsertBlock method

Adds a new Block Insert object.

Syntax

objectVariable = object.InsertBlock([InsertionPoint], BlockName, [XScale], [YScale], [ZScale], [Rotation])

Where:

InsertionPoint is a Point object representing the point at which the block will be inserted;

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

BlockName is a string representing the name of the block;

XScale, YScale, and ZScale are double-precision variables (or values) representing the scaling factors for the drawing along each coordinate plane;

Rotation is a double-precision variable (or value) representing the rotation angle (in radians) for the external reference.

Examples ...

InsertBlock method example


InsertBlock method example

Sub Example_InsertBlock()

' This example creates a block containing a line and an arc

' and adds it to the Blocks collection. It then inserts the block.

' Create the block and add it to the Blocks collection

Dim blockObj As IntelliCAD.Block

Dim insPt As IntelliCAD.Point

Dim BlkName As String

BlkName = InputBox("Type a block name")

Set insPt = Library.CreatePoint(4, 3, 0)

Set blockObj = ThisDocument.Blocks.Add(insPt, BlkName)

' Add a a line and an arc to the block

Dim lineObj As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Dim arcObj As IntelliCAD.Arc

Dim cenPt As Point

Dim radius As Double

Set lineObj = ThisDocument.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

Set cenPt = Library.CreatePoint(3, 4, 0)

radius = 1

Set arcObj = blockObj.AddArc(cenPt, radius)

' Insert the block

Dim blockRefObj As IntelliCAD.BlockInsert

Set blockRefObj = ThisDocument.ModelSpace.InsertBlock(insPt, BlkName, 1, 1, 0)

MsgBox "The block " & BlkName & " has been inserted."

End Sub


IntersectWith method

Member of IntelliCAD.Line

Returns the intersection points between given objects.

Syntax

objectVariable = object.IntersectWith(IntersectingObject, Option)

Where:

object is the first IntelliCAD entity to be intersected;

IntersectionObject is the second IntelliCAD entity to be intersected;

Option is one of the following constants for intersections:

vicExtendBoth = 3 (extends both entities if necessary)

vicExtendNone = 0 (does not extend either entity)

vicExtendOtherEntity = 2 (extends the second entity)

vicExtendThisEntity = 1 (extends the first entity)

Examples ...

IntersectWith method example


IntersectWith method example

Private Sub IntersectWith_Example()

' This example creates two lines and finds the points at

' which they intersect.

' Create the lines

Dim myLine1 As IntelliCAD.Line

Dim myLine2 As IntelliCAD.Line

Set myDoc = Application.ActiveDocument

Set myLine1 = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

myLine1.Update

Set myDoc = Application.ActiveDocument

Set myLine2 = myDoc.ModelSpace.AddLine(Library.CreatePoint(5, 2), Library.CreatePoint(8, 4))

myLine2.Update

' Find the intersection point.

Dim intPoints As points

Set intPoints = myLine1.IntersectWith(myLine2, vicExtendNone)

MsgBox "Intersection point: " & Chr(13) & Chr(13) & "x = " & intPoints.Item(1).x & Chr(13) & "y = " & intPoints.Item(1).y & Chr(13) & "z = " & intPoints.Item(1).z

End Sub


InvertMatrix method

Finds the inverse of the matrix.

Syntax

objectVariable = object.InvertMatrix(Matrix)

Where:

object is the IntelliCAD Library object;

Matrix is an IntelliCAD Matrix object.


IsFunctionLoaded method

Determines whether a function is loaded. Returns a Boolean value (TRUE if loaded and FALSE if not).

Syntax

Function IsFunctionLoaded(FunctionName)

Where FunctionName is a string variable representing the name of the function.


ListSDS method

Returns a list of the loaded SDS applications.

Syntax

Function ListSDS()


LoadLISP method

Loads a specified LISP application.

Syntax

Sub LoadLISP(ApplicationName)

Where:

ApplicationName is a string variable representing the name of the LISP application.

Examples ...

LoadApplication method example


LoadSDS method

Loads a specified SDS application.

Syntax

Sub LoadSDS(ApplicationName)

Where:

ApplicationName is a string variable representing the name of the SDS application.

Examples ...

LoadApplication method example


LoadApplication method example

This example demonstrates how to use the LoadApplication method to load an SDS or LISP application.

Private Sub LoadApplicationExample()

Dim myObject As Application

' Load a file called mylispfl.lsp

Application.LoadApplication mylispfl

End Sub


Mirror method

Mirrors an object about an axis defined by two points.

Syntax

object.Mirror(Point1, Point2, [MakeCopy])

Where:

object is an IntelliCAD entity;

Point1 and Point2 are IntelliCAD Point objects representing the axis for mirroring;

MakeCopy is a Boolean variable indicating whether or not to copy the original object.

Examples ...

Mirror method example


Mirror method example

Private Sub Mirror_Example()

Dim myArc As IntelliCAD.Arc

Dim cenPt As IntelliCAD.Point

Dim mirrorObj As IntelliCAD.Arc

Set cenPt = Library.CreatePoint(4, 3)

'Add the arc to the .dwg

Set myArc = ThisDocument.ModelSpace.AddArc(cenPt, 4, 1, 3)

' Display the entity

myArc.Update

ThisDocument.ActiveViewport.ZoomExtents

'MsgBox "x = " & myArc.startpoint.x & " y = " & myArc.startpoint.y & " x = " & myArc.endpoint.x & " y = " & myArc.endpoint.y

'MsgBox "rad pt x = " & myArc.center.x & "rad pt y = " & myArc.center.y

Set mirrorObj = myArc.Mirror(myArc.startpoint, myArc.endpoint)

End Sub


Mirror3D method

Mirrors an object about a plane defined by three points.

Syntax

object.Mirror(Point1, Point2, Point3, [MakeCopy])

Where:

object is an IntelliCAD entity;

Point1, Point2, and Point3 are IntelliCAD Point objects representing the plane for mirroring;

MakeCopy is a Boolean variable indicating whether or not to copy the original object.

Examples ...

Mirror3D method example


Mirror3D method example

Private Sub Mirror3DExample()

' This example creates a cone in model space

' and mirrors the cone about a plane.

Dim coneObj As IntelliCAD.PolygonMesh

Dim mirrorConeObj As IntelliCAD.PolygonMesh

Dim conePt As IntelliCAD.Point

Dim mirPt1 As IntelliCAD.Point

Dim mirPt2 As IntelliCAD.Point

Dim mirPt3 As IntelliCAD.Point

Set conePt = Library.CreatePoint(2, 2, 0)

Set mirPt1 = Library.CreatePoint(1, 2, 0)

Set mirPt2 = Library.CreatePoint(3, 4, 0)

Set mirPt3 = Library.CreatePoint(4, 2, 0)

Set coneObj = ThisDocument.ModelSpace.AddCone(conePt, 3, 4)

coneObj.Update

ThisDocument.ActiveViewport.ZoomExtents

' Mirror the cone

Set mirrorConeObj = coneObj.Mirror3D(mirPt1, mirPt2, mirPt3)

ThisDocument.ActiveViewport.ZoomAll

End Sub


Move method

Moves an object.

Syntax

object.Move(Point1, Point2)

Where:

object is an IntelliCAD entity;

Point1 is an IntelliCAD Point object representing the base point;

Point2 is an IntelliCAD Point object representing the displacement point.


NewWindow method

Creates a new window for the document.

Syntax

Sub NewWindow()


Offset method

Creates an offset entity at a given distance from another entity, + and - represent the two sides for offset.

Syntax

object.Offset(OffsetDistance)

Where:

object is an IntelliCAD entity;

OffsetDistance is a double-precision variable (or value) representing the distance to offset the entity.


Open method

Opens an existing document and adds it to the collection.

Syntax

object.Open(Filename)

Where:

object is one of the ModelSpace or PaperSpace collection objects or a Block object;

Filename is the name of the file to open.

Examples ...

Open method example


Open method example

Private Sub OpenMethod()

' The following example opens "C:\package.dwg" file.

' You may need to change the drawing path and name to reflect a valid

' IntelliCAD drawing on your system.

Documents.Open ("C:\package.dwg")

End Sub


PrintDrawing method

Prints the document.

Syntax

Sub PrintDrawing([nCopies = 1])

Where:

nCopies is the number of copies to be printed (default = 1).


PrintPreview method

Previews a document with the current print settings.

Syntax

Sub PrintPreview()


PurgeAll method

Purges the document of all unused table objects.

Syntax

Sub PurgeAll()


Quit method

Closes the drawing file and exits the application.

Syntax

object.Quit

Where:

object is a valid object, in this case the Application object.

Examples ...

Quit method example


Quit method example

This example demonstrates how to use the Quit method to close the drawing and exit IntelliCAD.

Private Sub QuitExample()

Msg = "Really want to quit?"

Title = "Quit Method Example"

Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.

Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then ' User chose Yes.

Application.Quit

End If

End Sub


Redraw method

Redraws an object. This is often necessary to update an entity to reflect changes made within a VBA program.

Syntax

object.Redraw

Where:

object is the name of a valid object.

Examples ...

AddLine method example


Regen method

Regenerates the drawing for the indicated viewports.

Syntax

Sub Regen([Viewports = vicActiveViewport])

Where:

Viewports is the enumerated value of vicWhichViewport, with 0 = the active viewport and 1 = all viewports.


Reload method

Reloads the External Reference.

Syntax

object.Reload()

Where:

object is a Block object.

Examples ...

Reload method example


Reload method example

Private Sub Reload_Example()

Dim b As Block

Set b = ActiveDocument.Blocks(1)

b.Reload

MsgBox "Blocks(1) has been reloaded."

End Sub


RemoveItems method

Sub RemoveItems(Entities)

Removes one or more entities from the SelectionSet.

Syntax

object.RemoveItems(Entities)

Where:

object is a Block or SelectionSet object;

Entities is a selection set object to which the items are to be added.

Examples ...

RemoveItems method example


RemoveItems method example

Private Sub RemoveItemsExample()

' This example creates a selection set, and a line and circle objects.

' It then adds the objects to the selection set and removes them.

Dim ssetObj As IntelliCAD.SelectionSet

Dim I As Integer

Dim lineObj As IntelliCAD.Line

Dim startPoint As IntelliCAD.Point

Dim endPoint As IntelliCAD.Point

Dim circObj As IntelliCAD.Circle

Dim centerPt As IntelliCAD.Point

Dim radius As Double

Dim ssetName

ssetName = InputBox("Type a name for the selection set:")

Set ssetObj = ThisDocument.SelectionSets.Add(ssetName)

' Create a line object in model space

Set startPoint = Library.CreatePoint(3, 1, 0)

Set endPoint = Library.CreatePoint(5, 5, 0)

Set lineObj = ThisDocument.ModelSpace.AddLine(startPoint, endPoint)

' Create a circle object in model space

Set centerPt = Library.CreatePoint(3, 1, 0)

radius = 5

Set circObj = ThisDocument.ModelSpace.AddCircle(centerPt, radius)

' Collect the objects into an array of objects

' to be added to the selection set.

ReDim ssobjs(1 To ThisDocument.ModelSpace.Count) As IntelliCAD.Entity

For I = 1 To ThisDocument.ModelSpace.Count

Set ssobjs(I) = ThisDocument.ModelSpace.Item(I)

Next I

' Add the array of objects to the selection set

ssetObj.AddItems ssobjs

MsgBox "No. of items in sel. set = " & ssetObj.Count

ssetObj.RemoveItems ssobjs

End Sub


RevertToSaved method

Discards changes to the document and reloads it.

Syntax

Sub RevertToSaved()


Rotate method

Rotates an object or selection set.

Syntax

object.Rotate(BasePoint, RotationAngle)

Where:

object is an IntelliCAD entity;

BasePoint is an IntelliCAD Point object representing the point about which objects will be rotated;

RotationAngle is a double-precision variable (or value) representing the angle in radians.

Examples ...

Copy method example


Rotate3D method

Rotates the selection set and all its members about an axis formed by two points. The direction of the axis is from point1 to point2.

Syntax

object.Rotate3D(Point1, Point2, RotationAngle)

Where:

object is an IntelliCAD entity;

Point1 is an IntelliCAD Point object representing the first point of the axis about which objects will be rotated;

Point2 is an IntelliCAD Point object representing the second point of the axis about which objects will be rotated;

RotationAngle is a double-precision variable (or value) representing the angle in radians.

Examples ...

Rotate3D method example


Rotate3D method example

Private Sub Rotate3D_Example()

' This example creates a cone in model space.

' It then rotates the cone about an axis.

Dim coneObj As IntelliCAD.PolygonMesh

Dim rotateConeObj As IntelliCAD.PolygonMesh

Dim conePt As IntelliCAD.Point

Dim rotPt1 As IntelliCAD.Point

Dim rotPt2 As IntelliCAD.Point

Set conePt = Library.CreatePoint(2, 2, 0)

Set rotPt1 = Library.CreatePoint(1, 2, 0)

Set rotPt2 = Library.CreatePoint(3, 4, 0)

Set coneObj = ThisDocument.ModelSpace.AddCone(conePt, 3, 4)

coneObj.Update

' Rotate the cone

coneObj.Rotate3D rotPt1, rotPt2, 10

ThisDocument.ActiveViewport.ZoomAll

End Sub


RunCommand method

Executes an IntelliCAD command as if it were typed in the command line.

Syntax

Sub RunCommand(Command)

Where:

Command is a string variable representing the name of an IntelliCAD command.

Examples...

RunCommand method example


RunScript method

Runs a specified script file.

Syntax

Sub RunScript(ScriptName)

Where:

ScriptName is a string variable representing the name of the script file.


Save method

Saves the active document.

Syntax

Save

Examples ...

Save method example


Save method example

Private Sub SaveExample()

' This example saves the drawing.

Application.ActiveDocument.Save

End Sub


SaveAll method

Private Sub SaveAll_Example()

Documents.SaveAll

End Sub

Examples ...

SaveAll method example


SaveAll method example

Private Sub SaveAll_Example()

Documents.SaveAll

End Sub


SaveAs method

Saves the document to a different name.

Syntax

SaveAs(Filename)

Where:

Filename is the new name of the file.

Examples ...

SaveAs method example


SaveAs method example

Private Sub SaveAsExample()

' This example saves the drawing as a file called TESTING.DWG.

Application.ActiveDocument.SaveAs ("testing")

End Sub


ScaleEntity method

Scales the entity or members of a selection set by a given scale factor.

Syntax

object.ScaleEntity(BasePoint, ScaleFactor)

Where:

object is an IntelliCAD entity;

BasePoint is an IntelliCAD Point object representing the point about which the entity will be scaled;

ScaleFactor is a double-precision variable (or value) representing the factor by which to scale the entity or entities.


Scroll method

Scrolls the window horizontally, vertically or both.

Syntax

object.Scroll(FlagsX, FlagsY)

Where:

object is an IntelliCAD Window object;

FlagsX controls horizontal scrolling with one of the following IntelliCAD constants:

vicScrollLeft = 0

vicScrollLeftPage = 2

vicScrollNoneX = 9

vicScrollRight = 1

vicScrollRightPage = 3

vicScrollToLeft = 6

vicScrollToRight = 7

FlagsY controls vertical scrolling with one of the following IntelliCAD constants:

vicScrollDown = 1

vicScrollDownPage = 3

vicScrollNoneY = 9

vicScrollToBottom = 7

vicScrollToTop = 6

vicScrollUp = 0

vicScrollUpPage = 2


Select method

Selects objects within the rectangle specified by two points, and adds them to the SelectionSet.

Syntax

object.Select(Type, [Point1], [Point2], [FilterType], [FilterData])

Where:

object is a SelectionSet object;

Type is one of the following SelectionSetType constants corresponding to the various selection modes:

vicSelectionSetAll = 11

vicSelectionSetCrossingCircle = 3

vicSelectionSetCrossingPolygon = 0

vicSelectionSetCrossingWindow = 6

vicSelectionSetFence = 12

vicSelectionSetInsideCircle = 5

vicSelectionSetInsidePolygon = 2

vicSelectionSetInsideWindow = 8

vicSelectionSetLast = 10

vicSelectionSetOutsideCircle = 4

vicSelectionSetOutsidePolygon = 1

vicSelectionSetOutsideWindow = 7

vicSelectionSetPrevious = 9

Point1 and Point2 are IntelliCAD Point objects defining a rectangle for those applicable selection modes;

FilterType is an optional parameter for specifying how to filter data selection;

FilterData is an optional parameter for specifying filter data.


SelectAtPoint method

Member of IntelliCAD.SelectionSet

Selects objects passing through a point, and adds them to the SelectionSet.

Syntax

object. SelectAtPoint(Point, [FilterType], [FilterData])

Where:

object is a SelectionSet object;

Point is an IntelliCAD Point object specifying the point to use for selection;

FilterType is an optional parameter for specifying how to filter data selection;

FilterData is an optional parameter for specifying filter data.


SelectByPolygon method

Selects objects within a polygon specified by the points, and adds them to the SelectionSet.

Syntax

object.SelectByPolygon(Type, PolygonPoints, [FilterType], [FilterData])

Where:

object is a SelectionSet object;

Type is one of the following SelectionSetType constants corresponding to the various selection modes:

vicSelectionSetAll = 11

vicSelectionSetCrossingCircle = 3

vicSelectionSetCrossingPolygon = 0

vicSelectionSetCrossingWindow = 6

vicSelectionSetFence = 12

vicSelectionSetInsideCircle = 5

vicSelectionSetInsidePolygon = 2

vicSelectionSetInsideWindow = 8

vicSelectionSetLast = 10

vicSelectionSetOutsideCircle = 4

vicSelectionSetOutsidePolygon = 1

vicSelectionSetOutsideWindow = 7

vicSelectionSetPrevious = 9

PolygonPoints is a collection of IntelliCAD Points defining the polygon;

FilterType is an optional parameter for specifying how to filter data selection;

FilterData is an optional parameter for specifying filter data.


SelectOnScreen method

Selects objects as picked by the user on the screen, and adds them to the SelectionSet.

Syntax

object.SelectOnScreen([FilterType], [FilterData])

Where:

objewct is a SelectionSet object;

FilterType is an optional parameter for specifying how to filter data selection;

FilterData is an optional parameter for specifying filter data.


SetBulge method

Sets the bulge value for a given segment of a polyline or lightweight polyline.

Syntax

object.SetBulge(Index, Bulge)

Where:

object is an IntelliCAD polyline or lightweight polyline object;

Index is a Long integer variable (or value) specifying the polyline segment;

Bulge is a double-precision variable (or value) representing the bulge factor.

Examples ...

GetBulge method example


SetCorner method

Sets a specified corner of a 3DFace entity.

Syntax

object.SetCorner(Index, Point)

Where:

object is a 3DFace object;

Index is an integer value representing the corner number of the 3D face.

Point is a point object representing the new point location.


SetGridSpacing method

Sets or returns the grid spacing value for the viewport.

Syntax

object.SetGridSpacing(Xspacing, Yspacing)

Where:

object is an IntelliCAD Viewport or PViewport object;

Xspacing and Yspacing are double-precision variables (or values) representing the spacing of grids along the x and y axes.

Examples ...

SetGridSpacing method example


SetGridSpacing method example

Sub Example_SetGridSpacing()

' This example sets the current X- and Y-grid spacing to 2.

Dim viewportObj As IntelliCAD.Viewport

Set viewportObj = ThisDocument.ActiveViewport

' Turn on the grid and reset the viewport to see it come on.

viewportObj.GridOn = True

ThisDocument.ActiveViewport = viewportObj

' Set the current grid spacing

viewportObj.SetGridSpacing 2, 2

ThisDocument.ActiveViewport = viewportObj

End Sub


SetInvisibleEdge method

Sets the visibility for a 3DFace edge at a given index.

Syntax

object.SetInvisibleEdge(Index, State)

Where:

object is an IntelliCAD Viewport or PViewport object;

Index is an Integer representing the index number of the face;

State is a Boolen variable specifying whether the visibility is on (True) or off (False).

Examples ...

SetInvisibleEdge method example


SetLispVariable method

Sets the value of a LISP variable.

Syntax

Sub SetLispVariable(Name, Value)

Where:

Name is a string representing the name of the variable.


SetPattern method

Sets the pattern name and type of the hatch.

Syntax

object.SetPattern(Type,PatternName)

Where:

object is the name of the object to be deleted;.

Type is one of the following IntelliCAD HatchTypes:

vicHatchPatternTypeCustomDefined = 2

vicHatchPatternTypePreDefined = 1

vicHatchPatternTypeUserDefined = 0

PatternName is a string identifying the pattern.


SetSnapSpacing method

Sets or returns the snap spacing value for the viewport.

Syntax

object.SetSnapSpacing(Xspacing As Double, Yspacing As Double)

Where:

object is an IntelliCAD Viewport or PViewport object;

Xspacing and Yspacing are double-precision variables (or values) representing the snap spacing along the x and y axes.

Examples ...

SetSnapSpacing method example


SetSnapSpacing method example

Sub Example_SetSpacing()

' This example sets the current X- and Y-snap spacing to 0.5.

Dim viewportObj As IntelliCAD.Viewport

Set viewportObj = ThisDocument.ActiveViewport

' Turn on the grid and reset the viewport to see it come on.

viewportObj.GridOn = True

ThisDocument.ActiveViewport = viewportObj

' Set the current snap spacing

viewportObj.SetSnapSpacing 0.5, 0.5

ThisDocument.ActiveViewport = viewportObj

End Sub


SetVariable method

Sets the value of the specified system variable.

Syntax

Sub SetVariable(Name, Value)

Where:

Name is a string representing the name of the variable.


SetView method

Sets the view to a saved view in the Views collection.

Syntax

Sub SetView(View)

Where:

View is an IntelliCAD View object.


SetWidth method

Sets the start and end width for a polyline or lightweight polyline.

Syntax

object.GetWidth(Index, StartWidth, EndWidth)

Where:

object is an IntelliCAD polyline or lightweight polyline object;

Index is a Long integer variable (or value) specifying the polyline segment.

StartWidth and EndWidth are double-precision variables representing the starting width and ending width, respectively, of the polyline.

Examples ...

GetWidth method example


SetWindowRect method

Gets the size and position of the client area of the window.

Syntax

object.SetWindowRect(Left, Top, Width, Height)

Where:

object is an IntelliCAD Window object;

Left is a Long integer variable defining the left position of the window;

Top is a Long integer variable defining the top position of the window;

Width is a Long integer variable defining the width of the window;

Height is a Long integer variable defining the height of the window.


SetXData method

Sets the extended entity data (Xdata) associated with an entity.

VBA sees XData as a pair of arrays. The first array tells you what type of data (e.g., string or 3D point) is in the corresponding location in the second array (e.g., "Hi there" or 3,0,0). To get an entity's XData, you pass two empty arrays to GetXData. GetXData populates these arrays with the entity's XData. You can then iterate through the arrays and read the data. VBA uses the same datatype codes (1000 for a string, 1003 for a layer name, and so on) as LISP.

Syntax

Sub SetXData(TypeArray, DataArray)

Examples ...

SetXData method example


Split method

Splits the viewport based on the split type specified.

Syntax

object.Split(NumberOfWindows)

Where:

object is an IntelliCAD Viewport or PViewport object;

NumberOfWIndows is one of the following IntelliCAD ViewportSplitType values:

vicViewport2Horizontal = 0

vicViewport2Vertical = 1

vicViewport3Above = 6

vicViewport3Belowl = 7

vicViewport3Horizontal = 4

vicViewport3Left = 2

vicViewport3Right = 3

vicViewport3Vertical = 5

vicViewport3 = 8


SubtractVectors method

Syntax

objectVariable = object.SubtractVectors(Vector1, Vector2)

Where:

object is the IntelliCAD Library object;

Vector1 is the IntelliCAD Vector object to be subtracted from;

Vector2 is the IntelliCAD Vector object to be subtracted.

Examples ...

AddVectors method example


TransformBy method

Applies a rigid motion transformation to an object.

Syntax

object.TransformBy(Matrix)

Where:

object is a SelectionSet object;

Matrix is a Matrix object;


UndefineFunction method

Removes a previously defined VBA macro from the IntelliCAD command list.

Syntax

Sub UndefineFunction(FunctionName)

Where:

FunctionName is a string variable representing the name of the macro.


Unload method

Unloads the External Reference.

Syntax

object.Unload()

Where:

object is a Block or Global object.

Examples ...

Unload method example


Unload method example

Private Sub Unload_Example()

Dim b As Block

Set b = ActiveDocument.Blocks(1)

b.Unload

MsgBox "Blocks(1) has been unloaded."

End Sub


UnloadSDS method

Unloads a specified SDS application.

Syntax

Sub UnloadSDS(ApplicationName As String)

Where:

ApplicationName is a string variable representing the name of the SDS application to unload.


Update method

Updates the display of the object.

Syntax

object.Update()

Where:

object is an entity or selection set.


VectorCrossProduct method

Calculates the cross product of two vectors (Vector1 X Vector2).

Syntax

objectVariable = object.VectorCrossProduct(Vector1, Vector2)

Where:

object is the IntelliCAD Library object;

Vector1 and Vector2 are IntelliCAD Vector objects to be multiplied together.


VectorDotProduct method

Calculates the dot product of two vectors.

Syntax

objectVariable = object.VectorDotProduct(Vector1, Vector2)

Where:

object is the IntelliCAD Library object;

Vector1 and Vector2 are IntelliCAD Vector objects to be multiplied together.


VectorLength method

Calculates the length of a vector.

Syntax

objectVariable = object.VectorLength(Vector)

Where:

object is the IntelliCAD Library object;

Vector is an IntelliCAD Vector object.


VectorScalarMultiply method

Multiplies a vector with a scalar value.

Syntax

objectVariable = object.VectorScalarMultiply(Vector, Scale)

Where:

object is the IntelliCAD Library object;

Vector is an IntelliCAD Vector object;

Scalar is a double-precision variable (or value) to multiply the vector by.


VectorUnitize method

Makes a vector into a Unit vector.

Syntax

objectVariable = object.VectorUnitize(Vector)

Where:

object is the IntelliCAD Library object;

Vector is an IntelliCAD Vector object.


WBlock method

Writes out the block as a drawing file. You pass in a selection set containing the blocks to be written out.

Syntax

Sub WBlock(FileName, SelectionSet, [Origin])

Where:

FileName is a string variable representing the name of the file to be created.

SelectionSet is an IntelliCAD selection set containing the blocks to be written.

Origin is an optional Point object identifying the origin of the block.


ZoomAll method

Displays the complete drawing in the current viewport.

Syntax

object.ZoomAll()

Where:

object is an IntelliCAD Viewport or PViewport object.

Examples ...

ZoomAll method example


ZoomAll method example

Private Sub ZoomAll_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then zooms out using the ZoomAll method.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim mtextObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set mtextObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

mtextObj.Update

ThisDocument.ActiveViewport.ZoomAll

End Sub


ZoomCenter method

Displays the drawing at a given center point and specified zoom factor.

Syntax

object.ZoomCenter(Center, ZoomFactor)

Where:

object is an IntelliCAD Viewport or PViewport object;

Center is an IntelliCAD Point object;

ZoomFactor is a double-precision variable (or value) representing the magnification factor.

Examples ...

ZoomCenter method example


ZoomCenter method example

Sub ZoomCenter_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then zooms to the center of the drawing.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim mtextObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set mtextObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

mtextObj.Update

ThisDocument.ActiveViewport.ZoomCenter insPt, 20

End Sub


ZoomExtents method

Displays the drawing extents.

Syntax

object.ZoomExtents()

Where:

object is an IntelliCAD Viewport or PViewport object.

Examples ...

ZoomExtents method example


ZoomExtents method example

Sub ZoomExtents_Example()

'This example adds a sphere to the drawing using the AddSphere method.

' It then zooms to the extents of the drawing.

Dim myDoc As IntelliCAD.Document

Dim sphereObj As IntelliCAD.PolygonMesh

Dim pt As Point

Set myDoc = ActiveDocument

Set pt = Library.CreatePoint(4, 4, 0)

Set sphereObj = ThisDocument.ModelSpace.AddSphere(pt, 5)

sphereObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


ZoomPickWindow method

Zooms into an area picked in a screen window.

Syntax

object.PickWindow ()

Where:

object is an IntelliCAD Viewport or PViewport object.

Examples ...

ZoomPickWindow method example


ZoomPickWindow method example

Private Sub ZoomPickWindow()

' This example creates a line and adds it to the drawing using the AddLine

' method. It then uses the ZoomPickWindow method to zoom in on a desired window.

Dim myDoc As IntelliCAD.Document

Dim myLine As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

myLine.Update

Me.hide

ThisDocument.ActiveViewport.ZoomPickWindow

End Sub


ZoomScaled method

Displays the drawing at a user specified zoom scale factor.

Syntax

object.ZoomScaled(Scale, ScaleType)

Where:

object is an IntelliCAD Viewport or PViewport object;

Scale is a double-precision variable or value representing the scale factor to use for zooming;

ScaleType is one of the following constants that determines how the scale factor is applied:

vicZoomScaledAbsolute = 0 (scaled absolutely, relative to the drawing limits)

vicZoomScaledRelative = 1 (relative to the current view)

vicZoomScaledRelativePSpace = 2 (relative to paper space units)

Examples ...

ZoomScaled method example


ZoomScaled method example

Private Sub ZoomScaledExample()

' This example creates a line and adds it to the drawing using the AddLine

' method. It then uses the ZoomScaled method to zoom in at a desired scale.

Dim myDoc As IntelliCAD.Document

Dim myLine As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

myLine.Update

Me.hide

ThisDocument.ActiveViewport.ZoomScaled 0.5, vicZoomScaledRelative

End Sub


ZoomWindow method

Zooms into an area bounded by a window.

Syntax

object.ZoomWindow(LowerLeft, UpperRight)

Where:

object is an IntelliCAD Viewport or PViewport object;

LowerLeft and UpperRight are IntelliCAD Point objects representing the corners of the window to display.

Examples ...

ZoomWindow method example


ZoomWindow method example

Private Sub ZoomWindow_Example()

' This example creates a line and adds it to the drawing using the AddLine

' method. It then uses the ZoomWindow method to zoom in on a window.

Dim myDoc As IntelliCAD.Document

Dim myLine As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Dim PtLL As IntelliCAD.Point

Dim PtUR As IntelliCAD.Point

Set myDoc = Application.ActiveDocument

Set myLine = myDoc.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

Set PtLL = Library.CreatePoint(0, 0, 0)

Set PtUR = Library.CreatePoint(10, 10, 0)

myLine.Update

Me.hide

ThisDocument.ActiveViewport.ZoomWindow PtLL, PtUR

End Sub


Activate method example

Private Sub ActivateExample()

' The following example successively activates each open drawing.

For Each doc In Application.Documents

doc.Activate

MsgBox "The following document is active: " & doc.Name

Next doc

End Sub


AddPViewport method example

Private Sub CommandButton10_Click()

Dim myViewport As IntelliCAD.PViewport

Dim cenPt As IntelliCAD.Point

Set cenPt = Library.CreatePoint(4, 4, 0)

ThisDocument.ActiveSpace = vicPaperSpace

Set myViewport = ThisDocument.PaperSpace.AddPViewport(cenPt, 33, 44)

ThisDocument.Regen vicAllViewports

End Sub


RunCommand method example

Private Sub RunCommandExample()

' This example demonstrates using the RunCommand method to draw a line.

RunCommand "Line"

Me.hide

Application.ActiveWindow.Visible = True

End Sub


AddImage method example

Private Sub CommandButton12_Click()

'This example adds an image to the drawing and determines its properties.

Dim insPoint As IntelliCAD.Point

Dim scalefactor As Double

Dim rotationAngle As Double

Dim imageName As String

Dim rasterObj As IntelliCAD.Image

' Select the image.

imageName = "C:\Program Files\IntelliCAD2001\Samples\Dallas.bmp"

Set insPoint = Library.CreatePoint(4, 2, 0)

scalefactor = 1

rotationAngle = 0

' Add the image in model space

Set rasterObj = ThisDocument.ModelSpace.AddImage(imageName, insPoint, scalefactor, rotationAngle)

rasterObj.Update

ThisDocument.ActiveViewport.ZoomExtents

' Determine properties of the image

MsgBox "The image file is: " & rasterObj.ImageFile

MsgBox "The image height is: " & rasterObj.ImageHeight & Chr(13) & "The image width is: " & rasterObj.ImageWidth

MsgBox "The image visibility is: " & rasterObj.ImageVisibility

End Sub


ExportPlotProperties method

Exports the plot properties to a designated file.

Syntax

object.ExportPlotProperties Filename

Where:

object is a PlotManager object;

Filename is a String representing the name of the file.

Examples ...

ExportPlotProperties method example


ExportPlotProperties method example

Private Sub ExportPlotProps_Example()

' This example exports plot properties to a specified file.

IntelliCAD.PlotManager.ExportPlotProperties "plotprops.txt"

End Sub


GetPaperSize method

Returns the dimensions of the paper.

Syntax

object.GetPaperSize Length, Width

Where:

object is a PlotManager object;

Length and Width are double-precision variables representing the length and width of the paper in the applicable units (inches or millimeters).


GetWindow method

Returns the coordinates of the windowed plotting area.

Syntax

object.GetWindow FromX, FromY, ToX, ToY

Where:

object is a PlotManager object;

FromX and FromY are double-precision variables representing the lower-left X and Y coordinates of the window.

ToX and ToY are double-precision variables representing the upper-right X and Y coordinates of the window.

Examples ...

GetWindow method example


GetWindow and SetWindow methods example

Private Sub Get/SetWindow_Example()

' This example gets and resets the window coordinates.

Dim fx As Double

Dim fy As Double

Dim tx As Double

Dim ty As Double

IntelliCAD.PlotManager.GetWindow fx, fy, tx, ty

MsgBox "Lower Left X = : " & fx & "Lower Left Y = : " & fy & Chr(13) & "Upper Right X = : " & tx & "Upper Right Y = : " & ty

IntelliCAD.PlotManager.SetWindow fx + 1, fy + 1, tx + 1, ty + 1

IntelliCAD.PlotManager.GetWindow fx, fy, tx, ty

MsgBox "Lower Left X = : " & fx & "Lower Left Y = : " & fy & Chr(13) & "Upper Right X = : " & tx & "Upper Right Y = : " & ty

End Sub


ImportPlotProperties method

Imports plot properties from a designated file.

Syntax

object.ImportPlotProperties Filename

Where:

object is a PlotManager object;

Filename is a String representing the name of the file.

Examples ...

ImportPlotProperties method example


ImportPlotProperties method example

Private Sub ImportPlotProps_Example()

' This example exports plot properties to a specified file.

Dim PFname As String

PFname = InputBox("Type a file name")

IntelliCAD.PlotManager.ImportPlotProperties PFname

End Sub


Preview method

Previews the document to be printed through the PlotManager object.

Syntax

object.Preview

Where:

object is a PlotManager object.


Print method

Prints the document through the PlotManager object.

Syntax

object.Print

Where:

object is a PlotManager object.


SetPaperSize method

Sets the dimensions of the paper.

Syntax

object.SetPaperSize Length, Width

Where:

object is a PlotManager object;

Length and Width are double-precision variables representing the length and width of the paper in the applicable units (inches or millimeters).


SetWindow method

Sets the coordinates of the windowed plotting area.

Syntax

object.SetWindow FromX, FromY, ToX, ToY

Where:

object is a PlotManager object;

FromX and FromY are double-precision variables representing the lower-left X and Y coordinates of the window.

ToX and ToY are double-precision variables representing the upper-right X and Y coordinates of the window.

Examples ...

SetWindow method example


ActiveDocument property

Returns the ActiveDocument object.

Syntax

objectVariable = object.ActiveDocument

Where:

objectVariable is a variable representing a Document object.

object is the Application object.

Examples ...

ActiveDocument property example


ActiveDocument property example

This example shows how to return the name of the active document.

Private Sub ActiveDocPropExample()

Dim activeDoc As Document

Set activeDoc = Application.ActiveDocument

MsgBox "The active document is: " & activeDoc.Name, vbInformation, "ActiveDocument Example"

End Sub


ActiveWindow property

Returns the active window object.

Syntax

objectVariable = object.ActiveWindow

Where:

objectVariable is a variable representing a Window object.

object is the Application object.

Examples ...

ActiveWindow property example


ActiveWindow property example

Private Sub ActiveWindowExample()

Msg = "Want to close the active window?"

Title = "ActiveWindow Example"

Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.

Response = MsgBox(Msg, Style, Title)

If Response = vbYes Then ' User chose Yes.

Application.ActiveWindow.Close

End If

End Sub


Application property

Returns the application object.

Syntax

objectVariable = object.Application

Where:

objectVariable is a variable representing an Application object.

object is a valid object.

Examples ...

Application property example


Application property example

The following example demonstrates how to return the Application property.

Private Sub ApplicationPropExample()

Dim myObject As Application

Set myObject = Application

MsgBox ("Application is: " & myObject.Name)

End Sub


Area property

Returns the area of an arc, circle, ellipse, polyline, or spline.

Syntax

DoubleVariable = object.Area

Where:

DoubleVariable is a double-precision variable;

Object is an Arc, Circle, Ellipse, Polyline, or Spline object.

Examples ...

Area property example


Area / Radius properties example

Private Sub AreaExample()

' This example adds an arc to the drawing and returns the area & radius.

Dim icadDoc As IntelliCAD.Document

Dim myArc As Arc

Dim cenPt As IntelliCAD.Point

Dim myObj As Object

Dim myArea As Double

Dim myRad As Double

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3.52, 1, 3)

' Display the entity

myArc.Update

myArea = myArc.Area

myRadius = myArc.Radius

MsgBox "Area = " & myArea & Chr(13) & "Radius = " & myRadius

End Sub


Center property

Sets or returns the center point of an arc, circle, ellipse, or viewport.

Syntax

ObjectVariable = object.Center

Where:

ObjectVariable is a variable representing a Point object;

Object is an Arc, Circle, Ellipse, or Viewport object.

Examples ...

Center property example


Center property example

Private Sub CenterpropertyExample()

' This example adds an arc to the drawing and returns the center point.

Dim icadDoc As IntelliCAD.Document

Dim myArc As Arc

Dim cenPt As IntelliCAD.Point

Dim myObj As Object

Dim myCenPt As IntelliCAD.Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

Set myCenPt = myArc.Center

MsgBox "x = " & myCenPt.x & Chr(13) & "y = " & myCenPt.y & Chr(13) & "z = " & myCenPt.z, , "Arc Center Point"

End Sub


Closed property

Sets or returns if the entity is closed.

Syntax

BooleanVariable = object.Closed

Where:

BooleanVariable specifies whether the object is closed (True) or not (False).

object is the entity object for which you set or return the Closed property.

Examples ...

Closed property example


Color property

Sets or returns the color of an entity.

Colors can be set and read as numeric index values ranging from 0 to 256. For the standard seven colors and the ByBlock and ByLayer designations, you can also use constants shown below. The default color designation is ByLayer (0).

Syntax

integerVariable = object.Color

object.Color = <integer>

where:

integerVariable is a variable for storing the color index value.

object is the entity object for which you set or return the color.

Colors Constant | Index Value
VicBlue | 5
VicByBlock | 0
VicByLayer | 256
vicBy ColorXOr | 1
vicCyan | 4
vicGreen | 3
vicMagenta | 6
vicRed | 1
vicVarious | -2
vicWhite | 7
vicYellow | 2

Examples ...

Color property example


Color property example

Private Sub ColorExample()

'This example demonstrates how to return and change the Color property.

Dim ents As Object

Dim ent As Object

Dim NewColor As Integer

Dim Response

Dim ct As Long

Dim x as Long

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

MsgBox "No. of entities = " & ct

For x = 1 To ct

Set ent = ents.Item(x)

Response = MsgBox("Color of entity is: " & ent.Color & Chr(13) & "Do you want to change it?", vbYesNo, "Color of Entities")

If Response = vbYes Then

NewColor = InputBox("New color [0-256]:")

ent.Color = NewColor

ent.Update

End If

' Display message.

Response = MsgBox("Continue listing entities?", vbYesNo, "Color of Entities")

If Response = vbNo Then GoTo Regener

Next x

Regener:

' User chose to exit.

End

End Sub


Coordinates property

Sets or returns the coordinates of one of the following entities:

3Dface; Leader; LWPolyline; PointEntity; PolyfaceMesh; PolygonMesh; Polyline; 3Dpolyline; Solid; or Trace.

Syntax

objectVariable = object.Coordinates

Where:

objectVariable is a variable for storing the coordinates.

object is the entity object for which you set or return the coordinates.

Examples ...

Coordinates property example


Coordinates property example

Private Sub CoordinatesExample()

' This example adds a point entity to and returns the coordinates.

Dim icadDoc As IntelliCAD.Document

Dim myPoint As IntelliCAD.Point

Dim myPtEnt As IntelliCAD.PointEntity

Set icadDoc = ActiveDocument

Set myPoint = Library.CreatePoint(4, 2)

Set myPtEnt = icadDoc.ModelSpace.AddPointEntity(myPoint)

myPtEnt.Update

MsgBox "x = " & myPtEnt.Coordinates.x & Chr(13) & "y = " & myPtEnt.Coordinates.y & Chr(13) & "z = " & myPtEnt.Coordinates.z

End Sub


Count property

Returns the number of items in the collection, group, or selection set.

Syntax

IntegerVariable = object.Count

Where:

integerVariable is a Long integer variable for storing the Count value.

object is a collection object.

Examples ...

Count property example


Count and Item Properties example

Private Sub CountExample()

' This example demonstrates how to count the number of entities using

' the Count property. It also uses the Item property to return the

' next-to-last entity and change the color of this entity.

Dim ents As Object

Dim ent As Object

Dim ct As Long

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

MsgBox "No. of entities = " & ct

Set ent = ents.Item(ct - 1)

MsgBox "Color of this entity is now: " & ent.Color

ent.Color = 3

MsgBox "Color of this entity has been changed to: " & ent.Color

ent.Update

End Sub


DefaultFilePath property

Sets or returns the default path used for opening files.

Syntax

stringVariable = object.DefaultFilePath

object.DefaultFilePath = <string>

Where:

stringVariable is a variable for storing the name of the path.

object is the Application object.


Document property

Returns the document associated with the object.

Syntax

stringVariable = object.Document

Where:

stringVariable is a variable for storing the color index value.

object is the entity object for which you return the Document property.

Examples ...

Document property example


Document property example

Dim myDoc As IntelliCAD.Document

Dim myPt As IntelliCAD.Point

Set myPt = Library.CreatePoint(3, 2, 0)

Set myPtEnt = ThisDocument.ModelSpace.AddPointEntity

Set myDoc = myPtEnt.Document

MsgBox "The point is located in: " & myDoc.Name

End Sub


Documents property

Returns the documents collection object.

Syntax

objectVariable = Application.Documents

Examples ...

Documents property example


Documents property example

The following example demonstrates how to use the Documents property to return the number of documents in the document collection object.

Private Sub DocumentsPropExample()

Dim myDoc As Document

Dim nodocs As Integer

nodocs = Application.Documents.Count

MsgBox "No. of documents = " & nodocs

End Sub


EndAngle property

Sets or returns the ending angle of an arc or ellipse.

Syntax

DoubleVariable = object.EndAngle

Where:

DoubleVariable is a double-precision variable representing an angle (in degrees);

Object is an Arc or Ellipse object.

Examples ...

EndAngle property example


Start / EndAngle properties example

Private Sub EndAngleExample()

' This example adds an arc to the drawing and returns the start & end angles.

Dim icadDoc As IntelliCAD.Document

Dim myArc As Arc

Dim cenPt As IntelliCAD.Point

Dim myObj As Object

Dim myStartAng As Double

Dim myEndAng As Double

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

myStartAng = myArc.StartAngle

myEndAng = myArc.EndAngle

MsgBox "Start Angle = " & myStartAng & Chr(13) & "End Angle = " & myEndAng, , "Arc Angles"

End Sub


EndPoint property

Returns the end point of an arc, ellipse, or line.

Syntax

ObjectVariable = object.EndPoint

Where:

ObjectVariable is a variable representing a Point object;

Object is an Arc, Ellipse, or Line object.

Examples ...

EndPoint property example


EndPoint property example

Private Sub EndPointExample()

' This example adds an arc and returns the start and end points.

Dim icadDoc As IntelliCAD.Document

Dim myArc As Arc

Dim cenPt As IntelliCAD.Point

Dim myObj As Object

Dim myStartPt As Point

Dim myEndPt As Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

Set myStartPt = myArc.StartPoint

Set myEndPt = myArc.EndPoint

MsgBox "Start Point = " & myStartPt.x & ", " & myStartPt.y & ", " & myStartPt.z & Chr(13) & "End Point = " & myEndPt.x & ", " & myEndPt.y & ", " & myEndPt.z, , "Arc Points"

End Sub


EntityName property

Returns the class name of the entity.

Syntax

stringVariable = object.EntityName

Where:

stringVariable is a variable for storing the entity name.

object is a valid entity object.

Examples ...

EntityName property example


EntityName property example

Private Sub EntityNameExample()

' This example returns the EntityName property for drawing entities.

Dim ents As Object

Dim ent As Object

Dim ct As Integer

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

MsgBox "No. of entities = " & ct

Set ent = ents.Item(ct)

MsgBox "The EntityName property for the last entity is: " & ent.EntityName

End Sub


EntityType property

Returns the type of entity for a selected object. The property is returned as an integer value, as shown in the table below.

Syntax

integerVariable = object.EntityType

Where:

integerVariable is a variable for storing the entity type value.

object is a valid entity object.

Entity Types | Value
Attribute | 4
AttributeDef | 5
BlockInsert | 6
Circle | 7
Dimension (3-pt Angular) | 8
Dimension (Aligned) | 9
Dimension (Angular) | 10
Dimension (Diametric) | 11
Dimension (Ordinate) | 12
Dimension (Radial) | 13
Dimension (Rotated) | 14
Hatch | 9
3dFace | 1
3dPoly | 2
Arc | 3
Ellipse | 15
ExternalReference | 16
Hatch | 17
Image | 18
InfiniteLine | 19
Leader | 20
Line | 21
LWPolyline | 22
Mtext | 23
PointEntity | 24
PolyfaceMesh | 27
PolygonMesh | 26
Polyline | 25
Pviewport | 28
Ray | 29
Solid | 30
Spline | 31
Text | 32
Tolerance | 33
Trace | 34
UnknownEntity | 0

Examples ...

EntityType property example


EntityType property example

Private Sub EntityTypeExample()

' This example returns the EntityType property for drawing entities.

Dim ents As Object

Dim ent As Object

Dim ct As Integer

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

MsgBox "No. of entities = " & ct

Set ent = ents.Item(ct)

MsgBox "The EntityType property for the last entity is: " & ent.EntityType

End Sub


Flags property

Sets or returns the invisible edge flags for a 3DFace object.

Syntax

integerVariable = object.Flags

Where:

integerVariable is a Long integer variable for storing the Flags property.

object is the applicable entity object;

Examples ...

Flags property example


Flags property example

Private Sub FlagsExample()

'This example returns the Flags property for any 3dFace objects.

Dim ents As IntelliCAD.Entities

Dim ent As Object

Dim FaceCorner As Point

Set ents = ActiveDocument.Entities

For Each ent In ents

Select Case ent.EntityType

Case Icad3dFace

MsgBox "The Flags property for this 3dFace is: " & ent.Flags

End Select

Next ent

End Sub


FullName property

Returns the name (including the path) of the application.

Syntax

stringVariable = object.FullName

Where:

stringVariable is a variable for storing the FullName.

object is the Application object.

Examples ...

FullName property example


FullName property example

The following example demonstrates how to return the FullName property.

Private Sub FullNamePropExample()

Dim myName As String

myName = Application.FullName

MsgBox ("Name is: " & myName)

End Sub


Handle property

Returns the handle of the item.

Syntax

stringVariable = object.Handle

Where:

stringVariable is a variable for storing the Handle.

object is a valid entity object.

Examples ...

Handle property example


Handle property example

Private Sub HandleExample()

Dim myPt As IntelliCAD.Point

Set myPt = Library.CreatePoint(3, 2, 0)

Set myPtEnt = ThisDocument.ModelSpace.AddPointEntity

MsgBox "The handle of this entity is: " & myPtEnt.Handle

End Sub


Height property

Sets or returns the height of the object window, such as that of the Application object or the Viewport object.

Syntax

integerVariable = object.Height

Where:

integerVariable is a Long integer variable for storing the Height property (in drawing units).

object is the Application object.

Examples ...

Height property example


Height property example

The following example demonstrates how to return the Height property.

Private Sub HeightPropExample()

Dim myHeight As Double

myHeight = Application.Height

MsgBox ("Height is: " & myHeight)

End Sub


HorizontalAlignment property

Property HorizontalAlignment As HorizontalAlignment

Sets or returns the horizontal alignment for the attribute. It is set or returned using the HorizontalAlignment constants shown below. The default property is vicHorizontalAlignmentLeft (0).

Syntax

integerVariable = object.HorizontalAlignment

object.HorizontalAlignment = <integer>

where:

integerVariable is a variable (or the constant itself) representing the horizontal alignment value.

object is the entity object for which you set or return the color.

Horizontal Alignment Constant | Index Value
VicHorizontalAlignmentAligned | 3
VicHorizontalAlignmentCenter | 1
VicHorizontalAlignmentFit | 5
VicHorizontalAlignmentLeft | 0
VicHorizontalAlignmentMiddle | 4
VicHorizontalAlignmentRight | 2


HorizontalAlignment property example

Private Sub HorizAlignmt_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains the HorizontalAlignment and

' VerticalAlignment properties.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomCenter insPt, 20

MsgBox "HorizontalAlignment property is: " & textObj.HorizontalAlignment & Chr(13) & "VerticalAlignment property is: " & textObj.VerticalAlignment

End Sub


InsertionPoint property

Sets or returns the insertion point for one of the following objects: Attribute; AttributeDef; BlockInsert; ExternalReference; MText; Text; Tolerance.

Syntax

objectVariable = object.InsertionPoint

where:

objectVariable represents a Point object for storing the InsertionPoint.

object is one of the objects that has an InsertionPoint property.

Examples...

InsertionPoint property example


InsertionPoint property example

Private Sub InsertionPoint_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains the InsertionPoint and TextAlignmentPoint properties.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomCenter insPt, 20

MsgBox "Insertion Point: " & Chr(13) & "x = " & textObj.InsertionPoint.x & Chr(13) & "y = " & textObj.InsertionPoint.y & Chr(13) & "z = " & textObj.InsertionPoint.z

MsgBox "Text Alignment Point: " & Chr(13) & "x = " & textObj.TextAlignmentPoint.x & Chr(13) & "y = " & textObj.TextAlignmentPoint.y & Chr(13) & "z = " & textObj.TextAlignmentPoint.z

End Sub


Item property

Returns the member object at a given index in a collection, group, or selection set.

Syntax

objectVariable = object.Item(Index)

Where:

objectVariable is a variable representing the Item property.

object is the Application object;

Index is a Long integer representing the index number of the item.

Examples ...

Item property example


Layer property

Sets or returns the layer of an entity. If you don't specify a layer, the current active layer is used for a new entity. If a layer is specified for an entity, the current active layer is ignored. Each layer has associated properties that can be set and queried through the Layer object.

Syntax

stringVariable = object.Layer

object.Layer = <string>

Where:

stringVariable is a variable for storing the layer name.

object is the applicable entity object;

string is the name of a layer to be assigned to an entity.

Examples ...

Layer property example


Layer property example

Private Sub LayerpropertyExample()

'This example returns the Layer property.

Dim ents As Object

Dim ent As Object

Dim ct As Long

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

Set ent = ents.Item(ct)

MsgBox "The Layer property for the last entity is: " & ent.Layer

End Sub


Left property

Sets or returns the distance between the left edge of the window and the left edge of the screen.

Syntax

integerVariable = object.Left

Where:

integerVariable is a Long integer variable for storing the Left property.

object is the Application object.

Examples ...

Left property example


Left property example

Private Sub LeftExample()

' This example demonstrates how to set and return the Left property.

Dim myLeft As Integer

Application.Left = 2

MsgBox ("Left is: " & Application.Left)

End Sub


Length property

Returns the length of one of the following IntelliCAD objects:

Arc; Ellipse; Line; LWPolyline; Polyline; 3Dpolyline; Spline.

Syntax

doubleVariable = object.Length

Where:

doubleVariable is a double-precision variable for storing the length;

object is the applicable entity object.

Examples ...

Length property example


Length/Closed Properties example

Sub Length/ClosedExample()

' This example adds a polyline to the drawing using the AddPolyline method.

' It then obtains the Length and Closed properties of the polyline.

Dim myDoc As IntelliCAD.Document

Dim myPline As Polyline

Dim myPoints As points

Dim pt As Point

Set myDoc = ActiveDocument

Set myPoints = Library.CreatePoints

Set pt = Library.CreatePoint(1, 1, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set pt = Library.CreatePoint(5, 3, 0)

myPoints.Add

myPoints(myPoints.Count).x = pt.x

myPoints(myPoints.Count).y = pt.y

myPoints(myPoints.Count).z = pt.z

Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints)

MsgBox "The length of the new polyline is: " & myPline.Length

MsgBox "The Closed property is: " & myPline.Closed

myPline.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


Library property

Returns the Library object.

Syntax

objectVariable = object.Library

Where:

objectVariable is a variable representing a Library object.

object is the Application object.

Examples ...

Library property example


Library property example

The following example demonstrates how to use the Library property to return the name of the Parent property.

Private Sub LibraryPropExample()

Dim icadDoc As IntelliCAD.Document

Dim libObj As String

libObj = Application.Library.Parent.Name

MsgBox "Name is: " & libObj

End Sub


Linetype property

Sets or returns the linetype of an entity. The default linetype is the linetype of the layer (BYLAYER).

Syntax

stringVariable = object.Linetype

object.Linetype = <string>

Where:

stringVariable is a variable for storing the linetype name.

object is the applicable entity object;

string is the name of a linetype to be assigned to an entity.

Examples ...

LineType property example


Linetype property example

Private Sub LinetypepropertyExample()

'This example returns the Linetype property.

Dim ents As Object

Dim ent As Object

Dim ct As Long

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

Set ent = ents.Item(ct)

MsgBox "The Linetype property for the last entity is: " & ent.Linetype

End Sub


LinetypeScale property

Sets or returns the linetype scale of an entity. The linetype scale of an object specifies the relative length of dash-dot linetypes per drawing unit.

The value is a positive real number. The default is 1.0

Syntax

doubleVariable = object.LinetypeScale

object.LinetypeScale = <double>

Where:

doubleVariable is a double-precision variable or number for storing the linetype scale.

object is the applicable entity object;

double is the value of the linetype scale.

Examples ...

LineTypeScale property example


LinetypeScale property example

Private Sub LinetypeScalepropertyExample()

'This example returns the LinetypeScale property.

Dim ents As Object

Dim ent As Object

Dim ct As Long

Set ents = ActiveDocument.ModelSpace

ct = ents.Count

Set ent = ents.Item(ct)

MsgBox "The LinetypeScale property for the last entity is: " & ent.LinetypeScale

End Sub


Name property

Returns the name of an object, such as the application, document, block, layer, view.

Syntax

stringVariable = object.Name

Where:

stringVariable is a variable for storing the Name property.

object is an Application, Block, Document, DimStyle, Layer, Linetype, SelectionSet, TextStyle, UserCoordSystem, View, or Viewport object.

Examples ...

Name property example


Name property example

The following example demonstrates how to return the Name property for the Application object.

Private Sub NamePropExample()

Dim myName As String

myName = Application.Name

MsgBox ("Application Name is: " & myName)

End Sub


Normal property

Property Normal As Vector

Sets or returns the Extrusion Direction vector for the entity.

Syntax

objectVariable = object.Normal

object.Normal = <objectVariable>

where:

objectVariable represents a Vector object;

object is the applicable entity object;

Examples ...

Normal property example


Normal property example

Private Sub NormalExample()

' This example creates an arc and determines its Normal property.

' It then creates a vector and uses it to reset the Normal property.

Dim icadDoc As IntelliCAD.Document

Set icadDoc = ActiveDocument

Dim myArc As Arc

Dim cenPt As Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

MsgBox "Normal Vector:" & Chr(13) & "x = " & myArc.Normal.x & Chr(13) & "y = " & myArc.Normal.y & Chr(13) & "z = " & myArc.Normal.z

' Create a vector to define the new extrusion direction.

Dim Vect1 As Vector

Set Vect1 = Library.CreateVector(0, 0, 0, 1, 1, 0)

myArc.Normal = Vect1

MsgBox "New normal Vector:" & Chr(13) & "x = " & myArc.Normal.x & Chr(13) & "y = " & myArc.Normal.y & Chr(13) & "z = " & myArc.Normal.z

End Sub


ObliqueAngle property example

Private Sub Oblique_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains and resets the ObliqueAngle property.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Dim NewOblique As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Oblique Angle: " & textObj.ObliqueAngle

NewOblique = InputBox("Type a new oblique angle (in radians):")

textObj.ObliqueAngle = NewOblique

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


ObliqueAngle property

Sets or returns the oblique angle, which defines the object's "slant" away from its vertical axis.

Syntax-

doubleVariable = object.Rotation

where:

doubleVariable is a double-precision variable (or value) representing the ObliqueAngle property.

object is one of the objects that has a Rotation property.

Examples ...

ObliqueAngle property example


ContourLinesPerSurface property

Sets or returns the number of contour lines per surface for entities in a given document. The value of this property is stored in the ISOLINES system variable.

Syntax

integerVariable = object.ContourLinesPerSurface

object.ContourLinesPerSurface = <integer>

where:

integerVariable is a variable for storing the number of contour lines.

object is the DocumentPrefernces object.

Examples ...

ContourLinesPerSurface property example


ContourLinesPerSurface property example

Private Sub ContourLinesExample()

' This example obtains the current setting of the

' ContourLinesPerSurface property.

Dim ContourLines As Integer

ContourLines = ThisDocument.Preferences.ContourLinesPerSurface

MsgBox "The ContourLinesPerSurface property is: " & ContourLines

End Sub


DisplaySilhouette property

Sets or returns whether the silhouette curves of solids are displayed. The value of this property is stored in the DISPSILH system variable.

Syntax

BooleanVariable = object.DisplaySilhouette

object.DisplaySilhouette = <Boolean>

where:

BooleanVariable determines whether the curves are displayed (True) or not (False).

object is the DocumentPreferences object.

Examples ...

DisplaySilhouette property example


DisplaySilhouette property example

Private Sub DispSil_Example()

' This example returns the current setting of

' DisplaySilhouette.

Dim DispSil As Boolean

DispSil = ThisDocument.Preferences.DisplaySilhouette

MsgBox "The DisplaySilhouette property is: " & DispSil

End Sub


MaxActiveViewports property

Sets or returns the maximum number of active viewports (MAXACTVP).

Syntax

integerVariable = object.MaxActiveViewports

object.MaxActiveViewports = <integer>

where:

integerVariable is a variable for storing the number of viewports.

object is the DocumentPrefernces object.

Examples ...

MaxActiveViewports property example


MaxActiveViewports property example

Private Sub MaxAVs_Example()

' This example returns the current setting of

' MaxActiveViewports.

Dim MaxAVs As Long

MaxAVs = ThisDocument.Preferences.MaxActiveViewports

MsgBox "The MaxActiveViewports property is: " & MaxAVs

End Sub


RenderSmoothness property

Sets or returns the smoothness of shaded objects. The value of this property is stored in the FACETRES system variable. The valid range is 0.01 to 10.0, with the initial value 0.5.

Syntax

doubleVariable = object.RenderSmoothness

object.RenderSmoothness = <integer>

where:

doubleVariable is a variable for storing the RenderSmoothness.

object is the DocumentPrefernces object.

Examples ...

RenderSmoothness property example


RenderSmoothness property example

Private Sub CommandButton5_Click()

' This example returns the current setting of RenderSmoothness.

Dim RSmooth As Double

RSmooth = ThisDocument.Preferences.RenderSmoothness

MsgBox "The RenderSmoothness property is: " & RSmooth

End Sub


SegmentPerPolyline property

Property SegmentPerPolyline As Long

Sets or returns the number of line segments generated for each polyline. The value of this property is stored in the SPLINESEGS system variable. The value can range from 0 to 32767, with an initial value of 8.

Syntax

integerVariable = object.SegmentPerPolyline

object.SegmentPerPolyline = <integer>

Where:

integerVariable is a variable for storing the SegmentPerPolyline.

object is the DocumentPrefernces object.

Examples ...

SegmentPerPolyline property example


SegmentPerPolyline property example

Private Sub SegPerPline_Example()

' This example returns the current setting of SegmentPerPolyline.

Dim Segs As Long

Segs = ThisDocument.Preferences.SegmentPerPolyline

MsgBox "The SegmentPerPolyline property is: " & Segs

End Sub


SolidFill property

Sets or returns whether traces, solids and hatches are filled in. The value of this property is stored in the FILLMODE system variable. The initial value of this property is True.

Syntax

BooleanVariable = object.SolidFill

object.SolidFill = <Boolean>

Where:

BooleanVariable determines whether fill is applied (True) or not (False).

object is the DocumentPreferences object.

Examples ...

SolidFill property example


SolidFill property example

Private Sub SolidFill_Example()

' This example returns the current setting of SolidFill.

Dim SolFill As Boolean

SolFill = ThisDocument.Preferences.SolidFill

MsgBox "The SolidFill property is: " & SolFill

End Sub


TextFrameDisplay property

Sets or returns whether the frame of the text object is displayed instead of the text itself (QTEXTMODE).

Syntax

BooleanVariable = object.TextFrameDisplay

object.TextFrameDisplay = <Boolean>

Where:

BooleanVariable determines whether the frame is displayed (True) or not (False).

object is the DocumentPreferences object.

Examples ...

TextFrameDisplay property example


TextFrameDisplay property example

Private Sub TextFrame_Example()

' This example returns the current setting of TextFrameDisplay.

Dim TextDisp As Boolean

TextDisp = ThisDocument.Preferences.TextFrameDisplay

MsgBox "The TextFrameDisplay property is: " & TextDisp

End Sub


XRefLayerVisibility property

Sets or returns the visibility of layers in external references. The value of this property is stored in the VISRETAIN system variable. The initial value of this property is True.

Syntax

BooleanVariable = object.XRefLayerVisibility

object.XRefLayerVisibility = <Boolean>

Where:

BooleanVariable determines whether the Xref layer is visible (True) or not (False).

object is the DocumentPreferences object.

Examples ...

XRefLayerVisibility property example


XRefLayerVisibility property example

Private Sub XrefVis_Example()

' This example returns the current setting of XRefLayerVisibility.

Dim xrefvis As Boolean

xrefvis = ThisDocument.Preferences.XRefLayerVisibility

MsgBox "The XRefLayerVisibility property is: " & xrefvis

End Sub


ImageFile property

Sets or returns the image file name.

Syntax

stringVariable = object.ImageFile

object.ImageFile = <string>

Where:

stringVariable is a variable for storing the file name.

object is an Image object.

Examples ...

AddImage method example


ImageHeight property

Sets or returns the height of the image in current units.

Syntax

doubleVariable = object.ImageHeight

object.ImageHeight = <double>

Where:

doubleVariable is a double-precision variable (or value) representing the image height (in current units).

object is an Image object.

Examples ...

AddImage method example


ImageVisibility property

Sets or returns whether the image is visible.

Syntax

BooleanVariable = object.ImageVisibility

object.ImageVisibility = <Boolean>

where:

BooleanVariable determines whether the image is visible (True) or not (False).

object is an Image object.

Examples ...

AddImage method example


ImageWidth property

Sets or returns the width of the image in current units.

Syntax

doubleVariable = object.ImageWidth

object.ImageWidth = <double>

Where:

doubleVariable is a double-precision variable (or value) representing the image width (in drawing units).

object is an Image object.

Examples ...

AddImage method example


CenterOnPage property

Sets or returns a value determining the centering of a plot on a page.

Syntax

integerVariable = object.CenterOnPage

object.CenterOnPage = <integer>

Where:

integerVariable is a Long Integer variable (or value).

object is the PlotManager object.

Examples ...

CenterOnPage property example


CenterOnPage property example

Private Sub CenterOnPage_Example()

' This example returns the CenterOnPage property and changes it to 2.

Dim currentCntr As Long

Dim newCntr As Long

currentCntr = IntelliCAD.PlotManager.CenterOnPage

MsgBox "The CenterOnPage property is: " & currentCntr

IntelliCAD.PlotManager.CenterOnPage = 2

newCntr = IntelliCAD.PlotManager.CenterOnPage

MsgBox "The CenterOnPage property is: " & newCntr

End Sub


Footer property

Sets or returns a string for the footer of a plotted drawing.

Syntax

stringVariable = object.Footer

object.Footer = <string>

Where:

stringVariable represents the string to be placed in the footer.

object is the PlotManager object.

Examples ...

Footer property example


Footer property example

Private Sub Footer_Example()

' This example sets and returns the Footer property.

Dim myFooter As String

myFooter = InputBox("Type footer text here:")

IntelliCAD.PlotManager.Footer = myFooter

MsgBox "The Footer property is: " & IntelliCAD.PlotManager.Footer

End Sub


Header property

Sets or returns a string for the header of a plotted drawing.

Syntax

stringVariable = object.Header

object.Header = <string>

Where:

stringVariable represents the string to be placed in the header.

object is the PlotManager object.

Examples ...

Header property example


Header property example

Private Sub Header_Example()

' This example sets and returns the Header property.

Dim myHeader As String

myHeader = InputBox("Type header text here:")

IntelliCAD.PlotManager.Header = myHeader

MsgBox "The Header property is: " & IntelliCAD.PlotManager.Header

End Sub


HideLines property

Sets or returns a value determining the hidden lines in a plot.

Syntax

integerVariable = object.HideLines

object.HideLines = <integer>

Where:

integerVariable is a Long Integer variable (or value).

object is the PlotManager object.


OnlyWindowArea property

Sets or returns a value determining whether to plot a windowed area of a drawing.

Syntax

integerVariable = object.OnlyWindowArea

object.OnlyWindowArea = <integer>

Where:

integerVariable is a Long Integer variable (or value).

object is the PlotManager object.

Examples ...

OnlyWindowArea property example


OnlyWindowArea property example

Private Sub OnlyWindowArea_Example()

' This example returns/sets the OnlyWindowArea property.

Dim wArea As Long

Dim newWArea As Long

wArea = IntelliCAD.PlotManager.OnlyWindowArea

MsgBox "The OnlyWindowArea property is: " & wArea

newWArea = InputBox("Type a new value for the OnlyWindowArea:")

IntelliCAD.PlotManager.OnlyWindowArea = newWArea

MsgBox "The new OnlyWindowArea property is: " & IntelliCAD.PlotManager.OnlyWindowArea

End Sub


PaperOrientation property

Sets or returns a value determining the orientation of paper for plotting.

Syntax

objectVariable = object.PaperOrientation

object.PaperOrientation = <objectVariable>

Where:

objectVariable represents the paper orientation according to the constants shown below.

object is the PlotManager object.

Orientation Constant | Index Value
Landscape | 1
Portrait | 0


PlotProperties property

Provides access to parameters related to a plot, such as the scale, origin, and pen characteristics.

Syntax

objectVariable = object.PlotProperties

object.PlotProperties = <value>

Where:

objectVariable is a variable representing the PlotProperties.

object is the PlotManager object.

Examples ...

PlotProperties property example


PlotProperties property example

Private Sub PlotProperties_Example()

' This example obtains various plot properties.

MsgBox "The origin coordinates are: " & IntelliCAD.PlotManager.PlotProperties.OriginX & ", " & IntelliCAD.PlotManager.PlotProperties.OriginY

IntelliCAD.PlotManager.PlotProperties.OriginX = IntelliCAD.PlotManager.PlotProperties.OriginX + 1

MsgBox "The X origin is now: " & IntelliCAD.PlotManager.PlotProperties.OriginX

MsgBox "The OptimizeLevel property is: " & IntelliCAD.PlotManager.PlotProperties.OptimizeLevel

MsgBox "The number of pens is: " & IntelliCAD.PlotManager.PlotProperties.Pens.Count

MsgBox "The pen width is: " & IntelliCAD.PlotManager.PlotProperties.PenWidth

MsgBox "The Rotate property is: " & IntelliCAD.PlotManager.PlotProperties.Rotate

MsgBox "The scale is: " & IntelliCAD.PlotManager.PlotProperties.Scale

MsgBox "The units are: " & IntelliCAD.PlotManager.PlotProperties.Units

End Sub


View property

Sets or returns the name of the view contained in the PlotManager object.

Syntax

stringVariable = object.View

object.View = <string>

Where:

stringVariable is a variable representing the name of a view.

object is the PlotManager object.

Examples ...

View property example


View property example

Private Sub PlotView_Example()

' This example names a plot view and displays it in a message box.

IntelliCAD.PlotManager.View = "My View"

MsgBox "The name of the plot view is: " & IntelliCAD.PlotManager.View

End Sub


OptimizeLevel property

Sets or returns a value determining the optimization level for plotting.

Syntax

integerVariable = object.OptimizeLevel

object.OptimizeLevel = <integer>

Where:

integerVariable represents the OptimizeLevel property.

object is the PlotManager object.

Examples ...

PlotProperties property example


OriginX and OriginY properties

Sets or returns the X and Y coordinates, respectively, for the origin of a plot.

Syntax

doubleVariable = object.OriginX

doubleVariable = object.OriginY

object.OriginX = <value>

object.OriginY = <value>

Where:

doubleVariable is a double-precision variable (or value) representing the X or Y coordinate.

object is the PlotManager object.

Examples ...

PlotProperties property example


Pens property

Provides access to the PlotterPens collection object.

Syntax

objectVariable = object.Pens

Where:

objectVariable represents the collection of pens.

object is the PlotManager object.

Examples ...

PlotProperties property example


PenWidth property

Sets or returns the pen width for plotting.

Syntax

singleVariable = object.PenWidth

object.PenWidth = <single>

Where:

singleVariable is a single-precision variable representing the pen width.

object is the PlotManager object.

Examples ...

PlotProperties property example


Scale property

Sets or returns the property that determines if the drawing will be scaled to fit the page.

Syntax

stringVariable = object.Scale

object.Scale = <string>

Where:

stringVariable represents the Scale property.

object is the PlotManager object.

Examples ...

PlotProperties property example


Units property

Sets or returns the units used for plotting.

Syntax

stringVariable = object.Scale

object.Scale = <string>

Where:

stringVariable represents the Units property.

object is the PlotManager object.

Examples ...

PlotProperties property example


Number property

Sets or returns the number of a plotter pen.

Syntax

integerVariable = object.Pen

object.Pen = <integer>

Where:

integerVariable is a variable for storing the pen number.

object is the PlotterPen object.


Weight property

Sets or returns the weight of a plotter pen.

Syntax

doubleVariable = object.Weight

object.Weight = <double>

Where:

doubleVariable is a double-precision variable (or value) representing the weight of a plotter pen.

object is the PlotterPen object.


AltFontFile property

Sets or returns the alternate font file to be used.

Syntax

stringVariable = object.AltFontFile

object.AltFontFile = <string>

Where:

stringVariable is a variable for storing the name of the alternate font file.

object is the ApplicationPreferences object.

Examples ...

AltFontFile property example


AltFontFile property example

Private Sub AltFontFile_Example()

Dim myobj As ApplicationPreferences

Dim myfontfile As String

Set myobj = IntelliCAD.Preferences

myfontfile = myobj.AltFontFile

MsgBox "The alternate font file is: " & myfontfile

End Sub


AutoSaveInterval property

Sets or returns the automatic save time interval in minutes.

Syntax

integerVariable = object.AutoSaveInterval

object.AutoSaveInterval = <integer>

Where:

integerVariable is a Long Integer variable (or value) setting the interval.

object is the ApplicationPreferences object.

Examples ...

AutoSaveInterval property example


AutoSaveInterval property example

Private Sub AutoSaveExample()

'This example obtais the AutoSaveInterval property.

Dim myobj As ApplicationPreferences

Set myobj = IntelliCAD.Preferences

MsgBox "Save Interval: " & myobj.AutoSaveInterval

End Sub


CursorSize property

Sets or returns cursor crosshairs size as a percentage of the total screen.

Syntax

integerVariable = object.CursorSize

object.CursorSize = <integer>

Where:

integerVariable is a Long Integer variable (or value) setting the cursor size.

object is the ApplicationPreferences object.

Examples ...

CursorSize property example


CursorSize property example

Private Sub CursorSize_Example()

' This example demonstrates the CursorSize and

' CursorXColor, YColor, and ZColor properties.

Dim myobj As ApplicationPreferences

Set myobj = IntelliCAD.Preferences

MsgBox "Cursor Size: " & myobj.CursorSize & Chr(13) & "Cursor X Color: " & myobj.CursorXColor & Chr(13) & "Cursor Y Color: " & myobj.CursorYColor & Chr(13) & "Cursor Z Color: " & myobj.CursorZColor & Chr(13)

End Sub


CursorXColor, CursorYColor, and CursorZColor properties

Sets or returns the color of the cursor crosshairs for the X axis , Y-axis, or Z-axis, respectively.

Syntax

ColorsConstant = object.CursorXColor

ColorsConstant = object.CursorYColor

ColorsConstant = object.CursorZColor

object.CursorXColor = ColorsConstant

object.CursorYColor = ColorsConstant

object.CursorZColor = ColorsConstant

Where:

ColorsConstant is one of the constants shown below.

object is the ApplicationPreferences object.

Colors Constant | Index Value
vicBlue | 5
vicByBlock | 0
vicByLayer | 256
vicBy ColorXOr | -1
vicCyan | 4
vicGreen | 3
vicMagenta | 6
vicRed | 1
vicVarious | -2
vicWhite | 7
vicYellow | 2

Examples ...

CursorSize property example


DisplayScrollBars property

Sets or returns whether the bottom and right scroll bars are visible.

Syntax

BooleanVariable = object.DisplayScrollBars

object.DisplayScrollBars = <Boolean>

Where:

BooleanVariable determines whether the scroll bars are displayed (True) or not (False).

object is the ApplicationPreferences object.

Examples ...

DisplayScrollBars property example


DisplayScrollBars property example

Private Sub CommandButton4_Click()

'This example toggles the DisplayScrollBars property

Dim myobj As ApplicationPreferences

Dim scrollBarStatus As Boolean

Set myobj = IntelliCAD.Preferences

scrollBarStatus = myobj.DisplayScrollBars

MsgBox "The DisplayScrollBars property is: " & scrollBarStatus

' Toggle the visibility of the scroll bars.

myobj.DisplayScrollBars = Not (scrollBarStatus)

MsgBox "The DisplayScrollBars property is now: " & myobj.DisplayScrollBars

End Sub


DockedVisibleLines property

Sets or returns the number of lines of text displayed in the command window.

Syntax

integerVariable = object.DockedVisibleLines

object.DockedVisibleLines = <integer>

Where:

integerVariable sets the number of lines.

object is the ApplicationPreferences object.

Examples ...

DockedVisibleLines property example


DockedVisibleLines property example

Private Sub DockedVisibleLines_Example()

'The example obtains the DockedVisibleLines property.

Dim myobj As ApplicationPreferences

Dim dockedStatus As Long

Set myobj = IntelliCAD.Preferences

dockedStatus = myobj.DockedVisibleLines

MsgBox "The DockedVisibleLines property is: " & dockedStatus

End Sub


GraphicsWinBackgrndColor property

Sets or returns the background color of the graphics window.

Syntax

ColorsConstant = object.GraphicsWinBackgrndColor

object. GraphicsWinBackgrndColor = ColorsConstant

Where:

ColorsConstant is one of the constants shown below.

object is the ApplicationPreferences object.

Colors Constant | Index Value
vicBlue | 5
vicByBlock | 0
vicByLayer | 256
vicBy ColorXOr | -1
vicCyan | 4
vicGreen | 3
vicMagenta | 6
vicRed | 1
vicVarious | -2
vicWhite | 7
vicYellow | 2

Examples ...

GraphicsWinBackgrndColor property example


GraphicsWinBackgrndColor property example

Private Sub GraphWinBColor_Example()

'This example obtains the GraphicWinBackgrndColor property.

Dim myobj As ApplicationPreferences

Dim myColor As Colors

Set myobj = IntelliCAD.Preferences

myColor = myobj.GraphicsWinBackgrndColor

MsgBox "The GraphicsWinBackgrndColor property is: " & myColor

End Sub


HistoryLines property

Sets or returns the number of lines in the text window that is kept in history.

Syntax

integerVariable = object.HistoryLines

object.HistoryLines = <integer>

Where:

integerVariable sets the number of lines.

object is the ApplicationPreferences object.

Examples ...

HistoryLines property example


HistoryLines property example

Private Sub HistoryLines_Example()

'This example determines the HistoryLines property.

Dim myobj As ApplicationPreferences

Dim HistLines As Long

Set myobj = IntelliCAD.Preferences

HistLines = myobj.HistoryLines

MsgBox "The HistoryLines property is: " & HistLines

End Sub


LogFileName property

Sets or returns the log file name.

Syntax

stringVariable = object.LogFileName

object.LogFileName = <string>

Where:

stringVariable stores the name of the log file.

object is the ApplicationPreferences object.


LogFileOn property

Sets or returns whether the commands are logged to a file.

Syntax

BooleanVariable = object.LogFileOn

object.LogFileOn = <Boolean>

where:

BooleanVariable determines whether the commands are logged (True) or not (False).

object is the ApplicationPreferences object.


MaxIntelliCADWindow property

Sets or returns whether the IntelliCAD window should be maximized on startup.

Syntax

BooleanVariable = object.object.MaxIntelliCADWindow = <Boolean>

Where:

BooleanVariable determines whether the window is maximized (True) or not (False).

object is the ApplicationPreferences object.

Examples ...

MaxIntelliCADWindow property example


MaxIntelliCADWindow property example

Private Sub MaxICADWin_Example()

'This example determines the MaxICADWindow property.

Dim myobj As ApplicationPreferences

Dim maxWin As Boolean

Set myobj = IntelliCAD.Preferences

maxWin = myobj.MaxIntelliCADWindow

MsgBox "The MaxIntelliCADWindow property is: " & maxWin

End Sub


Attribute properties example

Sub Example_AttributeProps()

' This example creates a block containing a line and an arc.

' It then inserts the block, adds attributes and

' returns various properties of the attributes.

' Create the block

Dim blockObj As IntelliCAD.Block

Dim insPt As IntelliCAD.Point

Dim BlkName As String

BlkName = InputBox("Type a block name")

Set insPt = Library.CreatePoint(4, 3, 0)

Set blockObj = ThisDocument.Blocks.Add(insPt, BlkName)

' Add a a line and an arc to the block

Dim lineObj As IntelliCAD.Line

Dim myStartPt As IntelliCAD.Point

Dim myEndPt As IntelliCAD.Point

Dim arcObj As IntelliCAD.Arc

Dim cenPt As Point

Dim radius As Double

Set lineObj = ThisDocument.ModelSpace.AddLine(Library.CreatePoint(4, 4), Library.CreatePoint(7, 1))

Set cenPt = Library.CreatePoint(3, 4, 0)

radius = 1

Set arcObj = blockObj.AddArc(cenPt, radius, 1, 2)

' Define the attribute definition

Dim attributeObj As IntelliCAD.AttributeDef

Dim height As Double

Dim prompt As String

Dim tag As String

Dim value As String

height = 1

prompt = "Attribute Prompt"

tag = "Attribute Tag"

value = "Attribute Value"

' Create the attribute definition object in model space

Set attributeObj = blockObj.AddAttributeDef(height, vicAttributeModeVerify, prompt, insPt, tag, value)

' Insert the block

Dim blockRefObj As IntelliCAD.BlockInsert

Set blockRefObj = ThisDocument.ModelSpace.InsertBlock(insPt, BlkName, 1, 1, 1, 0)

MsgBox "The block " & BlkName & " has been inserted."

Dim anyAttributes As Boolean

Dim Array1 As Variant

Dim count As Integer

anyAttributes = blockRefObj.HasAttributes

MsgBox "The HasAttributes property is: " & anyAttributes

Dim atts As Attributes

Dim att As IntelliCAD.Attribute

Set atts = blockRefObj.GetAttributes

For Each att In atts

MsgBox "Tag String: " & att.TagString & Chr(13) & "Field length: " & att.FieldLength & Chr(13) & "Constant property: " & att.Constant & Chr(13) & "Invisible property: " & att.Invisible & Chr(13) & "Preset property: " & att.Preset & Chr(13) & "Verify property: " & att.Verify

Next att

End Sub


FieldLength property

Sets or returns the field length for the attribute.

Syntax

integerVariable = object.FieldLength

object.FieldLength = <integer>

Where:

integerVariable is a long-integer variable (or value) specifying the field length;

object is the Attribute or AttributeDef object.

Examples ...

Attribute properties example


HasAttributes property

Returns whether the block insert has attributes (True) or not (False).

Syntax

BooleanVariable = object.HasAttributes

Where:

BooleanVariable specifies whether the block insert has attributes

Examples ...

Attribute properties example


Invisible property

Sets or returns whether the Attribute or AttributeDef object is Invisible (True) or not (False). An invisible attribute will not be displayed or plotted. An attribute may exist as one of four optional modes: constant, preset, invisible, or verify.

Syntax

BooleanVariable = object.Invisible

object.Invisible = <Boolean>

Where:

BooleanVariable specifies whether the attribute mode is visible or not.

object is the Attribute or AttributeDef object.

Examples...

Attribute properties example


IsXRef property

Returns whether the block represents an External Reference (True) or not (False).

Syntax

BooleanVariable = object.IsXRef

Where:

BooleanVariable specifies whether the block is an XRef.

object is a Block object.


Preset property

Sets or returns whether the Attribute or AttributeDef is a preset attribute (True) or not (False). A preset attribute sets the attribute to its default, or preset, value when the user inserts the block. An attribute may exist as only one of four optional modes: constant, preset, invisible, or verify.

Syntax

BooleanVariable = object.Preset

object.Preset = <Boolean>

Where:

BooleanVariable specifies whether the attribute mode is preset or not.

object is the Attribute or AttributeDef object.

Examples ...

Attribute properties example


TagString property

Sets or returns the attribute tag, which identifies each occurrence of the attribute.

Syntax

stringVariable = object.TagString

object.TagString = <string>

Where:

stringVariable is a variable representing the tag;

Object is an Attribute or AttributeDef object.

Examples ...

Attribute properties example


Constant property

Sets or returns whether the attribute mode is Constant (True) or not (False). A constant attribute is one that maintains the same value in every occurrence. An attribute may exist as one of four optional modes: constant, preset, invisible, or verify.

Syntax

BooleanVariable = object.Constant

object.Constant = <Boolean>

Where:

BooleanVariable specifies whether the attribute mode is constant (True) or not (False).

object is the Attribute or AttributeDef object.

Examples ...

Attribute properties example


Mode property

Sets or returns the mode of the attribute definition.

Syntax

integerVariable = object.Mode

object.Mode = <integer>

Where:

integerVariable determines the mode based on one of the following constants.

object is the AttributeDef object.

AttributeMode Constant | Index Value
vicAttributeModeConstant | 2
vicAttributeModeInvisible | 1
vicAttributeModeNormal | 0
vicAttributeModePreset | 8
vicAttributeModeVerify | 4


PromptString property

Returns the prompt for an attribute definition. This string appears when a block containing this attribute is inserted.

Syntax

stringVariable = object.PromptString

Where:

stringVariable represents the prompt string.

object is the AttributeDef object.


Verify property

Sets or returns whether the Attribute or AttributeDef object is set for verification (True) or not (False). An attribute set to verify prompts the user for verification that the attribute value is correct when inserting the block. An attribute may exist as only one of four optional modes: constant, preset, invisible, or verify.

Syntax

BooleanVariable = object.Verify

object.Verify = <Boolean>

Where:

BooleanVariable specifies whether the attribute mode is set for verification.

object is the Attribute or AttributeDef object.

Examples ...

Attribute properties example


XScaleFactor property

Sets or returns the X scale factor for the block.

Syntax

object.XScaleFactor

Where:

object is a BlockInsert or ExternalReference object;

XScaleFactor is a double-precision variable (or value) representing the scale.


YScaleFactor property

Sets or returns the Y scale factor for the block.

Syntax

object.YScaleFactor

Where:

object is a BlockInsert or ExternalReference object;

YScaleFactor is a double-precision variable (or value) representing the scale.


ZScaleFactor property

Sets or returns the Z scale factor for the block.

Syntax

object.ZScaleFactor

Where:

object is a BlockInsert or ExternalReference object;

ZScaleFactor is a double-precision variable (or value) representing the scale.


Circumference property

Returns the circumference of a circle.

Syntax

DoubleVariable = object.Circumference

Where:

DoubleVariable is a double-precision variable for storing the circumference;

Object is a Circle object.


Circumference property example

Private Sub CircumfExample()

' This example creates a circle with a radius of 4 and

' obtains the circumference.

Dim icadDoc As IntelliCAD.Document

Dim icadCircle As IntelliCAD.Circle

Dim cenPt As IntelliCAD.Point

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(1, 2)

'Add the circle to the .dwg

Set icadCircle = icadDoc.ModelSpace.AddCircle(cenPt, 4)

' Display the entity

icadCircle.Update

MsgBox "Circle created w/ center point at 1,2." & Chr(13) & "Circumference = " & icadCircle.Circumference

ThisDocument.ActiveViewport.ZoomExtents

End Sub


Origin property

Origin As Point

Member of IntelliCAD.UserCoordSystem

Sets or returns the origin of an applicable object in WCS coordinates.

Syntax

objectVariable = object.Origin

Where:

objectVariable is a variable representing the Parent object.

object is a Block, Image or UserCoordSystem object.

Examples ...

GetUCSMatrix method example


PaperSpace property

Sets or returns whether or not the entity is in PaperSpace or ModelSpace. If the entity is in PaperSpace, the property is True; if the entity is in ModelSpace, the property is False.

Syntax

BooleanVariable = object.Paper

Where:

BooleanVariable is a variable (True or False) specifying whether or not the entity is in PaperSpace.

object is the applicable entity object.

Examples ...

PaperSpace property example


PaperSpace property example

Private Sub PaperSpaceExample()

'This example returns the PaperSpace property.

Dim ents As IntelliCAD.Entities

Dim ent As Object

Set ents = ActiveDocument.Entities

For Each ent In ents

MsgBox "The PaperSpace property for this entity is: " & ent.PaperSpace

Response = MsgBox("Continue listing entities?", vbYesNo, "PaperSpace property")

If Response = vbNo Then ' User chose Yes.

End

End If

Next ent

End Sub


Preferences property

Returns the Application level user Preferences object.

Syntax

objectVariable = object.Preferences

Where:

objectVariable is a variable representing the Preferences object.

object is the Application object.


Parent property

Returns the object immediately above the selected object in the object model hierarchy. For example, the Parent of an Arc object is Entities.

Syntax

objectVariable = object.Parent

Where:

objectVariable is a variable representing the Parent object.

object is any valid object.

Examples ...

Parent property example


Parent property example

The following example demonstrates how to return the Parent property of the Application object.

Private Sub ParentPropExample()

Dim myParent As Object

Set myParent = Application.Parent

MsgBox ("Application is: " & myParent.Name)

End Sub


Path property

Returns the path of the application (excluding the file name).

Syntax

stringVariable = object.Path

Where:

stringVariable is a variable for storing the path name.

object is the Application object.

Examples ...

Path property example


Path property example

The following example demonstrates how to return the Path property.

Private Sub PathPropExample()

Dim myPath As String

myPath = Application.Path

MsgBox ("Path is: " & myPath)

End Sub


PlotManager property

Returns the application's PlotManager that controls the Plot settings.

Syntax

objectVariable = object.PlotManager

Where:

objectVariable is a variable representing the PlotManager object.

object is the Application object.

Examples ...

PlotManager property example


PlotManager property example

Private Sub PlotManagerExample()

Dim myDoc As IntelliCAD.Document

Dim myPM As IntelliCAD.PlotManager

Set myPM = ThisDocument.Application.PlotManager

MsgBox "Plot Manager Preferences" & Chr(13) & "Version: " & myPM.PlotProperties.Version & Chr(13) & "Scale: " & myPM.PlotProperties.Scale

End Sub


Radius property

Returns the radius of an arc or circle object.

Syntax

DoubleVariable = object.Radius

Where:

DoubleVariable is a double-precision variable;

Object is an Arc or Circle object.

Examples ...

Radius property example


ReadOnly property

Returns whether or not the document is a read-only document.

Syntax

BooleanVariable = object.ReadOnly

Where:

BooleanVariable is a variable (True or False) specifying whether or not the document is read-only.

object is the Document object.

Examples ...

ReadOnly property example


ReadOnly property example

The following example demonstrates how to return the ReadOnly property.

Private Sub ReadOnlyPropExample()

Dim ReadStatus As Boolean

ReadStatus = ActiveDocument.ReadOnly

MsgBox "The ReadOnly property is: " & ReadStatus

End Sub


Rotation property

Sets or returns the rotation angle for an object.

Syntax

doubleVariable = object.Rotation

where:

doubleVariable is a double-precision variable (or value) representing the Rotation property.

object is one of the objects that has a Rotation property.

Examples ...

Rotation property example


Rotation property example

Private Sub Rotation_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains and resets the Rotation property.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Dim NewRotation As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "Rotation: " & textObj.Rotation

NewRotation = InputBox("Type a rotation (in radians):")

textObj.Rotation = NewRotation

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


Saved property

Returns whether or not the document has been changed since it was created or loaded. If not, the Save property is True; if it has been changed, the Saved property is False.

Syntax

BooleanVariable = object.Saved

Where:

BooleanVariable is a variable (True or False) specifying whether or not the document has been saved since it was loaded or changed.

object is the Document object.

Examples ...

Saved property example


Saved property example

Private Sub Savedproperty()

Dim SavedStatus As Boolean

SavedStatus = Application.ActiveDocument.Saved

MsgBox "SavedStatus property is: " & SavedStatus

End Sub


ScaleFactor property

Sets or returns the scale factor for an object.

Syntax

doubleVariable = object.ScaleFactor

where:

doubleVariable is a double-precision variable (or value) representing the ScaleFactor property.

object is one of the objects that has a ScaleFactor property.

Examples ...

ScaleFactor property example


ScaleFactor property example

Private Sub ScaleFactor_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains and resets the ScaleFactor property.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Dim NewScaleFac As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the AddText method"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "ScaleFactor: " & textObj.ScaleFactor

NewScaleFac = InputBox("Type a new scale factor:")

textObj.ScaleFactor = NewScaleFac

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

End Sub


StartAngle property

Sets or returns the starting angle of an arc or ellipse.

Syntax

DoubleVariable = object.StartAngle

Where:

DoubleVariable is a double-precision variable representing an angle (in degrees);

Object is an Arc or Ellipse object.

Examples ...

StartAngle property example


StartPoint property

Returns the start point of an arc, ellipse, or line.

Syntax

ObjectVariable = object.StartPoint

Where:

ObjectVariable is a variable representing a Point object;

Object is an Arc, Ellipse, or Line object.

Examples ...

EndPoint property example


StatusBar property

Sets or returns the text displayed in the status bar.

Syntax

stringVariable = object.StatusBar

Where:

stringVariable is a variable for storing the text in the status bar.

object is the Application object.

Examples ...

StatusBar property example


StatusBar property example

The following example demonstrates how to return the text displayed in the status bar.

Private Sub CommandButton21_Click()

Dim myStatus As String

myStatus = Application.StatusBar

MsgBox ("Status Bar is: " & myStatus)

End Sub


StyleName property

Sets or returns the name of the text style.

Syntax

stringVariable = object.StyleName

where:

stringVariable is a String representing the style name;

Object is the name of a Text object or an object containing text.

Examples ...

StyleName property example


StyleName property example

Private Sub StyleName_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then obtains the StyleName property.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = "Test string for the StyleName property"

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "StyleName: " & textObj.StyleName

End Sub


TextAlignmentPoint property

Sets or returns the Alignment point for an Attribute, AttributeDef, or Text object.

Syntax

ObjectVariable = object.TextAlignmentPoint

Where:

ObjectVariable is a variable representing a Point object;

Object is an Attribute, AttributeDef, or Text object.

Examples ...

InsertionPoint property example


TextGenerationFlag property

Sets or returns the text generation flags, using the TextFlag constants shown below. It is applicable to an Attribute, AttributeDef, or Text object.

Syntax

integerVariable = object.TextGenerationFlag

Where:

integerVariable is an Integer (or the constant itself) representing the TextFlag;

Object is the name of a Text object or an object containing text.

TextFlag Constant | Index Value
vicTextFlagBackward | 2
vicTextFlagNormal | 0
vicTextFlagUpsideDown | 4


TextString property

Sets or returns the text string for an Attribute, AttributeDef, or Text object.

Syntax

stringVariable = object.TextString

where:

stringVariable is a String representing the text contained in the applicable object;

Object is the name of a Text object or an object containing text.

Example...

TextString property example


TextString property example

Private Sub TextString_Example()

' This example creates text and adds it to the drawing using the

' AddText method. It then returns the TextString in a message box.

Dim icadDoc As IntelliCAD.Document

Dim myText As String

Dim textObj As IntelliCAD.Text

Dim insPt As IntelliCAD.Point

Dim height As Double

Dim NewScaleFac As Double

Set icadDoc = ActiveDocument

Set insPt = Library.CreatePoint(0, 9)

height = 5

myText = InputBox("Type some text here:")

' Add the Text object

Set textObj = icadDoc.ModelSpace.AddText(myText, insPt, height)

textObj.Update

ThisDocument.ActiveViewport.ZoomExtents

MsgBox "The text you type is: " & textObj.TextString

End Sub


Thickness property

Returns the thickness of an object.

Syntax

DoubleVariable = object.EndPoint

Where:

DoubleVariable is a double-precision variable representing the thickness;

Object is an Arc, Circle, Line, Point, Polyline, Solid, Text, or Trace object.

Examples ...

Thickness property example


Thickness property example

Private Sub ThicknessExample()

' This example adds an arc to the drawing and returns the thickness.

Dim icadDoc As IntelliCAD.Document

Dim myArc As Arc

Dim cenPt As IntelliCAD.Point

Dim myObj As Object

Dim myThickness As Double

Set icadDoc = ActiveDocument

Set cenPt = Library.CreatePoint(4, 2)

'Add the arc to the .dwg

Set myArc = icadDoc.ModelSpace.AddArc(cenPt, 3, 1, 3)

' Display the entity

myArc.Update

myThickness = myArc.Thickness

MsgBox "Thickness = " & myThickness, , "Arc Thickness"

End Sub


Top property

Specifies the distance from the top edge of the screen to the top edge of the main application window.

Syntax

integerVariable = object.Top

Where:

integerVariable is a Long integer variable specifying the Top property (in drawing units).

object is the Application object.

Examples ...

Top property example


Top property example

The following example demonstrates how to set and return the value of the Top property.

Private Sub TopPropExample()

' This example demonstrates how to return the Top property, & change it to 2.

Dim myTop As Integer

myTop = Application.Top

MsgBox ("Top is: " & myTop)

Application.Top = 2

MsgBox ("New top is: " & Application.Top)

End Sub


VBE property

Returns the Visual Basic for Applications editor object.

Syntax

objectVariable = object.VBE

Where:

objectVariable is a variable representing the VBE object.

object is the Application object.


Version property

Returns the Version of the Application or PlotProperties object.

Syntax

stringVariable = object.Version

Where:

stringVariable is a variable storing the version of the application.

object is the Application or PlotProperties object.

Examples ...

PlotManager property example


VerticalAlignment property

Sets or returns the Vertical alignment for the text. It is set or returned using the VerticalAlignment constants shown below.

Syntax

integerVariable = object.VerticalAlignment

object.VerticalAlignment = <integer>

Where:

integerVariable is a variable (or the constant itself) representing the vertical alignment value.

object is the entity object for which you set or return the color.

Horizontal Alignment Constant | Index Value
vicVerticalAlignmentBaseline | 0
vicVerticalAlignmentBottom | 1
vicVerticalAlignmentMiddle | 2
vicVerticalAlignmentTop | 3


VisibilityEdgeX property

Sets or returns the edge visiblity for Edge 1, 2, 3, or 4 of a 3D Face.

Syntax

BooleanVariable = object.VisibilityEdge1

BooleanVariable = object.VisibilityEdge2

BooleanVariable = object.VisibilityEdge3

BooleanVariable = object.VisibilityEdge4

or

object.VisibilityEdge1 = <Boolean>

object.VisibilityEdge2 = <Boolean>

object.VisibilityEdge3 = <Boolean>

object.VisibilityEdge4 = <Boolean>

Where:

BooleanVariable is a specifies whether the edge is visible (True) or not (False).

object is a 3D Face object;


Visible property

Specifies visibility of an object, such as the Application window.

Syntax

BooleanVariable = object.Visible

Where:

BooleanVariable is a variable (True or False) specifying whether the window is visible or not.

object is the object of interest.

Examples ...

Visible property example


Visible property example

The following example demonstrates how to change the value of the Visible property.

Private Sub VisiblePropExample()

Application.Visible = False

MsgBox "Visible property is now false. Click OK to restore."

Application.Visible = True

End

End Sub


Width property

Sets or returns the width of the object window, such as the Application object or the Viewport object.

Syntax

integerVariable = object.Width

Where:

integerVariable is a Long integer variable specifying the Width property (in drawing units).

object is the object of interest.

Examples ...

Width property example


Width property example

The following example demonstrates how to set and return the Width property.

Private Sub WidthPropExample()

Dim myWidth As Double

myWidth = Application.Width

MsgBox ("Width is: " & myWidth)

End Sub


Windows property

Returns the Windows collection object.

Syntax

objectVariable = Application.Windows

Where:

objectVariable is a variable storing the Windows collection object.

Examples ...

Windows property example


Windows property example

Private Sub WindowspropertyExample()

Dim myDoc As Document

Dim nowins As Integer

nowins = Application.Windows.Count

MsgBox "No. of windows = " & nowins

End Sub


Workspace property

Returns the Workspace object.

Syntax

objectVariable = Application.Workspace

Where:

objectVariable is a variable storing the Workspace object.


X property

Sets or returns the X value for a Point or Vector.

Syntax

object.X

Where:

object is a Point or Vector object;

X is a double-precision variable or value representing the X coordinate of a Point or Vector object.

Examples ...

IntersectWith method example


XVector property

Sets or returns the X direction of the given User Coordinate System.

Syntax

object.XVector

Where:

object is a UserCoordSystem object;

XVector is a Vector object representing the X vector of the UCS.

Examples ...

XVector property example


XVector, YVector, and ZVector property example

Sub Example_GetUCSMatrix()

' This example creates a new UCS and lists its X, Y, and Z Vectors.

' Define a new UCS and turn on the UCS icon at the origin.

Dim ucsObj As IntelliCAD.UserCoordSystem

Dim origin As Point

Dim xAxisVector As Vector

Dim yAxisVector As Vector

Dim UCSName As String

Set origin = Library.CreatePoint(0, 0, 0)

Set xAxisVector = Library.CreateVector(0, 0, 0, 1, 1, 0)

Set yAxisVector = Library.CreateVector(0, 2, 0, 1, 1, 0)

UCSName = InputBox("Type a name for the user coordinate system:")

Set ucsObj = ThisDocument.UserCoordinateSystems.Add(origin, xAxisVector, yAxisVector, UCSName)

MsgBox "XVector.x = " & ucsObj.Xvector.x & Chr(13) & "XVector.y = " & ucsObj.Xvector.y & Chr(13) & "XVector.z = " & ucsObj.Xvector.z

MsgBox "YVector.x = " & ucsObj.Yvector.x & Chr(13) & "YVector.y = " & ucsObj.Yvector.y & Chr(13) & "XVector.z = " & ucsObj.Yvector.z

MsgBox "ZVector.x = " & ucsObj.Zvector.x & Chr(13) & "ZVector.y = " & ucsObj.Zvector.y & Chr(13) & "ZVector.z = " & ucsObj.Zvector.z

End Sub


Y property

Sets or returns the Y value for a Point or Vector.

Syntax

object.Y

Where:

object is a Point or Vector object;

Y is a double-precision variable or value representing the Y coordinate of a Point or Vector object.

Examples ...

IntersectWith method example


YVector property

Sets or returns the X direction of the given User Coordinate System.

Syntax

object.YVector

Where:

object is a UserCoordSystem object;

YVector is a Vector object representing the Y vector of the UCS.

Examples ...

YVector property example


Z property

Sets or returns the Z value for a Point or Vector.

Syntax

object.Z

Where:

object is a Point or Vector object;

Z is a double-precision variable or value representing the Z coordinate of a Point or Vector object.

Examples ...

IntersectWith Method example


ZVector property

Sets or returns the X direction of the given User Coordinate System.

Syntax

object.ZVector

Where:

object is a UserCoordSystem object;

ZVector is a Vector object representing the Z vector of the UCS.

Examples ...

ZVector property example


Overview of Constants

Constants are values that do not change. IntelliCAD VBA includes a variety of predefined constants:

AttachmentPoint | LeaderType
AttributeMode | ObjectSnapMode
BooleanSetting | RealToString, AngleToReal, AngleToString
Colors | SelectionSet
DrawingDirection | TextFlag
DistancetoReal | TranslateCoordinates
EntityType | Units
GetIntersectionPoint | VerticalAlignment
HatchStyle | ZoomScale
HorizontalAlignment |


AttachmentPoint

AttachBottomCenter

AttachBottomRight

AttachBottomLeft

AttachBottomCenter

AttachBottomRight

AttachBottomLeft

AttachMiddleCenter

AttachMiddleRight

AttachMiddleLeft

AttachTopCenter

AttachTopRight

AttachTopLeft


AttributeMode

AttributeConstant = 2

AttributePreset = 8

AttributeInvisible = 1

AttributeVerify = 4


BooleanSetting

On

Off


Colors

Red

Blue

Green

Yellow

Magenta

Cyan

White

ByBlock

ByLayer


DistanceToReal

Architectural

Engineering

Scientific

Decimal

Fractional


DrawingDirection

BottomToLeft

RightToLeft

LeftToRight

TopToBottom


EntityType

3dFace

3dPoly

Arc

Attribute

AttributeDef

BlockInsert

Circle

Dimension

Ellipse

Hatch

InfiniteLine

Leader

Line

Mtext

Point

Polyline

PolyfaceMesh

ViewportEntity

Ray

Solid

Spline

Text

Tolerance

Trace


GetIntersectionPoint

ExtendThisEntity

ExtendOtherEntity

ExtendBothEntities

ExtendNone


HatchStyle

HatchIgnore

HatchOuter

HatchStandard


HorizontalAlignment

AlignHorizontalAligned

AlignHorizontalFit

AlignHorizontalMiddle

AlignHorizontalCenter

AlignHorizontalLeft

AlignHorizontalRight


LeaderType

LeaderLineWithNoArrow

LeaderLineWithArrow


ObjectSnapMode

These can be combinations, so use 1,2,4, 8,16, etc.

SnapCenter

SnapNear

SnapEnd

SnapMid

SnapNode

SnapQuick

SnapQuadrant

SnapTangent

SnapPerpendicular

SnapNear

SnapInsertionPoint

SnapPoint

SnapIntersection

SnapPlanViewIntersection


RealToString

The following types of units can be converted:

Degrees

Grads

Radians

DegreesMinutesSeconds

SurveyorUnits


SelectionSet

SelectionSetCrossingPolygon

SelectionSetOutsidePolygon

SelectionSetInsidePolygon

SelectionSetCrossingCircle

SelectionSetOutsideCircle

SelectionSetInsideCircle

SelectionSetCrossingWindow

SelectionSetOutsideWindow

SelectionSetInsideWindow

SelectionSetPrevious

SelectionSetLast

SelectionSetAll

SelectionSetAtPoint

SelectionSetFence


TextFlag

TextBackward

TextUpsideDown


TranslateCoordinates

UCS

World

PCS

DCS


Units

English

Metric


VerticalAlignment

AlignVerticalBaseline

AlignVerticalMiddle

AlignVerticalBottom

AlignVerticalTop


ZoomScale

ZoomAbsolute

ZoomRelativeToPaperspace

ZoomRelative