PSC Code Manual

util/selection.lsp [src]

Functions related to user selection

Functions

Function signature Description
(dxf-filter defs) Translates S-Expressions into DXF codes for passing to ssget
(get-ins-and-delete ename) Deletes the entity named ENAME and returns its former insertion point
(get-sset app-ids-str) Gets a selection from the user of objects with given XDATA app-ID
(get-stairland selection sort-p) Gets a selection of stairs and landings from the user
(getdint def-sym prompt-str) Wrapper for getint that uses default values and remembers the last choice
(getdkword ig-args def-sym prompt-str) Wrapper for initget/getkword that uses default values and remembers the last choice
(ss->lst ss) Returns selection set SS as a list of enames
(ss-and group-codes) Returns a list of DXF codes wrapped in a DXF AND
(ss-or group-codes) Returns a list of DXF codes wrapped in a DXF OR
(vlasel) Alias for (ename>vlobj (car (entsel)))

(dxf-filter defs)

Translates S-Expressions into DXF codes for passing to ssget

DEFS should be a list of group code S-Expressions. Note: macro-expand is called on DEFS
before use. See source for which codes are available for use.

VARS:
(DEFS nil (LISTP DEFS) (VL-EVERY 'LISTP DEFS))

TESTS:
(EQUAL (DXF-FILTER '((APPID "Land"))) '((-3 ("Land"))))
(EQUAL (DXF-FILTER '((AND (TYPE "CIRCLE") (LAYER "DIM")))) '((-4 . "")))

(get-ins-and-delete ename)

Deletes the entity named ENAME and returns its former insertion point

VARS:
(ENAME ENAME)

(get-sset app-ids-str)

Gets a selection from the user of objects with given XDATA app-ID

(get-stairland selection sort-p)

Gets a selection of stairs and landings from the user

Returns enames of selected objects. SELECTION should be one of the following symbols:

- 'stair
- 'land
- 'both

SORT-P being non-nil means to sort selection set using sort-stairland.

VARS:
(SELECTION SYM (MEMBER SELECTION '(STAIR LAND BOTH)))

(getdint def-sym prompt-str)

Wrapper for getint that uses default values and remembers the last choice

See getdkword for usage of DEF-SYM, PROMPT-STR, and MATCH-LAST-P.

VARS:
(DEF-SYM (SYM))
(PROMPT-STR (STR))

(getdkword ig-args def-sym prompt-str)

Wrapper for initget/getkword that uses default values and remembers the last choice

IG-ARGS is a 2-item list of args to initget. The first element should be an int and the
second should be the list of keywords as a string. DEF-SYM is a symbol pointing to the
variable that holds the default value. PROMPT-STR is the prompt string, to which a leading
newline and the bracketed prompt items are added automatically.

If the keyword list contains a variant of "matchlast" (case-insensitive, so the caller
can determine the matching key sequence), the user may enter that keyword to skip
remaining prompts. This works by checking the value of the MATCH-LAST-P variable, which
should be set local in the calling command if used.

VARS:
(IG-ARGS (LIST) (= (LENGTH IG-ARGS) 2) (= (TYPE (CAR IG-ARGS)) 'INT) (STRINGP (LAST IG-ARGS)))
(DEF-SYM (SYM))
(PROMPT-STR (STR))

(ss->lst ss)

Returns selection set SS as a list of enames

(ss-and group-codes)

Returns a list of DXF codes wrapped in a DXF AND

Mainly for use in dxf-filter.

VARS:
(GROUP-CODES nil (LISTP GROUP-CODES))

(ss-or group-codes)

Returns a list of DXF codes wrapped in a DXF OR

Mainly for use in dxf-filter.

VARS:
(GROUP-CODES nil (LISTP GROUP-CODES))

(vlasel)

Alias for (ename>vlobj (car (entsel)))