Page 1 of 1

Can UCCNC trace a border around job?

PostPosted: Sun Jun 13, 2021 8:44 pm
by The-Meerkat
When I use Lightburn software on my laser, I can load a job and click on a button called “Frame”. The laser head will move without firing and simulate a tight rectangle around the job. This is a very useful visual check for lining up the material to be cut. I can click the button and move the material around repeatedly until I get it exactly where I want it before starting. Is there a function like this in UCCNC for plasma cutting? I’d sure like to know how to do it. I know I can set up in SheetCam to use a corner or center. However, being able to quickly trace an outline with the torch head really would really help when I’m trying to fit a cut job between other previous cuts to maximize usage of an expensive sheet of metal.

Re: Can UCCNC trace a border around job?

PostPosted: Sun Jun 13, 2021 9:17 pm
by Vmax549
Years back I did a macro that would travel the extents of the part in X/Y for a plasma cutter. It would always start at the minimum position of X/Y. I used it for exactly what you are needing. So it is possible.

(;-) TP

Re: Can UCCNC trace a border around job?

PostPosted: Mon Jun 14, 2021 1:43 am
by eabrust
Try this, it's likely one Terry started, and has been modified a few times over the years.

The last addition I made was to have it optionally go to 'center locations' along the sides instead of just the 4 corners, helpful such as if you have a round item. I haven't used it in a while.

You will want to check the FR for your feedrate, and the DT value for if you have UCCNC delay setup for mSec or Sec.

regards
Eric

Code: Select all

/*  M20002
   Part Extents Macro to test material fit

   ported from Mach3 to C# for uccnc, thanks to BR549/Vmax549/TP for the original macro
   25/06/2016 - robertspark
   3/19/17 - E Brust - Allow mid points for round items.


    NOTE: Set your feedrate and Dwell Time according to you machine parameters / units / requirements.
*/

double FR = 100; // sets Feedrate
double DT = 3000; // Sets Dwell Time (mSec, 3000 = 3 sec)



double XMax;
double XMin;
double YMax ;
double YMin ;
double numobjects;


numobjects=Convert.ToDouble(AS3.Getfield(894));


   if(numobjects==0)
   {         
   MessageBox.Show("Load a File And Restart");
   return;
   }


XMax = Convert.ToDouble(AS3.Getfield(888)); // 888  Diagnostics_maxX
XMin = Convert.ToDouble(AS3.Getfield(885)); // 885  Diagnostics_minX
YMax = Convert.ToDouble(AS3.Getfield(889)); // 889  Diagnostics_maxY
YMin = Convert.ToDouble(AS3.Getfield(886)); // 886  Diagnostics_minY

       DialogResult tst;
       tst = MessageBox.Show("Is your part round / want to hit midpoints?  Click YES for centers of sides/circle, NO for corners/square" , "mode", MessageBoxButtons.YesNo);      
      
      
      DialogResult result;
      result = MessageBox.Show("Is Your Z HEIGHT Safe To Travel?", "check!!!" , MessageBoxButtons.YesNo);
      
       if (result == System.Windows.Forms.DialogResult.Yes)
      {
      if (tst == System.Windows.Forms.DialogResult.Yes)
      {
/*          exec.Code("G92 X0 Y0 Z0"); // Zero the DRO's
         exec.Code("G01 X" + XMin + " Y" + YMin + " F" + FR); // Move to Minimum X & Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep(); */
   
         exec.Code("G04 P" + DT);
         exec.Code("G01 x" + XMin + " y" + (YMin+YMax)/2 + " F" + FR); // Move to Maximum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();

   
/*          exec.Code("G04 P" + DT);
         exec.Code("G01 Y" + YMax); // Move to Maximum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep(); */
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 X" + (XMin+XMax)/2 + "Y" + YMax); // Move to Maximum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
/*          exec.Code("G04 P" + DT);
         exec.Code("G01 X" + XMax); // Move to Maximum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep(); */
         

         exec.Code("G04 P" + DT);
         exec.Code("G01 x" + XMax + " Y" + (YMin+YMax)/2); // Move to Minimum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();      

         
/*          exec.Code("G04 P" + DT);
         exec.Code("G01 Y" + YMin); // Move to Minimum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep(); */

         exec.Code("G04 P" + DT);
         exec.Code("G01 X" + (XMin+XMax)/2 + " Y" + YMin); // Move to Minimum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
/*          exec.Code("G04 P" + DT);
         exec.Code("G01 X" + XMin); // Move to Minimum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep(); */
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 X0 Y0"); // Move to 0,0 X & Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         }
      
         
      
      
      if (tst == System.Windows.Forms.DialogResult.No)

         {
         exec.Code("G92 X0 Y0 Z0"); // Zero the DRO's
         exec.Code("G01 X" + XMin + " Y" + YMin + " F" + FR); // Move to Minimum X & Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 Y" + YMax); // Move to Maximum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 X" + XMax); // Move to Maximum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 Y" + YMin); // Move to Minimum Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 X" + XMin); // Move to Minimum X Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
         exec.Code("G04 P" + DT);
         exec.Code("G01 X0 Y0"); // Move to 0,0 X & Y Coordinates
         while(exec.IsMoving()){}
         exec.Wait(200);
         Console.Beep();
         
      }
      }
   
   
       if (result == System.Windows.Forms.DialogResult.No)
      {

         MessageBox.Show("Move Z To A Safe Position And Restart");

      }
   
      
      

Re: Can UCCNC trace a border around job?

PostPosted: Mon Jun 14, 2021 9:10 am
by Battwell
thats a handy one. will be adding it to my screen :-)

Re: Can UCCNC trace a border around job?

PostPosted: Mon Jun 14, 2021 3:28 pm
by The-Meerkat
Awesome. I’ll give it a try. Thanks Eric.

Re: Can UCCNC trace a border around job?

PostPosted: Tue Jun 15, 2021 1:20 am
by The-Meerkat
I created a button and added the macro to my run screen today. It works great. It’s exactly what I was looking for. Bada-Bing!