Automatically saving the current model before OneSpace Modeling terminates

You can subscribe to the *SD-TERMINATE-EVENT* and execute a function which saves all currently loaded assemblies and parts. Here's a very simple example.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Description:  Saves model before OneSpace Modeling terminates
;; Author:       Claus Brod
;; Created:      1/14/2005 19:20    
;; Language:     Lisp
;;
;; (C) Copyright 2005 Claus Brod, all rights reserved
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
(defun exit-fun(arg &rest args)
  (save_package :recursive :all_at_top 
                :FILENAME (format nil "~A/exitsave.pkg" (oli:sd-inq-temp-dir)) :overwrite))

(oli:sd-subscribe-event oli:*SD-TERMINATE-EVENT* 'exit-fun)

Note that it is not clearly defined which parts of the termination OneSpace Modeling has already performed when it processes the *SD-TERMINATE-EVENT*, so try to do as little as possible.

-- ClausBrod - 14 Jan 2005


When asked for a TWiki account, use your own or the default TWikiGuest account.

Revision: r1.3 - 18 Dec 2006 - 20:53 - ClausBrod
CoCreateModeling > OsdmMacros > MacroTerminateEvent
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback