CATIA Machining catscript for cuver following
CATIA Machining catscript for cuver following
(OP)
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.
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.





RE: CATIA Machining catscript for cuver following
RE: CATIA Machining catscript for cuver following
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com
RE: CATIA Machining catscript for cuver following
============================================
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
==========================================
RE: CATIA Machining catscript for cuver following
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 (http://www.coe.org/p/fo/st/thread=23647) but the responses I got bascially said it was not possible with KWE.
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com