Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export tools to Fusion 360

29 REPLIES 29
Reply
Message 1 of 30
michael.grenier4GVTU
5106 Views, 29 Replies

Export tools to Fusion 360

Hi Everyone,

 

I thought I would share something I've worked on earlier this year.  With Fusion being available through PowerMill since few years already, the request from users to be able to transfer data to Fusion has become more and more common.  In an attempt to ease the use of both, I've written a plugin that allows a PowerMill user to export the tools loaded within the current project to Fusion.  This will transfer the cutting geometry, the shank and Holder of each tool and match them with their corresponding type within Fusion.  Cutting parameters from the General preset will also be transferred over if that interest anyone.

 

FYI, this is a plugin, so simply close PowerMill, run the installer and once you reopen the software you should get a message saying a new plugin was discovered.  From there, within the vertical plugin window you should have access to this new tool.

 

Hope you find it useful!

 

Michael



Michael Grenier
Senior Solution Engineer
29 REPLIES 29
Message 2 of 30

thanks @michael.grenier4GVTU ! does this work with older versions of powermill as well? Do you have the project on github or no?

 

--------------------------------------
the numbers never lie
Message 3 of 30

It should support older version of PowerMill to some extent.  I don't recall using new parameters or function when I wrote it so it would be a matter of testing it.  I wrote this a couple years ago so it should at least work since 2019.  That being said, it would simply need to be tested to see.  As far as the source code goes, I can't share it right now but that doesn't mean it will never be available.



Michael Grenier
Senior Solution Engineer
Message 4 of 30

Sounds good, thank you! I have some coworkers on 2016 who also use fusion, so hopefully it works for them. thanks again!

--------------------------------------
the numbers never lie
Message 5 of 30

Sure, let me know if you run into trouble and I'll see what I can do.



Michael Grenier
Senior Solution Engineer
Message 6 of 30

Hello,

 

Thank you very much for your plugin! This is very useful.

 

However, I would like to point out that there seems to be a bug when exporting tools from a PowerMILL project set to metric system. Parameters like feeds and speeds are exported to Fusion 360 incorrectly. I think you are applying the inch to foot conversion no matter if the units are mm or inches. It would be great if this could be corrected.

 

Kind regards,

Vitor

Message 7 of 30

It's more than possible something has to be fixed but the plugin has code to account for units and conversion.  I just tried it quick on my end and I seem to get proper result as you can see on the screenshot.  Can you provide a project or a more specific description of the problem?

 



Michael Grenier
Senior Solution Engineer
Message 8 of 30

Thanks for your time to reply.

 

Strangely, on my side it does not work. Please look at the provided pictures. It is the feed and rotation that gets wrong.

 

i am exporting to a file which I then import in Fusion 360. I am not exporting directly to Fusion 360 (first option).

 

Kind regards,

Vitor

Message 9 of 30

I have a feeling this is caused by your PowerMill language.  Can you try to run it in English for the exportation?



Michael Grenier
Senior Solution Engineer
Message 10 of 30

Unfortunately, this did not fix the problem.

 

I changed PowerMILL to English and the results are the same.

 

Then I even tried to change the Windows Regional Settings to US, in order to exclude problems with decimal symbol, but again the problem persists.

 

Here is a log of what your plugin is doing:

