entity:index
List of: Scheme Extensions
Subjects: Physical Properties
Contents: Kernel

Action: Returns the index of an entity.

Filename: kern/kern_scm/ent_scm.cxx

APIs: api_get_coedges, api_get_edges, api_get_faces, api_get_lumps, api_get_owner, api_get_shells, api_get_vertices, api_get_wires

Syntax: (entity:index entity [list])

Arg Types: entity entity

list entity | (entity...)

Returns: integer

Description: Returns the index of an entity. For example, if the input entity is an edge the index is found in the result from api_get_edges. The index is zero based and a -1 is returned if none are found. Optionally, a list of entities can be input. Index is returned based on the given entity list.


entity specifies the entity to be queried.


list is an optional argument that specifies the entity list used to find the index of the entity.

Example: ; entity:index

; Create topology to demonstrate command.

(define block (solid:block (position 0 0 0)


(position 10 10 10)))

;; block

(define edges (entity:edges block))

;; edges

(define list (list-ref edges 0))

;; list

; Find the index of a given edge.

(entity:index (entity 6 1))

;; 3
PDF/KERN/12SCA.PDF
HTM/DATA/KERN/KERN/12SCA/0089.HTM