cancel
Showing results for 
Search instead for 
Did you mean: 

insert a composite command

Creator
Creator

how do i insert a correct composite command, which will be accepted by the OLPCommands UI (Patheditor) in the correct way instead of just a plain text.

I simply tried to create a composite command by the following code.

 

private void insertCommand(TxRoboticCompositeCommand preCmd, double pos)

{

//insert WaitPaint before or change it

TxRoboticCompositeCommandStringElement strElement = new TxRoboticCompositeCommandStringElement();

strElement.Type = "CustomizedOLPName";

strElement.Value = "WaitPaintPosition";

TxRoboticCompositeCommandIntElement intElement = new TxRoboticCompositeCommandIntElement();

intElement.Type = "Position";

intElement.Value = Convert.ToInt16(pos);

ArrayList arrList = new ArrayList();

arrList.Add(intElement);

arrList.Add(strElement);

TxRoboticCompositeCommandCreationData data = new TxRoboticCompositeCommandCreationData(arrList);

TxRoboticCompositeCommand newCommand = comp.CreateCompositeCommand(data);

}

 

This works, but when i change it in the OLP commands UI, it is a plain text.

 

Is there something like the expression builder for commands?

 

best regards

Thomas

2 REPLIES

Re: insert a composite command

Genius
Genius

Hello Titaniser,

 

Your command is probably created with the correct layers, but the OLP UI is a plain text. To correct that you must set the "Text" property of the the composite command (newCommand.Text).

 

Use a command that is correct to see how to define this text property. It is like a combination of the OLP dialogue name with an "ID" code (this ID looks to be "random", only thing that I checked is that same IDs creates grouped OLP commands)

 

Regards!

Re: insert a composite command

Creator
Creator
Hello FredCastro,

that works very well.
i've just added the text of a working command plus a unique id.

var id = Guid.NewGuid().ToString();

newCommand.Text = "OLP_CUSTOMIZED_COMMAND_NAME=Tracking|WaitPaintPosition;OLP_CUSTOMIZED_COMMAND_ID=e" + id;
newCommand.Name = "WaitPaintPosition";