block a load g code for non compatable file.

Here is where you can request new features or special features.

block a load g code for non compatable file.

Postby Battwell » Sat Apr 20, 2024 2:08 pm

id like to be able to block load g code if for example customer loads a .crv file instead of g code.
.crv is a vectric project file that often gets saved in the same folder as g code with the same name.

load a .crv file and uccnc cannot open it.. so freezes.
have to totally restart which is a pain..

few of my customers have done this recently..
i have done it myself numerous times over the years too.

maybe have limitation to .txt .nc and few other common suffixes?
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: block a load g code for non compatable file.

Postby dezsoe » Sat Apr 20, 2024 3:15 pm

Redirect the Load button to the following macro:

Code: Select all
// ================================================================================================
// Open g-code file
// ================================================================================================

try
{
  OpenFileDialog ofd = new OpenFileDialog();
  ofd.RestoreDirectory = true;
  ofd.Filter = "G-code files|*.txt;*.nc;*.tap";   // List the allowed extensions here
  ofd.Title = "UCCNC - Open g-code file";
  if (ofd.ShowDialog(exec.mainform) == DialogResult.OK)
    exec.Loadfile(ofd.FileName);
}
catch (Exception ex)
{
}
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: block a load g code for non compatable file.

Postby Battwell » Sun Apr 21, 2024 4:08 pm

That works really well. thank you.
might be worth adding to the main installer.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 3 guests

cron