04-02-2018 11:05 PM
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
}
Solved! Go to Solution.
04-03-2018 04:44 PM
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).
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,
04-04-2018 02:08 AM
Watch Replays of Previous Topics