Use Distributed History Streams
List of: Discussion Topic
Subjects: History and Roll
Contents: Kernel

Distributed history enables part history. After distribution is set (either on or off) it cannot be changed. Distributed history is off by default, and the first bulletin created in for a part's history stream locks it this state.

; part:new
; Define a new part
(define my_part (part:new))
;; my_part
; Define a new view for the part
(define my_view (view:dl my_part))
;; my_view
(env:set-active-part my_part)
;; ()
(part:set-distribution-mode #t)
;; #t

To use distributed history after it is enabled, create model geometry. At some point in the modeling, name it using roll:name-state. From that state, you can roll to some previous state using roll. Any new modeling operations performed from this state on are created in a new branch.

; roll:name-state
; Define a new part
(define my_part (part:new))
;; my_part
; Define a new view for the part
(define my_view (view:dl my_part))
;; my_view
(env:set-active-part my_part)
;; ()
(part:set-distribution-mode #t)
;; #t
(define my_sph1 (solid:sphere (position 0 0 0) 10))
;; my_sph1 => #[entity 1 1]
(define my_sph2 (solid:sphere (position 5 10 20) 10))
;; my_sph2 => #[entity 2 1]

; Name the current state.
(roll:name-state "first_branch")
;; "first_branch"
; roll back to before this creation
(roll "start")
;; 2

; Any modeling created from now on goes into a
; new history stream.
(define my_block (solid:block

(position -5 10 -20) (position 5 -10 20)))
;; my_block => #[entity 3 1]
; Name the current state.
(roll:name-state "second_branch")
;; "second_branch"
(roll "first_branch")
;; 3
(roll "second_branch")
;; 3
PDF/KERN/07HIST.PDF
HTM/DATA/KERN/KERN/07HIST/0019.HTM