Process Command : [DIALOGS MESSAGE OFF\n]
Process Command : [DIALOGS ERROR OFF\n]
Process Command : [GRAPHICS LOCK\n]
Process Command : [ACTIVATE TOOL 'D32R2'\n]
Process Command : [print $entity('tool';'').type\n]
tip_radiused
Process Command : [print $entity('tool';'').HolderSetValues[0].UpperDiameter\n]
75.0
Process Command : [print $entity('tool';'').ShankSetValues[0].UpperDiameter\n]
30.0
Process Command : [print $entity('tool';'').ShankSetValues[0].LowerDiameter\n]
30.0
Process Command : [print $entity('tool';'').ShankSetValues[0].Length\n]
100.0
Process Command : [print $entity('tool';'').ShankSetValues[1].UpperDiameter\n]
0.0
Process Command : [print $entity('tool';'').Number.Value\n]
1
Process Command : [print $entity('tool';'').HolderName\n]
1
Process Command : [print $entity('tool';'').coolant\n]
standard
Process Command : [print $entity('tool';'').coolant\n]
standard
Process Command : [print $entity('tool';'').coolant\n]
standard
Process Command : [print $entity('tool';'').diameter\n]
32.0
Process Command : [print $entity('tool';'').overhang\n]
80.0
Process Command : [print $entity('tool';'').length\n]
4.0
Process Command : [print $entity('tool';'').pitch\n]
0.0
Process Command : [print $entity('tool';'').NumberOfFlutes\n]
1
Process Command : [print $entity('tool';'').TipRadius\n]
2.0
Process Command : [print $Units\n]
metric
Process Command : [print par "to_xml(entity('tool', '').FeedPerTooth)"\n]
(STRING) <FeedPerTooth>
<finishing>
<profiling>0.0</profiling>
<plunge_milling>0.0</plunge_milling>
<slotting>0.0</slotting>
<face_milling>0.0</face_milling>
<drill>0.0</drill>
<copy_milling>0.0</copy_milling>
<general>0.01953125</general>
</finishing>
<roughing>
<profiling>0.0</profiling>
<plunge_milling>0.0</plunge_milling>
<slotting>0.0</slotting>
<face_milling>0.0</face_milling>
<drill>0.0</drill>
<copy_milling>0.0</copy_milling>
<general>0.0</general>
</roughing>
</FeedPerTooth>
Process Command : [print par "to_xml(entity('tool', '').CuttingSpeed)"\n]
(STRING) <CuttingSpeed>
<finishing>
<profiling>0.0</profiling>
<plunge_milling>0.0</plunge_milling>
<slotting>0.0</slotting>
<face_milling>0.0</face_milling>
<drill>0.0</drill>
<copy_milling>0.0</copy_milling>
<general>804.247719319</general>
</finishing>
<roughing>
<profiling>0.0</profiling>
<plunge_milling>0.0</plunge_milling>
<slotting>0.0</slotting>
<face_milling>0.0</face_milling>
<drill>0.0</drill>
<copy_milling>0.0</copy_milling>
<general>0.0</general>
</roughing>
</CuttingSpeed>
Process Command : [print $entity('tool';'D32R2').Overhang\n]
80.0
Process Command : [print $entity('tool';'D32R2').Length\n]
4.0
Process Command : [EXPORT TOOLHOLDER ; FILESAVE 'C:\Users\Public\Documents\profile.dgk'\n]
Process Command : [yes\n]
Process Command : [CREATE PATTERN ;\n]
Process Command : [EDIT PATTERN ; INSERT FILE FILEOPEN "C:\Users\Public\Documents\profile.dgk"\n]
Process Command : [\r]
Process Command : [EDIT PATTERN ; CURVEEDITOR START\n]
Process Command : [CURVEEDITOR MODE FIT_POLYGONISE\n]
Process Command : [CURVEEDITOR FIT POLYGONISE '0.002'\n]
Process Command : [CURVEEDITOR MODE DEFAULT\n]
Process Command : [CURVEEDITOR FINISH ACCEPT\n]
Process Command : [YES\n]
Process Command : [\n]
Process Command : [KEEP PATTERN ; FILESAVE "C:\Users\Public\Documents\profile.pic"\n]
Process Command : [yes\n]
Writing geometry to 'C:\Users\Public\Documents\profile.pic'
Process Command : [DELETE PATTERN ;\n]
Process Command : [\n]
Process Command : [print $entity('tool';'D32R2').Overhang\n]
80.0
Process Command : [print $entity('tool';'D32R2').Length\n]
4.0
Process Command : [EXPORT TOOLSHANK ; FILESAVE 'C:\Users\Public\Documents\profile.dgk'\n]
Process Command : [yes\n]
Process Command : [CREATE PATTERN ;\n]
Process Command : [EDIT PATTERN ; INSERT FILE FILEOPEN "C:\Users\Public\Documents\profile.dgk"\n]
Process Command : [\r]
Process Command : [EDIT PATTERN ; CURVEEDITOR START\n]
Process Command : [CURVEEDITOR MODE FIT_POLYGONISE\n]
Process Command : [CURVEEDITOR FIT POLYGONISE '0.002'\n]
Process Command : [CURVEEDITOR MODE DEFAULT\n]
Process Command : [CURVEEDITOR FINISH ACCEPT\n]
Process Command : [YES\n]
Process Command : [\n]
Process Command : [KEEP PATTERN ; FILESAVE "C:\Users\Public\Documents\profile.pic"\n]
Process Command : [yes\n]
Writing geometry to 'C:\Users\Public\Documents\profile.pic'
Process Command : [DELETE PATTERN ;\n]
Process Command : [\n]
Process Command : [DIALOGS MESSAGE ON\n]
Process Command : [DIALOGS ERROR ON\n]
Process Command : [GRAPHICS UNLOCK\n]

 

