I have 2 questions.
1. In some step of my process, I create some number of parts (all information about how muche are in table) but when I have first sheet method creat sum of all parts in table. What I'm doing wrong?
2. In order I have situation when I have e.g. 5 parts, every parts have length = 0,6 and width = 0,8, so the sum of the fields is 2,4m^2 and sheet field is 2m^2. And now I looking way to split it to 2 sheets . From firts sheet I will have 4 element and small rest and from second 1 element and rest. Any advices ?
Or is it possible to check that parts fit on the sheet? Because in example given above it's known that 4 parts 0,6x0,8m it's not possible cut form one sheet 2x1m
In your outer loop ( for j:=1 to Datatable.ydim loop..)
you are looping through all rows until the last row of the datatable ( datatable.ydim)
If you just want to create "part_1" parts you have to insert some restriction between outer and inner loop
outer loop if datatable[2,j]="part_1" then .... inner loop end;
with the posted restriction you are "just" filtering ALL "part_x" according to your needs.
as through the outer loop you are still looping through all rows of the datatable
So now I have that method:
for j:=1 to DataTable.ydim loop if datatable[1,j]="part_1" then for k:=1 to DataTable[2,j] loop part:= .MUs.Entity.create(Elements); part.MuWidth:=DataTable[6,j]; part.MuLength:=DataTable[5,j]; part.name:=DataTable[1,j]; next; end; next;
and this work only for "part_1", so what I should change?
I try that way
order.setCursor(1,1); if order.find(@.name) then local index : integer := Order.cursorY; num_parts := Order["num_parts", index]; if @.Name="Part_Nr_1" then @.delete; for i:=1 to num_parts loop .Models.saw.Element_1.create(Elements); next elseif ...
but here I will have a lot of "elseif" and I don't know how commends use to create part with name,width and length, because thouse frome 1 code doesn't works.