In a protocol, you can use the notify 220 to set column(s) on a table in one call.
Is there a similar way to do this in an Automation script? Or is the only option to use element.SetParameterByPrimaryKey() multiple times?
A workaround would be to adapt the driver to receive the command from the script and do the Setcolumns command via the protocol, but that's not desirable.
The notify protocol 220 isn't available from an Automation script. However the notify protocol 336 NT_FILL_ARRAY_WITH_COLUMN_ONLY_UPDATES is available first argument needs to be an object[] 0. DMAID 1. EID 2. PID (table or column PID) and for the second argument the same data that would be passed on in a notify call from a QAction
Not a recommended answer (would be better to request a new software feature), but another workaround could be to use an SLNet message.
The example below is for a notify 225 (NT_SET_ROW), but can be changed to a 336 (NT_FILL_ARRAY_WITH_COLUMN_ONLY_UPDATES) (see Davy's answer):
var table = protocol.FindParameter(tableID);
var columns = table.GetColumnPrototypes(protocol, true);var data = new object[columns.Count()];
var ids = new object[4] { dmaID, elementID, tableID, tableIndex };foreach (var paramInfo in columns)
{
data[table.GetColumnIdxForPid(paramInfo.ID)] = value;
}var sdmim = new SetDataMinerInfoMessage((int)NotifyType.NT_SET_ROW, eiem.HostingAgentID, int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue, "", "");
sdmim.ElementID = elementID;
sdmim.Var1 = ids;
sdmim.Var2 = data;
engine.SendSLNetMessage(sdmim);
Moderator note: Note that this is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.
I ended up knowing that Notify Protocol calls cannot be “replicated” as SetDataminerInfoMessage, only Notify Dataminer methods. So it’s actually impossible (as far as I am aware) to do it.
it works! Thanks