std-chglay


Synopsis

(std-chglay <ele> <lay>)

Description

STD-CHGLAY is a short function to change the layer of an entity.

It modifies the entity and returns the new layer.

It may be used with entity types, entget-lists or entsel picklists.

Example

;;; change some entities to a new layer
(defun C:CL (/ lay ele)
  (if (setq lay (std-tbl-getname
      "LAYER" 0 "Change elements to new layer"
      (getvar "CLAYER")))
  (std-ssmap (function (lambda (ele) (std-chglay ele lay)))
             (ssget)))

Note

The implementation calls STD-ENTGET on ename or entsel arguments which uses an entget caching mechanism, because ENTGET is usually slow. But this speed gain may fool return values on deleted entities.

Arguments

ele: Either an entity type, entget-list or entsel picklist.

lay: A string which must be a valid symbol table name.

Return Value

The value of the lay argument

Side Effects

Changes the entity. Only because of the side-effect.

Module

(std-require 'STDENT)

Defined in STDENT