VBA Code to add a RobotTask to a CATProcess
VBA Code to add a RobotTask to a CATProcess
(OP)
Hi All,
Does anyone here know what code is required to add a ROBOTTASK to a CATProcess in Catia, I have some code below, but I can't seem to find the object to add it to.
Dim objRobotTaskFactory As RobotTaskFactory
Dim objRobotTask As RobotTask
objRobotTaskFactory.CreateRobotTask "New_RobotTask_1", objRobotTask
please see attached word document for a PPR tree view, the first screenshot is of the PPR tree as it is now, the second screenshot is what I want to achieve.
I've also included the code that I used to create a tag list and tag, I assumed I'd need something similar to add the ROBOTTASK
If this is not the correct Forum to post this in could you point me in the right direction.
Best regards
Derek
Does anyone here know what code is required to add a ROBOTTASK to a CATProcess in Catia, I have some code below, but I can't seem to find the object to add it to.
Dim objRobotTaskFactory As RobotTaskFactory
Dim objRobotTask As RobotTask
objRobotTaskFactory.CreateRobotTask "New_RobotTask_1", objRobotTask
please see attached word document for a PPR tree view, the first screenshot is of the PPR tree as it is now, the second screenshot is what I want to achieve.
I've also included the code that I used to create a tag list and tag, I assumed I'd need something similar to add the ROBOTTASK
If this is not the correct Forum to post this in could you point me in the right direction.
Best regards
Derek





RE: VBA Code to add a RobotTask to a CATProcess
I've found a solution, it might not be perfect code but it seems to work ok
Best regards to everyone who looked
Derek
Sub Create_Task()
Language = "VBSCRIPT"
Set CATIA = GetObject(, "CATIA.Application")
Set ProcessDocument1 = CATIA.ActiveDocument
Set objRobot = ProcessDocument1.PPRDocument.Resources.Item(1)
Set objRobot = objRobot.Products.Item(2)
Set objRobot = objRobot.Products.Item(1)
Set objRobotTaskFactory = objRobot.GetTechnologicalObject("RobotTaskFactory")
objRobotTaskFactory.CreateRobotTask TapeName, objRobotTask
End Sub