I find it strange that this output does not contain the Feed/Tooth or Spindle Speed and Cutting Feed rate information.

This means (if I am not missing anything), that your exported data is not able to calculate Spindle Speed and Cutting Feed Rate!

Also, this weird Spindle Speed of 96 rpm appears in Fusion 360. Can it be that you are using some constant for Feed/Tooth instead of the actual (missing) value?

 

Sorry to bug you with this, but your plugin is actually very valuable for many of our customers who want to start using Fusion 360, but have a huge tool database on PowerMILL.

 

Kind regards,

Vitor

 

 

Message 11 of 30

Attached is a ZIP file containing a PowerMILL Project Template.

Just drag the *.ptf file into the PowerMILL windows and one test tool is created.

Try to export it to Fusion 360 with your plugin and check if the Spindle Speed and Cutting Feed Rate is imported correctly (should be 8000 rpm and 5000 mm/min).

 

Thanks!

 

Regards,

Vitor

Message 12 of 30

This is getting more and more interesting!  Thanks for sharing the data as it makes it much easier to run some math and try to understand where those values are coming from.  Long story short, I don't have a 100% sure answer but from what I can see in the code, I run the following command:

print $Units

To get the current project unit system.  If that command returns "metric", then the file is considered metric and conversions will be based on this.  If anything else than metric is returned, then inches will be the file type used.  I still have a feeling this command does not return metric for your document.  Can you manually type it and see?  If that's the case, I can easily include it in the code and that should fix the problem.  Cause as you can see on the other screen shot, your tools seem to export just fine for me.

 

Michael



Michael Grenier
Senior Solution Engineer
Message 13 of 30

Michael,

 

If you look at the code I posted further up you can see at the beginning that the units command is processed correctly.

 

I wonder is the problem is due to me inserting the values in the Spindle and Feed fields instead of i.e. the feed per tooth field. These get updated automatically and I am not totally sure if they will then extract the correct values when queried.

 

Regards,

Vitor

Message 14 of 30

Hoo I didn't notice before, so that complicates things a little bit more.  I don't think it matters where you enter the values as I pull them correctly here.  Also, when I run the math from the plugin code using the values you posted earlier, it seems to give accurate result if it goes through the metric section.  Here is a snippet of that section of the plugin, you can try the math on your end to see.

if (FileUnits == "inches")
{
Lines.Add(" \"n\": " + Math.Round(((12 * Speed) / (3.1415927 * ToolDiameter)), 0) + ",");
}
else
{
Lines.Add(" \"n\": " + Math.Round(((1000 * Speed) / (3.1415927 * ToolDiameter)), 0) + ",");
}
if (FileUnits == "inches")
{
Lines.Add(" \"v_f\": " + Math.Round((FeedPerRev * ((12 * Speed) / (3.1415927 * ToolDiameter))), 2) + ",");
}
else
{
Lines.Add(" \"v_f\": " + Math.Round((FeedPerRev * ((1000 * Speed) / (3.1415927 * ToolDiameter))), 2) + ",");
}



Michael Grenier
Senior Solution Engineer
Message 15 of 30

Michael,

 

I just tested it again and now I think it is actually a PowerMILL bug!

 

When issuing the command:

print par "to_xml(entity('tool', '').FeedPerTooth)"

 

