entity:annotations
List of: Scheme Extensions
Subjects: Feature Naming
Contents: Kernel

Action: Returns the list annotation entities attached to the given entity via an annotation attribute.

Filename: kern/kern_scm/anno_scm.cxx

Syntax: (entity:annotation entity)

Arg Types: entity entity

Returns: (entity ...)

Description: Returns the list annotation entities attached to the given entity via an annotation attribute. If there is only one annotation attached, it is returned directly without a list.


The option for "annotation" should be turned on (#t) in order for the annotations to be created during a sweep or blend operation. Likewise, the option for "unhook_annotations" should be turned off (#f) in order to view the annotations after the operation; otherwise they are automatically removed.


entity specifies an entity.

Example: ; entity:annotations

; Turn on annotation options

(option:set "annotation" #t)

;; #f

(option:set "unhook_annotations" #f)

;; #t

; Create a sweep path from a wire body of edges.

(define path1 (wire-body (list


(edge:linear (position 0 0 0) (position 0 20 0))


(edge:ellipse (position 10 20 0)


(gvector 0 0 -1) (gvector -10 0 0) 1 0 90)


(edge:linear (position 10 30 0)


(position 20 30 0)))))

;; path1

; Sweep the edges into a face body.

(define a-body (sweep:law


(edge:linear (position 0 3 3) (position 0 3 -3))


(edge:linear (position 0 3 -3)


(position 0 -3 -3))))

;; a-body

; Create the profile to use in sweeping

(define profile1 (car


(entity:faces (sheet:2d a-body))))

;; profile1

; Sweep the profile along the path.

(define sweep1 (sweep:law profile1 path1))

;; sweep1

(entity:set-color path1 2)

;; ()

(entity:set-color profile1 3)

;; ()

(iso)

;; #[view 10814340]

(zoom-all)

;; #[view 10814340]

; Create some lists for verification purposes.

(define in-prof-edges (entity:edges profile1))

;; in-prof-edges

(define out-sw-faces (entity:faces sweep1))

;; out-sw-faces

(define out-sw-edges (entity:edges sweep1))

;; out-sw-edges

; Check the annotations attached to items.

; Create a list of annotations associated with an

; edge of the swept body.

(define anno1 (entity:annotations


(list-ref out-sw-edges 2)))

;; anno1

; Create a list of annotations that are inputs to the

; sweep operation.

(define anno-input1 (annotation:inputs


(list-ref anno1 0)))

(annotation:inputs (list-ref anno1 0)))

;; anno-input1

; anno-input1 => (#[entity 94 1] #[entity 95 1])

; See what the annotation names are for a given

; input annotation.

(entity:annotation-names (list-ref anno-input1 0))

;; ("mid_top_vertex" "profile" "profile" "profile")

(entity:annotation-names (list-ref anno-input1 1))

;; ("path" "path" "path" "path" "path" "path" "path"

;; "path" "path" "path" "path" "path" "path" "path"

;; "path" "path")

; Create a second list of annotations from the first

; swept face.

(define anno2 (entity:annotations


(list-ref out-sw-faces 0)))

;; anno2

; See what the annotation names are for the

; annotation attached to the first swept face.

(annotation:member-name (list-ref anno2 0)


(list-ref out-sw-faces 0))

;; "lateral_face"

; Create a list of annotations just from one of the

; input profile edges. There are four profile edges.

(define anno3 (entity:annotations


(list-ref in-prof-edges 0)))

;; anno3

(annotation:member-name (list-ref anno3 0)


(list-ref in-prof-edges 0))

;; "profile"

(annotation:member-name (list-ref anno3 8)


(list-ref in-prof-edges 0))

;; "top-edge"

; Create a list of annotations that are inputs to

; the sweep operation.

(define anno-input1

(annotation:inputs (list-ref anno1 0)))

;; anno-input1

; See what the annotation names are for a given

; input annotation.

(entity:annotation-names (list-ref anno-input1 0))

;; ("mid_top_vertex" "profile" "profile" "profile")

(entity:annotation-names (list-ref anno-input1 1))

;; ("path" "path" "path" "path" "path" "path" "path"

;; "path" "path" "path" "path" "path" "path" "path"

;; "path" "path")

; Create a second list of annotations from the first

; swept face.

(define anno2 (entity:annotations


(list-ref out-sw-faces 0)))

;; anno2

; See what the annotation names are for the

; annotation attached to the first swept face.

(annotation:member-name (list-ref anno2 0)


(list-ref out-sw-faces 0))

;; "lateral_face"

; Create a list of annotations just from one of the

; input profile edges. There are four profile edges.

(define anno3 (entity:annotations


(list-ref in-prof-edges 0)))

;; anno3

(annotation:member-name (list-ref anno3 0)


(list-ref in-prof-edges 0))

;; "profile"

(annotation:member-name (list-ref anno3 8)


(list-ref in-prof-edges 0))

;; "top-edge
PDF/KERN/12SCA.PDF
HTM/DATA/KERN/KERN/12SCA/0076.HTM