Page 1 of 1

Any way to get gcode file path.

PostPosted: Fri Dec 29, 2017 4:39 am
by beefy
Do we have any function that returns the full file path of the currently loaded gcode file.

All I can find is this function:

Function: string Getgcodefilename( void )
Description: This function returns the current loaded g-code filename as a string.
Example: string val = exec.Getgcodefilename();

It doesn't mention returning the full file path so I'm assuming it only returns the bare gcode file name.

Re: Any way to get gcode file path.

PostPosted: Fri Dec 29, 2017 8:35 am
by dezsoe
You can use System.IO.Path.GetDirectoryName(exec.Getgcodefilename()) and System.IO.Path.GetFileName(exec.Getgcodefilename()) functions, but I can't see why do you need them. The exec.Getgcodefilename() returns the filename with the full path. (Did you try it? :))

Re: Any way to get gcode file path.

PostPosted: Fri Dec 29, 2017 2:23 pm
by beefy
Thanks Dezsoe.

We were having a family night and I was haunting some forums so didn't get a chance to try it, and thought I'd ask. I'm glad I didn't try it because if I did I wouldn't have learned those 2 tricks from you :D

I may not need those 2 tricks you've shown me, but I'm still happy to learn about them :)

Cheers,

Keith.