cancel
Showing results for 
Search instead for 
Did you mean: 

Cuttiing and creating parts

Pioneer
Pioneer

Hello

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?
photo1.png

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

Regards

5 REPLIES

Re: Cuttiing and creating parts

Phenom
Phenom

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

 

like  

outer loop

 if datatable[2,j]="part_1" then .... 
         inner loop
end;

 

 

Re: Cuttiing and creating parts

Pioneer
Pioneer

But if I don't know how muche rows with "part_x" I will have?

Re: Cuttiing and creating parts

Phenom
Phenom

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

Re: Cuttiing and creating parts

Pioneer
Pioneer

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.

Regards

 

Re: Cuttiing and creating parts

Phenom
Phenom

1. What doesn't work in 1. code ?

 

2. What problem do you have using a couple of else if commands ?

     you can also use switch .. case