part:entities
List of: Scheme Extensions
Subjects: Debugging, Part Management
Contents: Scheme Support

Action: Gets a list of all top-level entities in a part.

Filename: scm/scmext/part_scm.cxx

APIs: api_pm_part_entities

Syntax: (part:entities [part=active] [filter=NULL])

Arg Types: part part

filter entity-filter

Returns: (entity ... )

Description: This extension obtains a list of the top-level entities from the specified part. If the optional part is not specified, it obtains a list of the top-level entities from the active part. Use the optional filter to control the kinds of entities that are returned by this extension.


An ENTITY is top level when making a call to api_get_owner returns itself. Also, every ENTITY contains an owner method. This method would return the next higher ENTITY. If that object is the top level ENTITY, then this pointer is returned. This means that if a FACE does not point to an owning SHELL, this FACE is top level for that model. A BODY is normally top level, but in some cases, there are others that are the top level ENTITY.


filter is an entity-filter that is a procedural object that selects entities from an entity-list.

Example: ; part:entities

; List the entities in the active part.

(part:entities)

;; (#[entity 1 1])

(define block1


(solid:block (position 0 0 0)


(position 5 10 15)))

;; block1

(part:entities)

;; (#[entity 1 1] #[entity 2 1])

(define edges1 (entity:edges block1))

;; edges1

; Create a point.

(define point1 (point (position 0 0 0)))

;; point1

; Get a list of the top level entities in a part.

(part:entities)

;; (#[entity 1 1] #[entity 2 1] #[entity 15 1])

; Get a list of the solid entities in a part.

(part:entities (filter:type "solid?"))

;; (#[entity 2 1])
PDF/SCM/04SC.PDF
HTM/DATA/SCM/SCM/04SC/0080.HTM