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