I've been looking for a way to get a list of all the tools in each NC program and put it in project summary setup sheet. I'm using powermill 2015 by the way.
I came across this thread but it's not exactly what I need. Using this code I get fairly darn close to what I want, but not quite:
<table> <thead> <tr> <td colspan="7" class="title">Project Tool List</td> </tr> <tr> <th>Number</th> <th>Name</th> <th>Diameter</th> <th>Type</th> <th>Tip Radius</th> <th>Overhang</th> <th>Holder Type</th> </tr> </thead> <tbody> <toolrow> <tr> <td>{tool.number}</td> <td>{tool.name}</td> <td>{tool.diameter}</td> <td>{tool.type}</td> <td>{tool.tipradius}</td> <td>{tool.overhang}</td> <td>{tool.holder_name}</td> </tr> </toolrow> </tbody> </table>
This works perfectly fine for one NC program at a time, but if used for the whole project summary i'll get duplicate tools. It makes sense, as multiple programs use the same tools, but it clogs up the list too much for my liking.
So, I'd like to know if there is a way to remove these duplicate tools from the list. I'm not extremely familiar with html/scripts so I'm a bit lost here. I know the macro language fairly well, so if there's a way to implement this into macro that may work better for me, but that sounds overly complicated.
Any ideas are welcome and thanks for your time.
Solved! Go to Solution.
Solved by Sean570. Go to Solution.
Hi
I think you need to use...
<Toolrow>
</Toolrow>
...but it does look like you have used that.
This article suggests it's correct.
I have attached a stripped out setup sheet for an NC Program tool list that uses Toolrow (no duplicate numbers).
Hope this helps.
Kind Regards
Thanks for the response. You are right that toolrow solves this issue for the tool list for a single NC program. I was looking to create a tool list for the entire project, which has multiple NC programs with different tools for each. I set up a project template and used Toolrow, but if I have two different programs using the same tool, it will show the tool twice on the sheet.
We often have parts with 3-5 setups and I'd rather have one complete list of tools for all setups, rather than 3-5 tool lists, one for each program.
Ah sorry, misunderstood.
Easiest thing to do in that case is create a dummy NC program and add all toolpaths, purely for the setup sheet/tool list output...?
Kind Regards
Thanks for this one...
I have added to my suite of html set up sheets, and now can dispense with the xls tooling sheet.
(Just needed a few tweeks to mimic the old xls layout.. all done)
Stu
While making a dummy NC program is an option, I didn't like it so much.
I found a script on the forum awhile back, but it was in Portuguese and so I never bothered to figure out what it actually did, until recently. I don't have the link for the original post, but I did translate it to English and changed it to suit my needs.
Adding this script in your project template will allow you to get all the tools from each NC program without any duplicates:
<table> <script type="text/javascript"> var tool_list = new Array(); </script> <thead> <tr> <th class="center">T#</th> <th class="center">Tool Name</th> <th class="center">Dia</th> <th class="center">Flutes</th> <th class="center">Tip Rad</th> <th class="center">Type</th> <th class="center">Overhang</th> <th class="center">Holder</th> </tr> </thead> <summaryrow> <script type="text/javascript"> var tool = new String("{tool.identifier}").valueOf(); if ( tool_list.lastIndexOf(tool) < 0 ){ tool_list.push(tool); document.write('<tr>'); document.write('<td>{tool.number}</td>'); document.write('<td>{tool.name}</td>'); document.write('<td>{tool.diameter}</td>'); document.write('<td>{tool.NumberOfFlutes}</td>'); document.write('<td>{tool.tipradius}</td>'); var txt = new String("{tool.type}"); var n = txt.indexOf("#"); document.write('<td>' + txt.substring(n+1) + '</td>'); document.write('<td><b>{tool.overhang}</b></td>'); document.write('<td>{tool.HolderName}</td>'); document.write('</tr>'); } </script> </summaryrow> </table>
Keep in mind I am using out dated setupsheet parameters from powermill 2015, so changing those should make newer versions work as well.
Can't find what you're looking for? Ask the community or share your knowledge.