Cancel
Showing results for 
Search instead for 
Did you mean: 

TxplanningOperation confusion

Pioneer
Pioneer

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...

8 REPLIES

Re: TxplanningOperation confusion

Legend
Legend

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

 

 

Re: TxplanningOperation confusion

Pioneer
Pioneer
Hi. fred,

First thanx for quick reply n ya...i have created a nonsim operation and now i want to assign a part to it. For that i m confused. Do u have idea to solve it

Thanx

Re: TxplanningOperation confusion

Legend
Legend

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!

Re: TxplanningOperation confusion

Pioneer
Pioneer

Helo @FredCastro

This way , in contextmenu of nonsim then product instance.

Re: TxplanningOperation confusion

Legend
Legend

@ChristyBell

 

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

Re: TxplanningOperation confusion

Pioneer
Pioneer

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;

 

Re: TxplanningOperation confusion

Legend
Legend

@ChristyBell

 

Last line from your code looks inverted to me. Maybe:

 

TxPlcOutputSignal startsig = TxApplication.ActiveDocument.PlcProgramRoot.CurrentPlcProgram.CreatePlcOutputSignal(new TxPlcOutputSignalCreationData("NonSim_Start"));
nonsimoperation.StartingSignal = startsig;

Re: TxplanningOperation confusion

Pioneer
Pioneer

@FredCastro hey, 

 

Ur suggested code works.....Thnax a lot....