Cancel
Showing results for 
Search instead for 
Did you mean: 

Why TxRoboticSeamOperation doesn't have TxRobot? How to Get?

Valued Contributor
Valued Contributor

hello,

I wanna get the TxRobot while path operation is selected, but cannot get when Operation is TxRoboticSeamOperation, that's why? and if it can be got, How to do?

 

thanks

 

some code like below:

if (IOp is TxWeldOperation weldOp)
{
locaOpList = weldOp.GetAllDescendants(weldViaLocaOpFilter);
robot = weldOp.Robot as TxRobot;
}
else if (IOp is TxGenericRoboticOperation genericRobotOp)
{
locaOpList = genericRobotOp.GetAllDescendants(genericViaLocaOpFilter);
robot = genericRobotOp.Robot as TxRobot;
}
else if (IOp is TxContinuousRoboticOperation continueOp)
{
locaOpList = continueOp.GetAllDescendants(viaLocaOpFilter);
robot = continueOp.Robot as TxRobot;
}
else if (IOp is TxRoboticSeamOperation seamOp)
{
locaOpList = seamOp.GetDirectDescendants(seamLocaOpFilter);// cannot get robot.
robot = seamOp
}

2 REPLIES

Re: Why TxRoboticSeamOperation doesn't have TxRobot? How to Get?

Phenom
Phenom

Hello @ErnestA

 

You're not being able to collect the Robot object because TxRoboticSeamOperation does not implement ITxRoboticOrderedCompoundOperation interface (which enables you to collect the robot).

 

I'm not used to seam operations, so I'm attaching below an image showing everything that appears when I search the interface above in the manual doc. Probably every operation that can collect a robot should be in the list (so a seam operation should be inside of one of the objects listed below).

 

Tecnomatix.NET.jpg

 

Although, seeing your code, I assume you could use Interfaces to make your code cleaner (you can avoid a lot of the if/elseif statements) and safer. Have you tried that?

 

Regards, 

Re: Why TxRoboticSeamOperation doesn't have TxRobot? How to Get?

Valued Contributor
Valued Contributor
Great, helped a lot.

no need to get TxRoboticSeamOperation or TxWeldOperation or something else, just get ITxRoboticOrderedCompoundOperation and then the ITxRobot and the ITxLocationOperation both can be got.

thanks very much, your advice helped a lot.