Wizard Plugin

Discuss the creation and usage of Wizards

Re: Wizard Plugin

Postby ger21 » Wed Jan 24, 2018 11:32 am

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\
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Wizard Plugin

Postby dezsoe » Wed Jan 24, 2018 12:27 pm

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.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard Plugin

Postby dezsoe » Wed Jan 24, 2018 3:56 pm

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! :)
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard Plugin

Postby Sword » Wed Jan 24, 2018 5:45 pm

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?
Sword
 
Posts: 16
Joined: Fri Dec 08, 2017 10:45 pm

Re: Wizard Plugin

Postby cncdrive » Wed Jan 24, 2018 5:58 pm

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.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Wizard Plugin

Postby dezsoe » Wed Jan 24, 2018 6:07 pm

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.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard Plugin

Postby dezsoe » Wed Jan 24, 2018 6:18 pm

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.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard Plugin

Postby Dan911 » Wed Jan 24, 2018 11:31 pm

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();
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Wizard Plugin

Postby Dan911 » Thu Jan 25, 2018 2:00 am

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
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Wizard Plugin

Postby dezsoe » Thu Jan 25, 2018 8:11 am

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.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

PreviousNext

Return to Conversational Wizards

Who is online

Users browsing this forum: No registered users and 2 guests