×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBA Code to add a RobotTask to a CATProcess

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

RE: VBA Code to add a RobotTask to a CATProcess

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources