Hello Guest it is April 17, 2024, 08:05:41 PM

Author Topic: holes macro editing  (Read 1118 times)

0 Members and 1 Guest are viewing this topic.

holes macro editing
« on: November 24, 2022, 04:45:23 AM »
good morning
I found on the net, some time ago, this macro to make holes, to work well, I tried to modify it in the part where the parameters are inserted, these are inserted one at a time in the original macro, if possible I would like a table at the beginning where I insert all the parameters like:
(similar type)

   Begin Dialog TextBoxSample 100,50,380,220,"PROVA"

      OKButton 80,195,40,15
      GroupBox 5,5,220,180,"  IMPOSTAZIONI  ",.GroupBox1
            Text 60,22,150,8,"VELOCITA' TASTATURA SONDA"'Pspeed
      TextBox 11,20,40,12,.TextBox1
        Text 60,42,150,8,"LUNGHEZZA PEZZO DAL CENTRO DIVISO 2"'Rleg
      TextBox 11,40,40,12,.TextBox2
        Text 60,62,150,8,"ANGOLO SPOSTAMENTO SONDAGGIO"'Linc
      TextBox 11,60,40,12,.TextBox3
        Text 60,82,150,8,"SPOSTAMENTO ALTEZZA SICURO ASSE  Z"'SafZ
      TextBox 11,80,40,12,.TextBox4
        Text 60,102,150,8,"ALTEZZA DISCESA INGRESSO SONDA"'Phgt
      TextBox 11,100,40,12,.TextBox5
          Text 60,122,150,8,"INGRESSO SONDA   0 ASSE X A ORE 6"'Spnt
      TextBox 11,120,40,12,.TextBox6
        Text 60,142,150,8,"LUNGHEZZA TASTATURA IN GRADI"'Tdeg 
      TextBox 11,140,40,12,.TextBox7
        Text 25,160,170,8,"@@ ATTENZIONE @@ POSIZIONARSI AL CENTRO DEL PEZZO"
        Text 25,170,170,8,"----------------------------------------------------------------------------------"
  End Dialog
 
   Dim Dlg1 As TextBoxSample
   Dialog Dlg1
   Pspeed = CDbl(Dlg1.TextBox1)
   Rleg = CDbl(Dlg1.TextBox2)
   Linc = CDbl(Dlg1.TextBox3)
   SafZ = CDbl(Dlg1.TextBox4)
   Phgt = CDbl(Dlg1.TextBox5)
   Spnt = CDbl(Dlg1.TextBox6)
   Tdeg = CDbl(Dlg1.TextBox7)
ecc ecc

the macro / script in question is this:



Code: [Select]
Dim Xpos, YPos, SpindleSpeed, Feed, Depth As Double
Dim Clearance, Peck, Dwell As Double
Dim i, Holes As Integer
  OpenTeachFile "G83 Drill.tap" 'Aprire il file di apprendimento, nome G83 Drill.tap
  SpindleSpeed = InputBox("Inserisci la velocità del mandrino desiderata:") 'Chiedi all'utente di inserire la velocità del mandrino
 Feed = InputBox("Inserisci l'avanzamento desiderato:") 'Chiedi all'utente di inserire l'avanzamento
  Code "M3 S" & SpindleSpeed & " F" & Feed 'Scrivi il codice G su file.
 Holes = InputBox("Quanti fori praticare?")'Chiedi all'utente quanti fori eseguire
  If Holes > 0 Then
  Depth = InputBox("Quanto sono profondi?")
  Peck = InputBox("Quanto profondo per beccato?")
  Clearance = InputBox("Inserisci l'altezza di gioco dell'asse Z tra i fori")
  Dwell = InputBox("Inserisci il tempo di permanenza in secondi")
 Xpos = InputBox("X Coordinata X per il foro n. " & 1 & "?")
 Ypos = InputBox("Y Coordinata Y per il foro n. " & 1 & "?")
    Code "G83 X" & XPos & " Y" & YPos & " Z-" & Depth & " R" & Clearance & " P" & Dwell & " Q" & Peck
    For i = 2 To Holes
    Xpos = InputBox("X Coordinata X per nr. " & i)
    Ypos = InputBox("Y Coordinata Y per il foro n. " & i)
    Code "X" & Xpos & " Y" & YPos
 Next
    Code "G80"
  End If
  LoadTeachFile()
  CloseTeachFile()
  DoOEMButton (1)

I tried to modify it but I couldn't figure it out, it's not in my skills, (I'm almost at zero in programming) is there anyone who can help me?

Online Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: holes macro editing
« Reply #1 on: November 26, 2022, 08:08:39 PM »
Why not use the Mach3 built in wizards?
Without engineers the world stops
Re: holes macro editing
« Reply #2 on: November 27, 2022, 12:54:20 PM »
good morning
thanks graham waterworth for the reply, what would be the wizard?

Online Graham Waterworth

*
  • *
  •  2,672 2,672
  • Yorkshire Dales, England
    • View Profile
Re: holes macro editing
« Reply #3 on: November 29, 2022, 08:03:06 PM »
These under the 'Load Wizards' button.
« Last Edit: November 29, 2022, 08:08:25 PM by Graham Waterworth »
Without engineers the world stops