cancel
Showing results for 
Search instead for 
Did you mean: 

Add Line in UDO Matrix, via UI SDK

Former Member
0 Kudos

Hello,

I’m working on an AddOn that it includes a step of adding a line in a UDO’s matrix. By using the oMatrix.AddRow(1,oMatrix.RowCount); command it’s duplicating all the attributes (hidden or visible) of the last row. After using the oMatrix.ClearRowData(oMatrix.RowCount); command the visible cells are cleared but not the hidden ones (including the LineID and other identifying features of the line). This results is that the UDO is not able to be updated due to the rows not being unique. Unfortunately the Add Line option in the right click menu has its own unique ID for every UDO matrix that doesn’t seem to follow a distinctive pattern.

My goal is to just Add a new empty line in the matrix that I can then fill. Can anyone help?

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member390407
Contributor
0 Kudos

Hi Aggelos,

Please try the following:

oMatrix.AddRow();
oMatrix.FlushToDataSource();
oMatrix.LoadFromDataSource();

The idea is that you need to add your new row to matrix data source and refill your matrix from this datasource. Otherwise you get this copied lines.