std-entity-type-p


Synopsis

(std-entity-type-p <ele> <type>) ; type predicate

(std-entity-exttype-p <ele> <type>) ; extended type predicate

Description

Predicate if the entity matches the given type(s).

The type must be defined as exact uppercase string or list of those strings.

The extended version std-entity-subtype-p recognizes those additional types (as returned by STD-GETEXTTYPE) as well:
"PFACE", "MESH", "3DPOLY", "SPLINE", "SOLMESH", "SOLWIRE", "MINSERT", "XREF", "HATCH"

The following type groups are predefined:

*ENTITY-TYPE-BREAKABLE* ("LINE" "POLYLINE" "ARC" "CIRCLE" "TRACE" "LWPOLYLINE" "SPLINE")

*ENTITY-TYPE-POLYLINE* ("LWPOLYLINE" "POLYLINE")

*ENTITY-TYPE-LINEAR* ("LINE" "ARC" "POLYLINE" "LWPOLYLINE" "SPLINE") ; for MEASURE and such

*ENTITY-TYPE-TEXT* ("TEXT" "MTEXT")

*ENTITY-TYPE-TEXTALIKE* ("TEXT" "MTEXT" "ATTRIB" "ATTDEF" "DIMENSION")

Examples

(while (not (std-entity-type-p
              (std-entsel "Pick block: ") "INSERT")))

(if (std-entity-type-p ele '("LWPOLYLINE" "POLYLINE"))

..)

;; or better:
(if (std-entity-type-p ele *ENTITY-TYPE-POLYLINE*)

..)

Arguments

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

type: A string or a list of strings

Return Value

Either T if the entity type matches or nil.

Side Effects

None.

Module

(std-require 'STDENT)

Defined in STDENT