Failure creating job using template [closed]

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
dubstar-04
Posts: 698
Joined: Mon Mar 04, 2013 8:41 pm
Location: Chester, UK
Contact:

Re: Failure creating job using template

Post by dubstar-04 »

falviani wrote: Wed Apr 15, 2020 2:09 pm The Windows 10 version is the lone straggler, not updated yet. I'll keep checking...
Hi Frank,

I just tested this on windows 10 and it seems to work fine:
TemplateTest.png
TemplateTest.png (14.93 KiB) Viewed 900 times
Thanks,

Dan

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20477 (Git)
Build type: Release
Branch: master
Hash: 7d8ab175a68e476427e6e337fe3099b52da49dc8
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Failure creating job using template

Post by falviani »

Hi,
My setup:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20477 (Git)
Build type: Release
Branch: master
Hash: 7d8ab175a68e476427e6e337fe3099b52da49dc8
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

Created a new project from scratch, from which to export the template. It's attached.
Creating a job in a new project using the exported template yields the "standard" traceback:
Running the Python command 'Path_Job' failed:
Traceback (most recent call last):
File "E:\Downloads\3D Printer software installers etc\FreeCAD\FreeCAD_0.19.20477_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.20477_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathJobCmd.py", line 71, in Activated
self.Execute(models, dialog.getTemplate())
File "E:\Downloads\3D Printer software installers etc\FreeCAD\FreeCAD_0.19.20477_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.20477_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathJobCmd.py", line 81, in Execute
FreeCADGui.doCommand('PathScripts.PathJobGui.Create(%s, %s)' % ([o.Name for o in base], template))

("(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \\UXXXXXXXX escape", ('<string>', 1, 40, None))

I have made a copy of the exported job and changed the extension to 'txt' so I can attach it. Looking at it in Notepad++, I was a little surprised to see that none of the stepover values I had entered for the various operations were shown; this leads me to suspect that the file is in fact incomplete.

Since Chrisb (a Mac OS user) was able to use the file, I'm stumped. I can only wait until the Windows version is updated to see if something changes. :(

Thanks for trying, anyway...
Attachments
job_50percentStepover.txt
(1.68 KiB) Downloaded 30 times
TemplateTest1.FCStd
(24.66 KiB) Downloaded 27 times
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Failure creating job using template

Post by chrisb »

dubstar-04 uses the same version as you on windows, so that should be close enough. I guess the problem's source comes from somewhere else. You can try to reset the configuration with the button in the preferences. Another possibility is to delete your config files or to move them in case you want to restore them. This often helps with issues occurring on only one single computer.

Concerning the data saved, the template does not go through the operations collecting values you have entered there, you have to change the values in the job's Setup (both tabs). Job's OpDefaults are not exported, that might be a good extension for the future.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Failure creating job using template

Post by falviani »

Pardon my ignorance, but you're using shorthand I'm not familiar with:
1) "You can try to reset the configuration with the button in the preferences." What button?
2) "you have to change the values in the job's Setup (both tabs)". I double clicked the the job icon to bring up the dialog containing a configuration grid for each operation, and changed the step over percentage in there. What other tab do you refer to?

If the op defaults - such as the step over percentage - aren't exported - what good is the job template? There are parameters in the preferences for grbl arguments already, for example. It was the step over percentage that I wanted to preset when starting a new job.

Thanks for your help. After using this for months, I still feel like I know about 1% of what I should know.
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Failure creating job using template

Post by chrisb »

falviani wrote: Wed Apr 15, 2020 5:30 pm 1) "You can try to reset the configuration with the button in the preferences." What button?
Open Preferences. At the bottom (at least on the Mac) are Buttons Help-Reset-Apply-Cancel-Ok. It's the Reset button
2) "you have to change the values in the job's Setup (both tabs)". I double clicked the the job icon to bring up the dialog containing a configuration grid for each operation, and changed the step over percentage in there. What other tab do you refer to?
After double clicking there is a tab "Setup". Click it. Inside are two vertical tabs "Layout" and "Default Values". Only these are saved in the template.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Failure creating job using template

Post by falviani »

OK. Found reset (in the left corner of the dialog.) Pressed it and wiped out my preferences, including all recent files :(

Found the 'defaults' tab in the job edit dialog (I don't think of them as tabs, I guess, since they visually don't resemble tabs at all on a Windows machine.) Since nothing I am interested in using to configure new jobs is actually saved, I think I won't bother using this feature.

I created a new project with a single rectangular object, then a new job. When I attempted to use a template to create a job, I got the "standard" failure. I give up.

Thanks anyway for your patience. I hope that operation defaults are someday exportable/importable. When that happens, I'll look at this again.

Frank
chrisb
Veteran
Posts: 53945
Joined: Tue Mar 17, 2015 9:14 am

Re: Failure creating job using template

Post by chrisb »

falviani wrote: Wed Apr 15, 2020 6:54 pm OK. Found reset (in the left corner of the dialog.) Pressed it and wiped out my preferences, including all recent files :(
It didn't wipe out the files, only the recent files list.
When that happens, I'll look at this again.
Sounds reasonable, as the values you need aren't saved anyway.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
stefan.maechler
Posts: 15
Joined: Wed Dec 16, 2020 7:41 am
Location: Zürich, Switzerland

Re: Failure creating job using template [closed]

Post by stefan.maechler »

Hi everybody,

I have the same problem on Windows 10, in my opinion, it has something to do with the default path of the templates. On Windows systems the templates are saved under:

C:\Users\Name\AppData\Roaming\FreeCAD\Macro

The '\U' part in the path causes the exception:

Code: Select all

("(unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \\UXXXXXXXX escape", ('<string>', 1, 41, None))
Cheers

-----
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23058 (Git)
Build type: Release
Branch: master
Hash: 6e60870ebcb2df018adb7a1281c00dde87750f11
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Failure creating job using template [closed]

Post by GeneFC »

I suspect the problem has nothing to do with the "U". Rather it is the "\" that is not escaped properly.

In my user.cfg the Macro folder is declared as:

<FCText Name="MacroPath">C:/Users/Gene/AppData/Roaming/FreeCAD/Macro</FCText>

All forward slashes. Never had any problems of the sort discussed here.

Gene
User avatar
stefan.maechler
Posts: 15
Joined: Wed Dec 16, 2020 7:41 am
Location: Zürich, Switzerland

Re: Failure creating job using template [closed]

Post by stefan.maechler »

Hi Gene,

well, I just had a look at the 'user.cfg' file. Basically, all paths except the 'MacroPath' use UNIX style paths with forward slashes. Thanks to the Python interpreter this works. However, I've never edited the 'user.cfg' file with a text editor. So, FreeCAD must have put the wrongly formatted path to this config file.

In my opinion, this should be considered a bug. FreeCAD users, who are not programmers, probably won't figure this out and give up.

Do you know how this path is generated? Could it be a remnant from a previous FreeCAD Version?

Thanks for your input. I didn't know about the 'user.cfg' file.

Stefan
Post Reply