Extended modules > Advanced Machining > Machining customization > Customizing parameter advice
  
Customizing parameter advice
This is an example file showing the possibility to customize the blind hole dialog boxes Creo Elements/Direct Machining Advisor by using the Creo Elements/Direct Modeling Integration Kit. This example is maintained according to the actual status of Creo Elements/Direct Machining Advisor. The file is not guaranteed to work with future releases of Creo Elements/Direct Machining Advisor without the changes that are required in absolutely necessary cases.
No guarantee is implied that the values conform to the standard.
|#
;;
;;---- all customization of Dialogs belonging to Machining Advisor have to be
;;---- made within package ':cad-cam-link-customization'
;;
(in-package :cad-cam-link-customization)
;;
;;---- To use the Integration Kit functionality, you have to use the package 'oli'
;; which contains all the functions of the Integration Kit and stands for
;;---- Open-Lisp-Interface
;;
(use-package :oli)
;;
;;----
For more information about the function names
;; mentioned below, please refer to the Data table customization.
;;
;;----
;;---- When a hole dialog gets a diameter or depth value, it will check
;; those values against the model and against rules either built-in
;; to Machining Advisor or supplied by the user.
;;
;; In order to achieve this, there is a callback interface
;; provided, which allows material or site based reasoning.
;;
;;---- The function called by that callback interface has to have the
;;---- signature as follows, the function will deal with the class blind_hole
(defun check-mach_adv_library-blind_hole-parameter-fnc (&key
depth
diameter
feature-parameter
part
library
feature-long-name
feature-class-name
&aux
status
message
severity
)
;;
;;---- your code for checking the ratio depth to diameter you may do checks based
;; upon the part, its material etc. but it is not allowed that the function
;;---- gets interactive
;;---- for demonstation purposes I will supply code similar to the built-in code
(if (and diameter depth (> diameter 0.0) (> depth 0.0))
(cond ((> depth (* 200.0 diameter))
(setf
status :warning
message (format nil "*** Specified Depth ~A Exceeds 200 times Dia. ~A, you may not find any equipment capable of this machining operation ***"
(sd-num-to-string (sd-sys-to-user-units :length depth) 3)
(sd-num-to-string (sd-sys-to-user-units :length diameter) 3)
)
severity :high
)
)
((> depth (* 10.0 diameter))
(setf
status :warning
message (format nil "*** Specified Depth ~A Exceeds 10 times Dia. ~A, you may need special deep hole drilling equipment ***"
(sd-num-to-string (sd-sys-to-user-units :length depth) 3)
(sd-num-to-string (sd-sys-to-user-units :length diameter) 3)
)
severity :medium
)
)
((> depth (* 3.0 diameter))
(setf
status :warning
message (format nil "*** Specified Depth ~A Exceeds 3 times Dia. ~A, you may need to take special care while drilling ***"
(sd-num-to-string (sd-sys-to-user-units :length depth) 3)
(sd-num-to-string (sd-sys-to-user-units :length diameter) 3)
)
severity :low
)
)
(t (setf status :ok message "" severity :none)) ) ;; end cond
(setf status :ok message "" severity :none)
)
(values status message severity))
;;
;;---- this function will be called by Machining Advisor with
;;
;; :depth { longfloat }
;; :diameter { longfloat }
;; :part { SEL_ITEM }
;; :library { STRING [ "mach_adv_library" ]}
;; :feature-long-name { STRING }
;; :feature-class-name { STRING }
;; :feature-parameter { property-list or structure }
;;
;;---- and is expected to match the return value requirements for confimation with
;; warning dialog functions used within sd-defdialog
;;
;; The callback-interface expects the function to do a multiple-value return
;; i.e. use (values return-value advisor-message severity)
;; The following return values are allowed :
;; return-value { :ok | :error | :warning }
;; advisor-message { STRING }
;; severity { :none | :low | :medium | :high }
;;