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!

VBA Code to add a RobotTask to a CATProcess

Status
Not open for further replies.

RealAleFan

Aerospace
Sep 19, 2013
3
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
 
Replies continue below

Recommended for you

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

Top