Hello
Guest
it is
November 29, 2023, 10:22:24 AM
Guest
Login
Register
Menu
Home
Help
Search
Calendar
Members
Members
View the memberlist
Search For Members
Login
Register
YouTube
Machsupport Forum
/
Mach Discussion
/
General Mach Discussion
/
Skip Tool-change if tool is loaded?
« previous
next »
Print
Pages:
1
Go Down
Author
Topic: Skip Tool-change if tool is loaded? (Read 2412 times)
0 Members and 1 Guest are viewing this topic.
Davek0974
2,606
Skip Tool-change if tool is loaded?
«
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??
Logged
Davek0974
2,606
Re: Skip Tool-change if tool is loaded?
«
Reply #1 on:
September 04, 2016, 03:40:30 AM »
Maybe add...
If GetSelectedTool() = GetCurrentTool() Then Exit Sub
As the first line in M6Start ??
Logged
stirling
2,188
UK
Re: Skip Tool-change if tool is loaded?
«
Reply #2 on:
September 04, 2016, 07:27:25 AM »
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.
Logged
Razordance Torch Height Control
Hood
25,835
Carnoustie, Scotland
Re: Skip Tool-change if tool is loaded?
«
Reply #3 on:
September 04, 2016, 08:04:17 AM »
If GetSelectedTool() = GetCurrentTool() Then
End
End If
That is what I have and it works 100%.
Hood
Logged
stirling
2,188
UK
Re: Skip Tool-change if tool is loaded?
«
Reply #4 on:
September 04, 2016, 09:45:03 AM »
Just trying to teach a man to fish etc.
Logged
Razordance Torch Height Control
Hood
25,835
Carnoustie, Scotland
Re: Skip Tool-change if tool is loaded?
«
Reply #5 on:
September 04, 2016, 09:47:22 AM »
Ian, my reply was actually meant for Daves initial post, sorry for the confusion, was not meaning to ignore what you were recommending.
Hood
Logged
stirling
2,188
UK
Re: Skip Tool-change if tool is loaded?
«
Reply #6 on:
September 04, 2016, 09:53:26 AM »
No worries
Logged
Razordance Torch Height Control
Davek0974
2,606
Re: Skip Tool-change if tool is loaded?
«
Reply #7 on:
September 04, 2016, 09:54:47 AM »
I have the fishing rod out now
I will test this out as soon as other issues have been ironed out
Logged
Print
Pages:
1
Go Up
« previous
next »