I'm new to .Net development for Process Sim
I'm trying to create a new operation and some operationlocations.
Dim rOpData As New TxGenericRoboticOperationCreationData("Operation1") Dim rOp = TxApplication.ActiveDocument.OperationRoot.CreateGenericRoboticOperation(rOpData)
When I run these lines I get a TxUnknownErrorException and the method TxApplication.ActiveDocument.OperationRoot.CanCreateGenericRoboticOperation() allways returns false.
What am I doing wrong? And what is the procedure to create operations and locations?
Solved! Go to Solution.
Dim ActiveDocument As TxDocument ActiveDocument = TxApplication.ActiveDocument Dim OperationRoot As TxOperationRoot OperationRoot = ActiveDocument.OperationRoot Dim creationData As New TxGenericRoboticOperationCreationData() 'Optional you can define the name 'Dim name As String 'Dim GenericRoboticOperationCreationData As New TxGenericRoboticOperationCreationData(name) Dim GenericRoboticOperation As TxGenericRoboticOperation GenericRoboticOperation = OperationRoot.CreateGenericRoboticOperation(GenericRoboticOperationCreationData)
Ok that's very interesting. I have just tested fast times the code and it works. What a Vesion Tecnomatix PS do you use? And you have also loaded a Study?
In PS on Teamcenter platform you cannot create a Generic Robotic Operation directly under the Operation Root. Process Simulate operations are created under Teamcenter operations (there are some exceptions). You can create Generic Robotic Operation under a Teamcenter Operation. So in the data that you have you can select the "Weld" operation that is in the snapshot and cast it to ITxOperationCreation and then create the Generic Robotic Operation under it.
You can check that behavior when you select the Operation Root and then try to create a Generic Robotic Operation from Process Simulate UI (New Operation command), check that it is disabled for Generic Robotic Operation.