dimanche 24 novembre 2013

Part Design

Well, now you can create sketches, let use them in Part Design workbench.


1) Basic features

-Creating a pad

Let's tell that your part is opened. Your sketch is called My_Sketch and you want a pad of 20mm height. The code is the following :


'Get the part
Dim My_Part as Part
Set My_Part = CATIA.AcctiveDocument.Part

'Get the part body in the part, assuming your main body is called PartBody
Dim My_Body As Body
Set My_Body = My_Part.Bodies.Item ( "PartBody" )

'Create the pad
Dim My_Pad As Pad
Set My_Pad = My_Part.ShapeFactory.AddNewPad ( My_Sketch, 20.000000 )

My_Part.Update


-Creating a pocket

It's the same start, the only change is the following :

Dim My_Pocket As Pocket
Set My_Pocket= My_Part.ShapeFactory.AddNewPocket ( My_Sketch, 20)

My_Part.Update

Similary :

-Creating a shaft : use AddNewShaft