LISP Functions

This page describes functions for LISP. If you're interested in obtaining, please contact us. Functions are written in a not bloated way , with speed in mind.

These functions are developed in BricsCAD and work with AutoCAD too - unless stated otherwise.

Examples expect LISP files are in the "File Support Search Path" and, only in case of AutoCAD, are part of trusted locations.


Moves the previous selection set from 0,0 and pauses for input.


Accepts a destination point.

muttoff, mutton

Turn muttering off and on.


Turns muttering off.


Turns muttering on.


Check if a drawing is saved.



  • "auto" for alert and save in appdata-local-temp.
  • "exit" for alert and exit.

sel-intersect, sel-subtract, sel-union

Create a Boolean selection set from two selection sets.


Return the intersecting selection of ss-1 and ss-2.


Return the subtraction selection set: Subtract ss-min from ss-base.


Return the unionised selection set: Add ss-add to ss-base.

Return Values

A new selection set.

osoff, oson, osrec, osres, ostog

Sets and stores Object Snap.


Switches Object Snap off.


Turns Object Snap on.


Stores the Object Snap bit sum value to local variable "osmod".


Restores Object Snap to the bit sum value of "osmod", only if not nil.


Toggles Object Snap on and off.

Return Values

All functions return the resulting bit sum value.


Command: (osrec)
Command: (osoff)
Command: (command "line" "0.1,0.1" "1,1" "")
Command: (osres)
Command: (command "move" "last" "" "non" "0,0")


Returns localized date string or sets local.



(date-gen <eng|ned|fry|...> <DD_MMMM_YYYY|...|set-local>)


  • First argument is a supported language.
  • Second argument is a date format or "set-local".
    • "DD_MMMM_YYYY" returns for example "12 maart 2018"
    • "set-local" creates an environment variable "iso639" with a value as specified by the user.

Return Values

A date string based on CAD variable "CDATE" or nil if no language is set.

Examples The following example uses a line command to draw a line from coordinate 0,0 to 1,1 and ends with an empty return.

Command: (load "date-gen")
Command: (setq today-is (date-gen ned DD_MMMM_YYYY))
Command: _text 0,0 2.5 0 In Dutch, today is:
Text: !today-is

In depth

  • "date-gen.dat" contain localized data

ssv2command-list, ssv2list, char-sep-val2list

Reads a semicolon or other character separated string and returns a list.


Basic converter of semicolon separated string to a list. Corrects missing ending semicolons.


Converter of character separated string to a list.


Strict converter of semicolon separated commands string to a list.


Syntax of 'semicolon-sep-val',and 'ssv-string' with semicolons is similar to script and menu syntax. Argument char-sep-val can be anything specified by character.

Return Values

A list with string members.

Examples The following example uses a line command to draw a line from coordinate 0,0 to 1,1 and ends with an empty return.

Command: (setq command-string "_line;0,0;1,1;;")
Command: (load "ssv2command-list")
Command: (setq command-list (ssv2command-list command-string))
("_line" "0,0" "1,1" "")
Command: (command command-list)(princ)
Command: _line
Start of line: 0,0
Set end point or [Angle/Length/Undo]:1,1
Set end point or [Angle/Length/Follow/Undo]:

In depth

  • Since spaces equal returns, texts can be challenging. Consider the following four statements:
    • (setq command-string "_dtext;0,0;2.5;0;A_text;;")
      (setq command-string "_dtext;0,0;2.5;0;With space;;")
      (setq command-string "_text;0,0;2.5;0;With space;;")
      (setq command-string "_text;0,0;2.5;0;With space;")
      It is only the last statement that works well, despite the fact that it misses an empty return. Note that the current text style does not have a fixed height.

This site is hosted by NedCAD.

De inhoud van deze site wordt aangeboden zoals het is, zonder enige vorm van garantie en heeft verschillende licenties. Meer informatie over licenties staat hier.