The resulting XML date should contain (with my "Test Tool") a Feed/Tooth value of 0.625mm.

 

Instead, PowerMILL outputs:

 

Process Command : [print par "to_xml(entity('tool', '').FeedPerTooth)"\r]

...
<general>0,01953125</general>

...

 

This is actually in TDU ("Tool Diameter Units") - even though I did not have this box checked!

 

So I *think* that the problem is that you get Feed/Tooth in TDU instead of mm, no matter what the user selected. 

 

Cheers,

Vitor

Message 16 of 30

You are right, this is TDU but the plugin is supposed to account for it.



Michael Grenier
Senior Solution Engineer
Message 17 of 30

Hello Michael,

 

Attached is an Excel sheet with my calculations. Everything adds up and of course your equiations are correct - plus you can confirm them here: https://knowledge.autodesk.com/support/powermill/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/PWR...

 

Sorry if I wrongly assumed that you were not aware that PowerMILL exports the tool data in TDU, even when the relevant checkbox is not ticked (which I consider to be a bug).

 

Anyway, I wonder where the "96" value comes from in the generated *.json file:

 

 

 "start-values": {
                "presets": [
                    {
                        "description": null,
                        "f_n": 0.019531,
                        "f_z": 0.019531,
                        "n": 96,
                        "n_ramp": 96,
                        "name": "Default Preset",
                        "tool-coolant": "Flood",
                        "use-stepdown": false,
                        "use-stepover": false,
                        "v_c": 804.2,
                        "v_f": 1.87,
                        "v_f_leadIn": 1.87,
                        "v_f_leadOut": 1.87,
                        "v_f_plunge": 1.87,
                        "v_f_ramp": 1.87,
                        "v_f_retract": 1.87
                    }
                ]
            },

 

 

The f_n and f_z both contain the Tooth/Feed value in TDU.

v_c has the Surface Speed value.

 

But what is n and v_f?

 

On a side note, I think the plugin crashes PowerMILL if you configure the decimal symbol to ",".

 

Kind regards,

Vitor

Message 18 of 30

Hi, no worries at all, when we write code, we know there will be some bugs so it could have easily been something I have overlooked but fortunately it was not in this case.  One thing I did overlook though is the decimal separator which I just fixed, thanks to you for reporting it.  Another question you had was about N(which is the simple speed) and V_F (which is the cutting feed rate).  Finally, the reason why you get 96 RPM is because the plugin enters in the inches if statement instead of the metric one.  So, instead of multiplying the surface speed by 1000, it multiplies it by 12 which gives you 96.  So, since we are running in circle, this "debug" version of the plugin will show you a message box with the value of my unit variable.  I would like you to install the plugin, run it and send me a screenshot of what you get on the file you sent me.

 

We'll get there!

 

Thanks

 

Michael



Michael Grenier
Senior Solution Engineer
Message 19 of 30

Hello Michael,

 

Success!

 

The plugin now exports the cutting data correctly. Thank you!

 

Not wanting to bug you too much, I wonder if I could suggest these two things:

1) Could you make PI one more decimal (will increase precision a tiny bit - I noticed when playing with the Excel sheet);

2) Could you round the feedrate to integer number? It looks weird to have two decimal places and due to calculations a 5000mm/min becomes 4999.94mm/min.

 

Also, I am happy to report that the plugin no longer crashes PowerMILL when using "." or "," as the decimal symbol.

 

Kind regards,

Vitor 

Message 20 of 30

Hey Vitor,

 

glad it works but I'm not sure why as I've not changed anything in the code apart from adding that message box to debug.  Let's not dive too deep if it works 😉  Maybe it was coming from the decimal symbol, who knows.  I've done the two modifications you suggested, but since I was already using quite a lot of decimals to the PI constant, (I'm not sure why I did this in the first instance) but I've changed it to use the real constant with all the numbers.  I wrote this as a PowerMill macro first so I might have just forgotten to replace it here.  Also, I've rounded the feeds to 0 decimals instead of 2 to make it look better for metric files.

 

Michael



Michael Grenier
Senior Solution Engineer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators