06-05-2018 01:23 PM
Hello ,
I want to assign a part of loaded study to an operation. I found there are TxPlanningPart and TxPlanningOperation, both have property and method for assigning part to operation. Bcz of delegates and events for assigning part to operation, i want to know, what should be right step towards completion of my task. Plz help me and advise some steps
Thanx...
Solved! Go to Solution.
06-05-2018 05:03 PM
Hello @ChristyBell
What kind of part and operations are we talking about? Because depending on the scenario, the assignment is "automatically" done as the result of creating an operation.
Example: If you create a weld operation with some weld points, the weld points are automatically assigned to the operation. So the assign between a mfg and an operation is like the result of creating an operation with mfgs.
Regards
06-05-2018 05:34 PM
06-06-2018 05:08 PM
Hello @ChristyBell
Can you explain to me how you assign a nonsim operation manually? Because I was taking a look in the creation of a nonsim operation and there's no field to assign it to a part.
Regards!
06-06-2018 05:12 PM
06-07-2018 07:13 AM
The field you're setting is an eMServer field, so you can assign using planning representation of the object. An example of assigning a part to a selected non-sim operation:
TxObjectList partList = TxApplication.ActiveDocument.PhysicalRoot.GetAllDescendants(new TxTypeFilter(typeof(TxComponent))); TxObjectList list = TxApplication.ActiveSelection.GetAllItems(); TxNonSimOperation nsop = list[0] as TxNonSimOperation; TxPlanningOperation op = nsop.PlanningRepresentation as TxPlanningOperation; op.AssignPart(partList[0]);
Check if it works for you
Regards
06-07-2018 09:00 AM
Hi, @FredCastro,
Super your given code works. .I have a smal query now, may be u can help me in that. I want to create start signal of nonsimoperation. So , i have applied this method,
First this code create output signal and then it is set as StartinSignal of nonsimoperation.
But problem is when i click on "Create Non-Sim Start Signal" button in control menu.. It again craetes Start opearaton. That means signal created by this code is not start signal of operation. So how can i solve this problem and create start signal of nonsim operation. Can u suggest me correct way to do it?
Thanx
TxPlcOutputSignal startsig = TxApplication.ActiveDocument.PlcProgramRoot.CurrentPlcProgram.CreatePlcOutputSignal(new TxPlcOutputSignalCreationData("NonSim_Start")); startsig = nonsimoperation.StartingSignal as TxPlcOutputSignal;
06-07-2018 12:51 PM
Last line from your code looks inverted to me. Maybe:
TxPlcOutputSignal startsig = TxApplication.ActiveDocument.PlcProgramRoot.CurrentPlcProgram.CreatePlcOutputSignal(new TxPlcOutputSignalCreationData("NonSim_Start")); nonsimoperation.StartingSignal = startsig;
06-07-2018 01:03 PM
Watch Replays of Previous Topics