Cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign MFG feature using AssignMfgFeature method

Valued Contributor
Valued Contributor

I am using AssignMfgFeature of a TxCompoundOperation instance to assign a weld point to it and get the 

"TxCannotAssignWpToOperationException". Is there any steps I missed? I will appreciate for any reply.

6 REPLIES

Re: How to assign MFG feature using AssignMfgFeature method

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi KX,

 

For weld point you need TxWeldOperation instead of TxCompoundOperation.

 

Best Regards,

DianaG

Re: How to assign MFG feature using AssignMfgFeature method

Valued Contributor
Valued Contributor

Thanks DianaG for the suggestion.

I tried to assign a WeldPoint to TxWeldOperation with following code: 

  

string weldPointName = "wp2100";

var weldOperation = operationList[0] as TxWeldOperation;
if (weldOperation == null) return;
var wlo = weldOperation .CreateWeldLocationOperation(new TxWeldLocationOperationCreationData(weldPointName )
{
WeldPointCreationData = TxMfgCreationDataFactory.CreateWeldPointCreationData(weldPointName , new TxTransformation())
});

 

I did create a weld point node however the properties view was emptyerror.png

Thanks in advance for any help.

Re: How to assign MFG feature using AssignMfgFeature method

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi KX,

 

You need to assign the weld point data to the location operation.

var weldOperation = operationList[0] as TxWeldOperation;
ITxWeldPointCreationData weldPointData = TxMfgCreationDataFactory.CreateWeldPointCreationData("weld point", new TxTransformation()); TxWeldLocationOperationCreationData weldLocOpData = new TxWeldLocationOperationCreationData("weld loc op"); weldLocOpData.Duration = 5; weldLocOpData.WeldPointCreationData = weldPointData; TxWeldLocationOperation weldLocOp = weldOperation.CreateWeldLocationOperation(weldLocOpData);

Best Regards,

 

DianaG

Re: How to assign MFG feature using AssignMfgFeature method

Valued Contributor
Valued Contributor

Hi DianaG,

Thanks for your reply.

The properties view is still empty. Here is the code I am using, 

var wo= operationList[0] as TxWeldOperation;
if (wo == null) return;
string pointName = "wp2100";
ITxWeldPointCreationData weldPointData = TxMfgCreationDataFactory.CreateWeldPointCreationData(pointName, new TxTransformation());
TxWeldLocationOperationCreationData weldLocOpData = new TxWeldLocationOperationCreationData(pointName); 
weldLocOpData.Duration = 5; 
weldLocOpData.WeldPointCreationData = weldPointData;
TxWeldLocationOperation weldLocOp = wo.CreateWeldLocationOperation(weldLocOpData);

It seems that a new WeldPoint with name "wp2100" is created, I meant to assign an existing WeldPoint to a weld operation.

Re: How to assign MFG feature using AssignMfgFeature method

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi KX,

 

To see the properties of the new weld location operation, first you need to update the eMServer. You can verify that it is the same behaviour when you create a weld operation from the UI.

If you don't want to create a new location operation but to use existing, then you can copy/paste it:

 

 ITxObjectCollection weldOp = TxApplication.ActiveSelection.GetItems()[0] as ITxObjectCollection;
 weldOp.Paste(new TxObjectList() { weldLocOp }, false);

 

Best Regards,

Diana

Re: How to assign MFG feature using AssignMfgFeature method

Valued Contributor
Valued Contributor

Hi DainaG,

 

Thanks a lot for your help. I created a new Discussion for the problem I meet.

Best regards

Kaixuan