I know this is out on a limb and I doubt this is possible, but I am tired of copying and pasting code so much.
We have an assembly where many of our sheet metal parts go over 96" long. We use a punch press to punch the holes in the sheet metal, but the maximum length of the part is 96", then we need to reposition the part.
This machine is rather old and we do manual repositions. This requires putting a note on our repeat region (which only shows the sheet metal parts to be punched) of what the reposition value is. We only do repositions in 10" increments, to keep it simple.
The size of the assembly constantly updates for different orders, so I can't just hard code the reposition value.
My problem is, I wrote code to look at the length of the part, then determine the best reposition for the part. The code is below. The problem with this is, I must copy and paste this into every part that might have a reposition, as the LENGTH parameter is constantly changing depending on the order.
Is there a way to write this code in an external file, then pass the current part length to this file and have it return the correct reposition length? This would be similar to how programming languages such as Javascript or VB handle these issues. You write the code once, then reference it anywhere (or in any part) that needs to be checked.
I assume this is possible with Java or VB, but I am not a programmer and only know a little Javascript.
Thanks in advance,
Jim
IF LENGTH>135<br style="color: rgb(0, 0, 255);"> REPOSITION=50<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>125<br style="color: rgb(0, 0, 255);"> REPOSITION=40<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>115<br style="color: rgb(0, 0, 255);"> REPOSITION=30<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>105<br style="color: rgb(0, 0, 255);"> REPOSITION=20<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>95<br style="color: rgb(0, 0, 255);"> REPOSITION=10<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);"> REPOSITION=0<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);"><br style="color: rgb(0, 0, 255);">IF REPOSITION > 0<br style="color: rgb(0, 0, 255);">REMARKS2=ITOS(REPOSITION)+'" REPOSITION'<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">REMARKS2=""<br style="color: rgb(0, 0, 255);">ENDIF
(note: The remarks2 parameter then gets added to a note that is displayed in the repeat region. If no value exists, the string is blank.)
Edited by: conrat
We have an assembly where many of our sheet metal parts go over 96" long. We use a punch press to punch the holes in the sheet metal, but the maximum length of the part is 96", then we need to reposition the part.
This machine is rather old and we do manual repositions. This requires putting a note on our repeat region (which only shows the sheet metal parts to be punched) of what the reposition value is. We only do repositions in 10" increments, to keep it simple.
The size of the assembly constantly updates for different orders, so I can't just hard code the reposition value.
My problem is, I wrote code to look at the length of the part, then determine the best reposition for the part. The code is below. The problem with this is, I must copy and paste this into every part that might have a reposition, as the LENGTH parameter is constantly changing depending on the order.
Is there a way to write this code in an external file, then pass the current part length to this file and have it return the correct reposition length? This would be similar to how programming languages such as Javascript or VB handle these issues. You write the code once, then reference it anywhere (or in any part) that needs to be checked.
I assume this is possible with Java or VB, but I am not a programmer and only know a little Javascript.
Thanks in advance,
Jim
IF LENGTH>135<br style="color: rgb(0, 0, 255);"> REPOSITION=50<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>125<br style="color: rgb(0, 0, 255);"> REPOSITION=40<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>115<br style="color: rgb(0, 0, 255);"> REPOSITION=30<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>105<br style="color: rgb(0, 0, 255);"> REPOSITION=20<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">IF LENGTH>95<br style="color: rgb(0, 0, 255);"> REPOSITION=10<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);"> REPOSITION=0<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);">ENDIF<br style="color: rgb(0, 0, 255);"><br style="color: rgb(0, 0, 255);">IF REPOSITION > 0<br style="color: rgb(0, 0, 255);">REMARKS2=ITOS(REPOSITION)+'" REPOSITION'<br style="color: rgb(0, 0, 255);">ELSE<br style="color: rgb(0, 0, 255);">REMARKS2=""<br style="color: rgb(0, 0, 255);">ENDIF
(note: The remarks2 parameter then gets added to a note that is displayed in the repeat region. If no value exists, the string is blank.)
Edited by: conrat