Extended modules > Advanced Machining > Machining customization > Creo Elements/Direct Modeling - Creo Elements/Direct Machining - Integration Kit - Hole Definition
  
Creo Elements/Direct Modeling - Creo Elements/Direct Machining - Integration Kit - Hole Definition
MACHADV-DEFINE-HOLE [macro]
The machining module provides a LISP Macro which can be used to create holes with freely stepped cross section. The code creating the geometry of the hole can attach tolerance and threads information to the model as well.
(cad-cam-link-ui::machadv-define-hole ....)
Parameter:
Name
Data Type
Type
Description
:part
SEL_ITEM
Must
The part, the hole will be drilled into.
* 
The macro doesn't change the current part settings.
:axis-start-pos
GPNT3D
Must
Start position of the hole, i.e. the position where the axis crosses the start face
:axis-dir
GPNT3D
Must
axis direction of the hole, normally the axis of the bore operation
:feature-name
string
optional
Name of the feature, which will be visible within the Structure browser, if not given or set to NIL the feature will not be named at all
:feature-type
keyword
Must
Currently fixed, only possible values are NIL and :cad-cam-link-stepped-hole, there will be a list of possible values later
:constructor
LISP-Form
Must
The Lisp form which is evaluated within the internal sd-call-cmds to create the geometrical representation of the hole as well as defining threads.
For further informations about the restrictions to this form please refer to the documentation about sd-call-cmds. (This link is available only in the English documentation.)
:success
LISP-Form
Optional
A Lisp form which is evaluated when the constructor-form does not cause an error.
This is the form used as success-form within the sd-call-cmds used to evaluate the constructor-form During the evaluation of the success-form, the global variable *SD-ACTION-RESULT* is bound to the action result of the last action routine that was called within the constructor-form.
:failure
LISP-Form
Optional
A Lisp form which is evaluated when the constructor-form causes an error. This is the form used as failure-form within the sd-call-cmds used to evaluate the constructor-form. For further informations about the failure form please refer to the documentation about sd-call-cmds. (This link is available only in the English documentation.)
Restrictions:
All restrictions applicable for sd-call-cmds apply here too.
The cross-section contour has to
be made of straight lines, resulting in cylindrical, and conical faces, and planar bottom faces,
create one body, if it were used to create an object by turn.
create real holes, i.e. has to be extended far enough in case of curved start or end faces.
The operation creating the hole is not allowed to create different features like additional grooves for O-Ring seals.
Chamfers have to be created by the command CHAMFER, if you want to export them as chamfers. Simply creating the shape of a chamfer will transfer the cone as a cone.
It is planned to support blends in a subsequent release (date not yet fixed), but the same restrictions will apply as for chamfers.
Fig. 1 : Supported Contour
Fig. 2 : Drill Tip may cut into material
Fig. 3 : Invalid due to recess
Fig. 4 : Invalid due to separation into two holes
Fig. 5 : Invalid due to Undercuts
Fig. 6 : Invalid due to additional Groove
Fig. 7 : Invalid due to additional blends
Fig. 8 : Invalid due to conical hole
Example
The following example extracted from a sd-defdialog creates a stepped hole with the diameters 40, 20, and 40 creating 4 chamfers afterwards.
:ok-action

'(let* ((part (sd-inq-curr-part))
(axis-start-pos origin)
(axis-dir 0,0,-1)
(feature-name)
(feature-type)

(poly_points '(0,0 60,0 60,20 50,20 50,10 10,10 10,20 0,20 :close))
)

(cad-cam-link-ui::machadv-define-hole

:part (oli::sd-inq-curr-part)

:axis-start-pos axis-start-pos
:axis-dir axis-dir

:feature-name feature-name

:feature-type feature-type
:constructor
`(let (
(curr-wp (sd-inq-curr-wp))
(geo-mode (sd-inq-geometry-mode))
)

(unless (eq geo-mode :real)
(geometry_mode :real)
)
(create_workplane
:new :pt_dir

:origin ,axis-start-pos

:normal :x :u_dir ,axis-dir
)

(apply #'polygon ',poly_points)

(bore :axis ,axis-dir :turn_angle (* 2.0 pi))

(chamfer :check :dist_angle
(sd-vec-add ,axis-start-pos

20,0,0) :new_angle_dist 1 45
(sd-vec-add ,axis-start-pos

10,0,-10) :new_angle_dist 2 45
(sd-vec-add ,axis-start-pos

10,0,-50) :new_angle_dist 3 45
(sd-vec-add ,axis-start-pos

20,0,-60) :new_angle_dist .5 45
)

(delete_3d (sd-inq-curr-wp))

(when curr-wp (CURRENT_WP curr-wp))

(unless (eq geo-mode :real)
(geometry_mode geo-mode)
)
)
)
)