#|

Link to FE

Note: This is an example file showing concepts of the Integration Kit. The code itself is not supported and will never be supported.
|#


(in-package :EXAMPLES)
(use-package :OLI)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(sd-defdialog 'fesat
  :dialog-title "FE/SAT"
  :variables
  '((JJ_PART :value-type :part :modifies :nil :title "Part")
    (JJ_ASSY :value-type :assembly :modifies :nil :title "Assembly"))
  :mutual-exclusion '(jj_part jj_assy)
  :start-variable 'JJ_PART
  :ok-action
  '(let* ((name (sd-inq-obj-basename (or jj_part jj_assy)))
	  (temp (sd-inq-temp-dir))
	  (tempdir (format nil "~Afesat" temp)))
     (sd-make-directory tempdir)
     (sd-with-current-working-directory tempdir
	 (sd-call-cmds
	  (save_sat (or jj_part jj_assy)
		    :filename :overwrite (format nil "~A.sat" name)))
	 (with-open-file
	     (fp "start.cmd" :direction :output)
	   (format fp "Fesat~%Geometry~%edit edit_target \"~A\" ;~%" name)
	   (format fp "setup geom_mode precise ;~%quit~%~%")
	   (format fp "Fesat~%translators~%quit~%~%")
	   (format fp "direct pkg \"ACIS_ASCII\"~%import \"~A.sat\"~%" name)
	   (format fp "yes~%quit~%~%")
	   (format fp "view fit all_geom ;~%quit~%~%")
	   (format fp "Fesat~%")
	   )
	 (system "fesat"))))  ;; arbitrary application here


;;