annotation:assert
List of: Scheme Extensions
Subjects: Feature Naming
Contents: Kernel

Action: Returns an error if the specified annotation does not exist.

Filename: kern/kern_scm/anno_scm.cxx

Syntax: (annotation:assert anno-save-name [history]


[member-name entity] ...)

Arg Types: anno-save-name string

history history

member-name string

entity entity

Returns: boolean

Errors: Annotation not found

Description: Searches the history stream for annotations of the given type as specified by the name used to save it in an SAT file. If the history stream is not specified, the stream from the active part is used. The remaining arguments are (member-name, entity) pairs. You can have as many as necessary to fully describe which entities should be in which fields of the annotation.


If an annotation matching the description is not found, a sys_error NO_ANNOTATION) is issued. Returns a #t and aborts via an exception if the described annotation does not exist.


anno-save-name is a string that appears in the SAT file if the annotation is saved.


history is the history stream where the annotation is found.


member-name is a string indicating the name of the entity within the annotation.


entity is an entity that should have the given member-name within the candidate annotation.

Example: ; annotation:assert

; Turn on annotation options

(option:set "annotation" #t)

;; #f

(option:set "unhook_annotations" #f)

;; #t

; Sweep open wire along vector

(define profile (wire-body:points


(list (position 0 0 0) (position 10 0 0))))

;; profile

(define sweep (sweep:along-vector profile #f


(gvector 0 0 10)))

;; sweep


; Additional Example

; Turn on annotation options

(part:clear)

;; #t

(option:set "annotation" #t)

;; #f

; Sweep open wire along vector

(define profile (wire-body:points


(list (position 0 0 0) (position 10 0 0))))

;; profile

(define profile-edge (car (entity:edges profile)))

;; profile-edge

(define sweep (sweep:along-vector profile #f


(gvector 0 0 10)))

;; sweep

; Pick the top-edge

(ray:queue 206.331 -403.49 211.434


-0.408248 0.816497 -0.408248 1)

;; #[ray (206.331 -403.49 211.434)

;; (-0.408248 0.816497 -0.408248)]

; Left mouse click on the top edge

(define top-edge (pick-edge))

;; top-edge

; Assert that the profile-edge is part of a

; profile annotation. The full save name, not just

; the leaf name, followed by pairs of annotation

; member names and the entities to which they refer,

; should be there.

(define sweep_anno_edge (annotation:assert


'sweep_anno_edge_top-sweep_annotation-annotation


'profile profile-edge 'top_edge top-edge))

;; sweep_anno_edge


PDF/KERN/12SCA.PDF
HTM/DATA/KERN/KERN/12SCA/0007.HTM