PSC Code Manual

util/object/block.lsp [src]

Block-handling functions

Functions

Function signature Description
(blkref-p obj) Returns T if OBJ is a block reference
(block-containing sourceobj) Searches for the block definition that contains SOURCEOBJ
(blockdef ename) Returns the block definition for insert with ENAME
(blockref2def blockref) Returns the block definition for insert BLOCKREF
(define-block name plines) Returns a block definition named NAME consisting of closed polylines
(define-block-maybe name plines) Calls define-block only if no block with NAME exists yet
(insert-block container ins block) Wrapper for vla-InsertBlock
(insert-lib-block container ins name scale) Inserts a block from custom block library
(move-to-bottom obj container) Moves OBJ to bottom of draw order in CONTAINER
(p-blk str) Returns a new empty pseudonymous block
(p-blk-name str) Returns a unique pseudonymous block name

(blkref-p obj)

Returns T if OBJ is a block reference

VARS:
(OBJ VLA-OBJECT)

(block-containing sourceobj)

Searches for the block definition that contains SOURCEOBJ

Returns the block name if found, or nil.

VARS:
(SOURCEOBJ VLA-OBJECT)

(blockdef ename)

Returns the block definition for insert with ENAME

VARS:
(ENAME ENAME)

(blockref2def blockref)

Returns the block definition for insert BLOCKREF

VARS:
(BLOCKREF VLA-OBJECT)

(define-block name plines)

Returns a block definition named NAME consisting of closed polylines

PLINES is a list of closed polylines inserted at the origin.

VARS:
(NAME STR)
(PLINES nil (LISTP PLINES) (VL-EVERY 'PTS-LIST-P PLINES))

(define-block-maybe name plines)

Calls define-block only if no block with NAME exists yet

VARS:
(NAME STR)
(PLINES nil (LISTP PLINES) (VL-EVERY 'PTS-LIST-P PLINES))

(insert-block container ins block)

Wrapper for vla-InsertBlock

BLOCK may be the block name as a string or a block definition obj. INS may be a point list
or vlax point variant.

VARS:
(CONTAINER VLA-OBJECT)
(INS (LIST variant nil))
(BLOCK (STR VLA-OBJECT))

(insert-lib-block container ins name scale)

Inserts a block from custom block library

NAME should be the filename of a drawing from the blocks/ folder without the extension.

VARS:
(CONTAINER VLA-OBJECT)
(INS (LIST safearray nil))
(NAME STR)
(SCALE nil (NUMBERP SCALE))

(move-to-bottom obj container)

Moves OBJ to bottom of draw order in CONTAINER

VARS:
(OBJ VLA-OBJECT)
(CONTAINER VLA-OBJECT)

(p-blk str)

Returns a new empty pseudonymous block

(p-blk-name str)

Returns a unique pseudonymous block name