;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Filename: cadde-29-004994.lsp ;; Project: privat ;; Description: show the over all Measurement of one selected 3D object ;; Version: 90.0x ;; ;; Customer: --cadde-- ;; Author: RainerH@forum@cad.de ;; Created: 19. Mrz. 2004 10:51 ;; Modified: Sat Nov 15 19:52:10 CET 2025 der_Wolfgang@forum@cad.de ;; SD-Version: should work in older and newer versions as well as in big Modeling and PExy ;; reference: https://ww3.cad.de/foren/ubb/Forum29/HTML/000980.shtml ;; ;; docu https://support.ptc.com/help/creo_elements_direct/r20.8.0.0/advanced_documentation/integration_kit/reference/inq_geo.html#sd-inq-exact-box ;; docu https://support.ptc.com/help/creo_elements_direct/r20.8.0.0/advanced_documentation/integration_kit/reference/util_vec.html#sd-vec-subtract ;; docu https://support.ptc.com/help/creo_elements_direct/r20.8.0.0/advanced_documentation/integration_kit/reference/strings.html#sd-num-to-string ;; docu https://support.ptc.com/help/creo_elements_direct/r20.8.0.0/advanced_documentation/integration_kit/reference/util_misc.html#sd-sys-to-user-units ;; ;; Language: Lisp ;; Package: :cadde ;; ;; (C) Copyright 2025 we@forum@cad.de, all rights reserved. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :cadde-wt) (use-package :oli) (sd-defdialog 'Show_Object_Measurement :toolbox-button T ; oder nil.. das ist geschmacksache. ;-) :dialog-control :sequential :variables '( (the-part :value-type :part :prompt-text (sd-multi-lang-string "Specify the part to get the measurement of." :german "Teil selektieren um die Fertigmasse anzuzeigen") :modifies nil ) ) ;; end variables :ok-action '(let (the-box z-dir x-dir ausgangs-punkt end-punkt fertig-masse Laenge Breite Hoehe ) (setf z-dir 0,0,1) (setf x-dir 1,0,0) (setf the-box (sd-inq-exact-box the-part z-dir x-dir :source-space :local :dest-space :local)) (setf ausgangs-punkt (nth 0 the-box)) (setf end-punkt (nth 1 the-box)) (setf fertig-masse (sd-vec-subtract end-punkt ausgangs-punkt)) ;; fertig masse ist ein 3D vector, den zerlegt man wie folgt: (setf Laenge (gpnt3d_x fertig-masse)) (setf Breite (gpnt3d_y fertig-masse)) (setf Hoehe (gpnt3d_z fertig-masse)) ;; nun gibt es mehrere Alternativen: (display (format nil "~%~%Fertigmasse von ~A" (sd-inq-obj-pathname the-part))) (display (format nil "Version A Fertigmass: ~ax~ax~a" Laenge Breite Hoehe)) (display (format nil "Version B Fertigmass: ~Fx~Fx~F" Laenge Breite Hoehe)) (display (format nil "Version C Fertigmass: ~8,3Fx~8,3Fx~8,3F" Laenge Breite Hoehe)) (display (format nil "Version D Fertigmass: ~Ax~Ax~A mm^3" (sd-num-to-string Laenge 2) (sd-num-to-string Breite 2) (sd-num-to-string Hoehe 2))) (display (format nil "Version E Fertigmass: ~Ax~Ax~A ~A^3" (sd-num-to-string (sd-sys-to-user-units :length Laenge)) (sd-num-to-string (sd-sys-to-user-units :length Breite)) (sd-num-to-string (sd-sys-to-user-units :length Hoehe )) (sd-inq-length-units))) ) ;; end let / ok-action ) ;; end dialog