you could run through the table using an loop, create an MU and set width and length according to the data in the table rows e.g: if your width is in column2 and length in column 3 the syntax could look like this (new syntax)
var part : object
for var i:=1 to tableFile.yDim loop
the columns with width and length should have the data type real
I do it that but something is wrong, and this method will create object called "Entity", but if I want name from first column, should I add??
first, if you want to create a certain number of parts then you cannot use the source as destination, use instead e.g. a buffer
The attribute for setting the name is "name". For creating the number of parts from column 2 of your DataTable, you need a second loop e.g.
for i := 1 to DataTable.yDim loop for k:=1 to DataTable[2,i] loop part:= .MUs.Entity.create(buffer); part.MuWidth:=DataTable[5,i]; part.MuLength:=DataTable[6,i]; part.name:=DataTable[1,i] next; next;
Great, thank you for help.
If I want add to this table next column with information about color, information in table should be integer ? Is it even possible ? Or Should I create method when e.g. if "red" then:
but that is wrong.
if you work with the vector graphics, the command is:
if you deactivate the vector graphics, you can add icons to the MU and name them ("red","green"), Then you can use
part.currIcon:=DataTable ["color", j]
to show the right Icon.
If you edit your table manually, you can also set the background color of the table cell with the color you need. Then you can read this background color and set it als MU color:
I you want to transfer the cell colors between two tables, you need: