|
CAAPriPad includes the following steps:
- Prolog
- Creating the Pad
- Modifying the Pad First Limit
- Mirroring the Pad
Prolog
The macro first loads CAAPriPad.CATPart that contains a sketch:
Sketch.1
This object have been created with the Sketcher workbench.

...
' ------------
' Get the part
' ------------
Dim oPart As Part
Set oPart = CATIA.ActiveDocument.Part
' ------------
' Get the part body in the part
' ------------
Dim oBody As Body
Set oBody = oPart.Bodies.Item ( "PartBody" )
' ------------
' Get the sketch in the body
' ------------
Dim oSketch As Sketch
Set oSketch = oBody.Sketches.Item ( "Sketch.1" )
...
|
Once the part document has been loaded, the oPart, oBody
and oSketch variables are declared to receive the instance of
the part, the partbody and the sketch.
Creating the Pad
...
' ------------
' Create the pad with a default first limit
' ------------
MsgBox "Click OK to create the pad."
Dim oPad As Pad
Set oPad = oPart.ShapeFactory.AddNewPad ( oSketch, 20.000000 )
' ------------
' Update the part
' ------------
oPart.Update
...
|
The Pad object is created from the oSketch object
with a default first limit of 20mm. The Pad object is created
using the AddNewPad method of the ShapeFactory object.
The Pad is then updated with the following result.

Modifying the pad first limit
...
' ------------
' Define the pad first limit
' ------------
MsgBox "Click OK to set the pad first limit to 40mm."
oPad.FirstLimit.Dimension.Value = 40.000000
' ------------
' Update the part
' ------------
oPart.Update
...
|
The FirstLimit property of the Pad object is set to
40mm.

Mirroring the pad
...
' ------------
' Define the pad to be symmetric relative to the sketch plane
' ------------
MsgBox "Click OK to mirror the extrusion offset."
oPad.IsSymmetric = True
' ------------
' Update the part
' ------------
oPart.Update
...
|
The IsSymmetric property of the Pad object is set
to 40mm.

|