Hello everybody,
I couldn't decide why I would write about this topic. I made an Excel macro that I've been thinking about for a long time and wanted to share it here.
This macro places part profiles with cutting dimensions into one length profile with minimum wastage. The more parts that need to be cut, the more profiles create the cutting order.
I used an online site for its algorithm and modified it to meet my needs.
I hope it will be useful for someone.
#1d linear cut optimizer
PROFILE CUTTING OPTIMIZATION CALCULATION
- Ömür Tokman
- Posts: 361
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 995
- x 347
- Contact:
PROFILE CUTTING OPTIMIZATION CALCULATION
- Attachments
-
- PROFILE CUTTING OPTIMIZATION CALCULATION.xls
- (137 KiB) Downloaded 620 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Re: PROFILE CUTTING OPTIMIZATION CALCULATION
hi, I found this excel file and great job, it does what it needs to do. however, I would like to ask about the possibility of processing the "profile length" residues, length - number, and since it would also count the residues, use the residues first and then use the profile length, which is basic
- Ömür Tokman
- Posts: 361
- Joined: Sat Mar 13, 2021 3:49 am
- Location: İstanbul-Türkiye
- x 995
- x 347
- Contact:
Re: PROFILE CUTTING OPTIMIZATION CALCULATION
Hello Gentlemen,
An update.
This time I'm doing things with a tlb reference file in C#.
The first version was putting the cutting lengths in order and getting the result. I wanted to make a VBA that creates self-renewing combinations and actually I did it, but Excel was crashing when the combinations increased, unfortunately Excel does not work in multi-item lists. That's why I even handled the codes that create the combinations in C#.
I'm adding all my work, I think someone who understands software should develop it further.
current operation.
Cutting lengths in Excel are collected in a list.
C# creates self-renewing combinations from numbers whose sum reaches the stock size.
selects the largest one and prints it to Excel.
The numbers entered in Excel are deleted from the first list and the process is repeated for the remaining cutting dyes. until there are no more cutting sizes left in the list. The process repeats.
Remember, I am not a software developer, these issues need to be improved.
Result: It meets my needs.
Please test, we can do better together.
Important!
As for getting it to work on other machines, you'll need to register the TLB file with the system. Just setting the reference isn't enough.
regsvr32 C:\Your_Path_Here\CSharpLibrary.tlb
An update.
This time I'm doing things with a tlb reference file in C#.
The first version was putting the cutting lengths in order and getting the result. I wanted to make a VBA that creates self-renewing combinations and actually I did it, but Excel was crashing when the combinations increased, unfortunately Excel does not work in multi-item lists. That's why I even handled the codes that create the combinations in C#.
I'm adding all my work, I think someone who understands software should develop it further.
current operation.
Cutting lengths in Excel are collected in a list.
C# creates self-renewing combinations from numbers whose sum reaches the stock size.
selects the largest one and prints it to Excel.
The numbers entered in Excel are deleted from the first list and the process is repeated for the remaining cutting dyes. until there are no more cutting sizes left in the list. The process repeats.
Remember, I am not a software developer, these issues need to be improved.
Result: It meets my needs.
Please test, we can do better together.
Important!
As for getting it to work on other machines, you'll need to register the TLB file with the system. Just setting the reference isn't enough.
regsvr32 C:\Your_Path_Here\CSharpLibrary.tlb
- Attachments
-
- PROFILE CUT OPTIMIZATION CALCULATION-V2.zip
- (241.7 KiB) Downloaded 292 times
You ˹alone˺ we worship and You ˹alone˺ we ask for help.
Re: PROFILE CUTTING OPTIMIZATION CALCULATION
Thank you for sharing.
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger
Re: PROFILE CUTTING OPTIMIZATION CALCULATION
Hello, I am completely out of this. I can still edit something in Excel VBA in a "trial-and-error" way, but in this case I have to hope that someone will find your idea and I, as a layman, will use a working project. basically I have not yet managed to register the TLB into the system, which is essential for it to work.
Re: PROFILE CUTTING OPTIMIZATION CALCULATION
Dear Ömür Tokman,
Thank you so much for a wonderful attempt.
I've downloaded "PROFILE CUTTING OPTIMIZATION CALCULATION.xls" and it's working fine, however when I tried with larger cutting list it is kind of giving wrong combination for few of the bars. Kindly check the attachment.
I know you are working on it on your busy schedule, kindly try to rectify it in your free time.
I've failed to set up your second attempt, and I found the first one is much easier and helpful.
Thank you
Vinnoo
Thank you so much for a wonderful attempt.
I've downloaded "PROFILE CUTTING OPTIMIZATION CALCULATION.xls" and it's working fine, however when I tried with larger cutting list it is kind of giving wrong combination for few of the bars. Kindly check the attachment.
I know you are working on it on your busy schedule, kindly try to rectify it in your free time.
I've failed to set up your second attempt, and I found the first one is much easier and helpful.
Thank you
Vinnoo
- Attachments
-
- PROFILE CUTTING OPTIMIZATION CALCULATION_02.xls
- (109.5 KiB) Downloaded 138 times