heres the code ntweisen
============================================
Sub setpro()
Dim thePartDoc As Document
Set thePartDoc = CATIA.ActiveDocument
Set documents1 = CATIA.Documents
Set partDocument1 = documents1.Item("6611.CATPart")
Set part1 = partDocument1.Part
Set hybridBodies1 = part1.HybridBodies
Set hybridBody1 = hybridBodies1.Item("Geometrical Set.1")
Set hybridShapes1 = hybridBody1.HybridShapes
Set Line1 = hybridShapes1.Item("Line.1")
Dim theProduct As Product
Set theProduct = thePartDoc.Product
CATIA.Documents.Add "Process"
Dim thePPRDoc As Document
Set thePPRDoc = CATIA.ActiveDocument
'*************************************************************
'*** Load Prismatic Machining Workbench
'*************************************************************
Dim theProcess As AnyObject
Set theProcess = thePPRDoc.GetItem("Process")
Set MfgDoc1 = CATIA.ActiveDocument
Set ActivityRef = MfgDoc1.GetItem("Process")
Set childs = ActivityRef.ChildrenActivities
If (ActivityRef.IsSubTypeOf("PhysicalActivity")) Then
Set childs = ActivityRef.ChildrenActivities
quantity = childs.Count
If quantity <= 0 Then
Exit Sub
End If
NumberOfSetup = 0
For i = 1 To quantity
Set child = childs.Item(i)
If (child.IsSubTypeOf("ManufacturingSetup")) Then
Set Setup1 = child
NumberOfSetup = NumberOfSetup + 1
Exit For
End If
Next
End If
If NumberOfSetup <= 0 Then
Exit Sub
End If
Setup1.Product = theProduct
Dim Prod As Product
Set Prod = Setup1.Product
Set ProgramList = Setup1.Programs
Set Program1 = ProgramList.GetElement(1)
Dim Machine1 As ManufacturingMachine
Set Machine1 = Setup1.CreateMachine("Mfg3AxisMachine") ' creates a mahine
Dim Mo As ManufacturingOperation
Dim Mo1 As ManufacturingOperation
Set Mo = Program1.AppendOperation("MfgFollowCurve", 1)
Mo.SetTool ("End Mill D 25")
Call Mo.SetGeometry("GuidingElements", Line1, Prod, 0)
End Sub
==========================================