Page 3 of 6

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 11:32 am
by ger21
dezsoe wrote:Gerry,
Do you have UCCNC in C:\UCCNC? Then it works. I don't have a C:\UCCNC folder and this fact causes some problems. Any macro or plugin which stores something in the UCCNC directory has to use the Application.StartupPath to find the path where the UCCNC.exe was started from and calculate all paths relative to this.


It's in D:\UCCNC\

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 12:27 pm
by dezsoe
Then I don't know... My path is deeper: E:\UCCNCNF\2047. When I filled the Start in field, it could start, but had problems when tried to write the g-code file to C:\UCCNC\Wizard_Gcode.

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 3:56 pm
by dezsoe
Application.StartupPath gives the path to UCCNC.exe. Everything is relative to that, so there's no problem using it. I have a lot of macros and plugins with this technique and they all work fine. After more than 35 years of programming, I have to say that a program that runs only in a specified directory is a wrong program. UCCNC is not that type, it needs only the relative structure and you can run it anywhere! :)

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 5:45 pm
by Sword
Ok, it's not an issue of it being off screen. On both PC's in the shop, one a Win 7 and one a Win 10, I can get it to work with the default shortcut which has the 'start in' set to C:\UCCNC, but not with the My_Profile shortcut that is blank in the 'start in' field. If I change that one to C:\UCCNC, then it works.

The odd bit is that on the Win 7 PC at home, it works with the My_Profile shortcut start in field blank. It does however place the Wizard_Gcode folder on the desktop instead of the UCCNC folder.

Just a curious question, why is UCCNC (Mach3 was always this way too) installed to the root of the drive (C:\) instead of in either Program files(x86) or Program files like most programs are?

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 5:58 pm
by cncdrive
UCCNC installs to the folder you setup in the installer.
By default it is the C:\UCCNC, but you can change that to anything when installing.
The default is like that because it is a short path and easy and quick to access and easy to remember.
Since the UCCNC is kind of a special application, because it controls a machine and so mostly that is the main application used on the computer it is installed on, so it can be important to have it on a short and easily accessible path, but ofcourse if you want you can install it in the Programs folder, it is only on you what folder you installing it to.

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 6:07 pm
by dezsoe
Just a curious question, why is UCCNC (Mach3 was always this way too) installed to the root of the drive (C:\) instead of in either Program files(x86) or Program files like most programs are?

And also, UCCNC writes data to its own directory. If you install it to Program Files, then it cannot write until you change the permissions.

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 6:18 pm
by dezsoe
OK you know where UCCNC is how are you to know where anything after that is ??? I CAN tell you what profile you are using but that is about it . IF you do not use a defined structure then teh plugin is blind to what is after UCCNC.
...

You misunderstood me. I never change the UCCNC internal directory structure, just the root of the whole stuff. This way any plugin or macro can find the path to what it wants.

Code: Select all
string where_to_save = Application.StartupPath+@"\Wizard_Macros"; // the folder where the generated files should be saved
string current_profile_data = Application.StartupPath+@"\Profiles\" + UC.Getprofilename + @".pro"; // current profile data
string current_macro_dir = Application.StartupPath+@"\Profiles\Macro_" + UC.Getprofilename; // current profile macros folder

And so on. It works fine, I use these formulas in more macros and plugins.

Re: Wizard Plugin

PostPosted: Wed Jan 24, 2018 11:31 pm
by Dan911
dezsoe wrote:Dan, Yes, I had. Last night (UTC+1 :)) I replied your e-mail with details. Did you receive it?


Hi Dezsoe I just read it. Big project at work beyond my son's experience and been taking me from my playpen (desk) and bringing me to field :x .

My method below is obviously causing problems and will switch to "Application.StartupPath". Your input/help is much appreciated.

string Wizard = "Wizard_Gcode";
Directory.CreateDirectory(Wizard);

Path = Directory.GetCurrentDirectory();

Re: Wizard Plugin

PostPosted: Thu Jan 25, 2018 2:00 am
by Dan911
Dan911 wrote:
dezsoe wrote:Dan, Yes, I had. Last night (UTC+1 :)) I replied your e-mail with details. Did you receive it?


Hi Dezsoe I just read it. Big project at work beyond my son's experience and been taking me from my playpen (desk) and bringing me to field :x .

My method below is obviously causing problems and will switch to "Application.StartupPath". Your input/help is much appreciated.

string Wizard = "Wizard_Gcode";
Directory.CreateDirectory(Wizard);

Path = Directory.GetCurrentDirectory();

Hi Dezsoe,

I'm in the process of changing code but I hate implementing anything without fully understanding what's happening, after reviewing I am baffled with your window. Are you sure this is from V1 Wizard? I did generate a string path similar to exemption window in my first test cut a circle example upload.

No where in V1 code do I have C:\UCCNC, this path is generated with Path = Directory.GetCurrentDirectory() and also in a catch when called. :?

Thanks for all your help,
Dan



Dezsoe.JPG

Re: Wizard Plugin

PostPosted: Thu Jan 25, 2018 8:11 am
by dezsoe
Hi Dan,

A made a video to show everything. First, I show drive C:, there is no UCCNC directory. Next on drive E: you can see the E:\UCCNCNF\2047 directory with the created Wizard_Gcodes and the default structure. I show you the shortcut properties, then the wizard. (Sorry, my screen recorder makes some garbage...)

Edit: youtube killed my video... you can download here.