(in-package :examples) (use-package :oli) (setf box_feedback nil) (sd-defdialog 'Teilemasse-anzeigen :toolbox-button T ; oder nil.. das ist geschmacksache. ;-) :dialog-control :sequential :variables '( (the-box) (the-face :selection *sd-plane-seltype* :no-highlight t ;;selektierte Flaeche wird dann nicht hervorgehoben :prompt-text "AuÞenflÌche des Teiles selektieren um die Fertigmasse anzuzeigen." :initial-value nil :title "Eb. FlÌche:" :before-input (sd-end-feedback box_feedback) :after-input (progn (setf the-part (sd-inq-obj-pathname the-face)) (setf the-part (sd-pathname-to-obj the-part)) (setf hdir (sd-plane-normal (sd-inq-geo-props the-face :dest-space :global))) (setf ldir (sd-plane-u-dir (sd-inq-geo-props the-face :dest-space :global))) (setf z-dir hdir) (setf x-dir ldir) (setf the-box (sd-inq-exact-box the-part z-dir x-dir :source-space :global :dest-space :global)) (setf box_feedback (sd-start-box-feedback (sd-box-points (first the-box) (second the-box) z-dir x-dir) :color 1.0,1.0,0.5)) ) ) ) ;; end variables :ok-action '(let ( Laenge Breite Hoehe ) (sd-end-feedback box_feedback) (setf Laenge (abs (sd-vec-length (sd-vec-subtract (nth 1 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) (nth 0 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) )))) (setf Breite (abs (sd-vec-length (sd-vec-subtract (nth 3 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) (nth 0 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) )))) (setf Hoehe (abs (sd-vec-length (sd-vec-subtract (nth 4 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) (nth 0 (sd-box-points (first the-box) (second the-box) z-dir x-dir)) )))) (setq VOLUMEN (sd-call-cmds (get_vol_prop :for_part :part_asmb (sd-inq-obj-pathname the-part) :volume) :failure nil );sd-call-cmds );;setq volume (display (format nil " ~%~%Aussenabmasse: ~A" (sd-inq-obj-pathname the-part) ) ) (display (format nil " ~A x ~A x ~A " (sd-num-to-string Laenge 2) (sd-num-to-string Breite 2) (sd-num-to-string Hoehe 2))) ) ;; end let / ok-action :cleanup-action '(sd-end-feedback box_feedback) ) ;; end dialog