Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: Davek0974 on September 04, 2016, 03:12:35 AM
-
I have some code from fusion 360 for a little part i make batches of. It starts with a tool-change of course and i need the tool height offset so don't want to remove the TC.
Is it possible to alter the M6start / end macros to skip a change and do nothing if the tool selected is the same as the current tool??
-
Maybe add...
If GetSelectedTool() = GetCurrentTool() Then Exit Sub
As the first line in M6Start ??
-
maybe - but why use guesswork?
Make a copy of your existing M6Start macro and create a new one consisting solely of your proposed addition (with msgbox output to give you some debug feedback) and you test it.
e.g. you might do something like this:
If GetSelectedTool() = GetCurrentTool() then
msgbox "tools are the same"
else
msgbox "tools are different"
end if
If you're happy it does what you want you mod your existing one. But you KEEP the copy until you're 100% sure you're good. Then you can easily start from a known point if you need to.
-
If GetSelectedTool() = GetCurrentTool() Then
End
End If
That is what I have and it works 100%.
Hood
-
Just trying to teach a man to fish etc.
-
Ian, my reply was actually meant for Daves initial post, sorry for the confusion, was not meaning to ignore what you were recommending.
Hood
-
No worries ;)
-
I have the fishing rod out now ;)
I will test this out as soon as other issues have been ironed out :)