std-entmod


Synopsis

(std-entmod <elist>)

Description

STD-ENTMOD calls entmod and updates the internal entget cache to avoid problems with modified entities and subsequent calls.

STD-ENTMOD is called implicitly by STD-ENTCHG and other functions using STD-ENTCHG.

There's not much need to use (STD-ENTMOD) indeed, (STD-ENTCHG) is easier to use.

Examples

;; but better use (std-entchg ele nil 8 "1") instead
(if (setq ele (std-entget (std-entsel nil)))
  (std-entmod (subst '(8 . "1")
                      (assoc 8 ele)
                      ele)))

;; a bad example how NOT to do it, but how to take care.
(if (setq ele (std-entsel nil))
  (progn
    (setq lay (std-getlay ele))	; uses implicitly std-getval
    ;; stupid way to call (std-entchg ele nil 8 "1")
    (entmod (subst '(8 . "1")
            (assoc 8 (entget (car ele))
            (entget (car ele))))
    ;; now the cache still thinks lay is the layer property
    ;; we have to call this to force an update on the next access
    (std-init-entget)
    (std-print (list "\nold layer: " lay
                     "\nnew layer: " (std-getval 8 ele)))
  )
)

Arguments

elist: A valid entget-list suitable to entmod.

Return Value

An entget-list or nil. ??

Side Effects

None, besides changing the internal *ENTGET-CACHE* variable.

Module

(std-require 'STDENT)

Defined in STDENT