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 2017 Screenset - http://www.thecncwoodworker.com/2017.html
ger21
 
Posts: 1111
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: 513
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard Plugin

Postby Vmax549 » Wed Jan 24, 2018 3:24 pm

IF you are going to use odd pathing schemes then Plugins and Macros will have a very hard time reading the crystal ball. IF I remember correctly any attempt to read teh Directory structure will only give you teh path to the FUnction that calls it. If it is a plugin you get teh plugin path. With a macro you get the macro path.

Long ago if you remember I preached about using a defined directory structure so that any function would know where things were located. There was a very good reason for that preaching.

Putting it on different drives is not a problem as long as teh directory structure remains the same.

I would be nice at this time IF UCCNC were to define a directory structure and add in a few more folder names (;-). It would certainly help OEMs that have to deal with it.

Just a thought, (;-)TP
Vmax549
 
Posts: 1184
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

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

Re: Wizard Plugin

Postby Vmax549 » Wed Jan 24, 2018 4:30 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.

Sure YOU know what is what and you can program for that but IF you are programing for teh General USERS you have no idea where anything they created is stored.

Now on commercial machines about teh only thing that is a variable is where Gcodes are stored because of networking considerations. IF you want to use new macros or SUBs then YOU Have to load teh Program from your network TO teh machine storage folders. Because ALL calls for a function is called from teh KNOWN folder on teh machine. You do NOT have any options there. But even that can be set in stone to prevent operators from roaming teh network and misplacing Gcode files. OR hunting for things they should not have access to (;-).

Now in UCCNC if there were defined directory structures then ANYONE can program a macro or plugin and know EXACTLY where everything is. For example Q:\UCCNC\Gcodes is where you send Gcode programs. Q:\UCCNC\Points is where you send probed points files. Q:\UCCNC\Subprograms is where you save SUBs etc etc. THEN if you want to store then somewhere else YOU can copy then to where ever you please.

OR you can do as Les over at sheetcam does . Sheetcam allows you to define WHERE you want diffent folders. OR NOT (;-) IF not then you are on your own as far as plugins because teh folders can be anywhere.

Gcode = C:\UCCNC\Gcodes
Workfile = D:\Sheetcam\Workfiles
Drawings = D:\Sheetcam\Drawings
etc etc

Then you can simply query Sheetcam settings to find out WHERE to send things from a plugin.

Just a thought, (;-)TP
Vmax549
 
Posts: 1184
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

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

Re: Wizard Plugin

Postby Vmax549 » Wed Jan 24, 2018 6:25 pm

That was pretty much Art's ( Master5 - Mach3) take on the matter as well.
(;-) TP
Vmax549
 
Posts: 1184
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

PreviousNext

Return to Conversational Wizards

Who is online

Users browsing this forum: No registered users and 1 guest