Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

CATIA Machining catscript for cuver following

Status
Not open for further replies.

BenhurME

Mechanical
Feb 5, 2012
4
I wrote a catscript to set up the machining workbench in catia and load the component , but i cannot link the curve to be machined with curve following operation, It fails ,

if i open the failed operation manually and then re-run the program it worked.

i dont know what im doing wrong and the help files for automation arent helpfull at all.
CATIA V5 R19 .

i CAN post the code if anyone has worked on machining.

i would really grateful if anyone cold help.
 
Replies continue below

Recommended for you

i always knew Questions on machining scripts for CATIA would be a dead end?
 
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
==========================================
 
I don't have access to any of the machining workbenches at the moment, so I can't attempt to find the solution myself, but you could try something like after you set the tool:

Set motion1 = Mo.InsertToolMotion("MfgFollowCurve", 1)
Call Mo.SetGeometry("GuidingElements", Line1, Prod, 0

I actually tried doing something similar to this with KWE and posted about it on the COE forum ( but the responses I got bascially said it was not possible with KWE.

-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor