Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

VBA Code to add a RobotTask to a CATProcess

Status
Not open for further replies.

RealAleFan

Aerospace
Joined
Sep 19, 2013
Messages
3
Location
FR
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
 
Hi all,

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top