How to add your own postprocessor?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 9
- Joined: Sat May 18, 2019 7:31 pm
How to add your own postprocessor?
Hello,
I tried to make a copy of the linuxcnc post processor to modify it.
I put the copy in my macro path.
linuxcnc2_post.py
But i cant select it in the list.
I also renamend linuxcnc to linuxcnc2 in the file.
OS: Ubuntu 18.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16146 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
I tried to make a copy of the linuxcnc post processor to modify it.
I put the copy in my macro path.
linuxcnc2_post.py
But i cant select it in the list.
I also renamend linuxcnc to linuxcnc2 in the file.
OS: Ubuntu 18.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16146 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Last edited by daniel_cnc on Sat Jan 25, 2020 9:11 am, edited 1 time in total.
Re: How to add your own postprocerssor?
Did you restart your FreeCAD?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
-
- Posts: 9
- Joined: Sat May 18, 2019 7:31 pm
Re: How to add your own postprocerssor?
Yes, I tried several times.
I use the app Image by the way.
The scripts are shown in the Macro->Macros dialog.
But still can't select then in the list.
I tried freecad-daily and there it is not working either.
I use the app Image by the way.
The scripts are shown in the Macro->Macros dialog.
But still can't select then in the list.
I tried freecad-daily and there it is not working either.
Re: How to add your own postprocerssor?
You don't use it in the Macro dialog, you use it in the output tab of the job. It should occur in the list of the available post processors.
Nevertheless, it should occur in the macro selection dialog. If not, you most probably stored in some other place or your macro path points to the wrong directory.
Nevertheless, it should occur in the macro selection dialog. If not, you most probably stored in some other place or your macro path points to the wrong directory.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: How to add your own postprocerssor?
Hi Chris,
Danial is using the AppImage, like me. I try to find where the postprozessor is stored at my system and find it at /tmp/.FreeCAD/Mod/Path/Pathscripts/post
Problem is, that the AppImage creates a new /tmp/.FreeCAD folder at each Start, so it`s hard to get somthing in there... We have had this a few weeks before, as i try'd to get Russels 3D OP running...
Danial is using the AppImage, like me. I try to find where the postprozessor is stored at my system and find it at /tmp/.FreeCAD/Mod/Path/Pathscripts/post
Problem is, that the AppImage creates a new /tmp/.FreeCAD folder at each Start, so it`s hard to get somthing in there... We have had this a few weeks before, as i try'd to get Russels 3D OP running...
Gruß Herbert
-
- Posts: 22
- Joined: Tue Jan 14, 2020 12:58 pm
- Location: Australia
Re: How to add your own postprocerssor?
One potential way forward is to extract the contents of the AppImage to a directory, so modifications can be performed.
You do this by running the AppImage from the command line, with an argument of "--appimage-extract":
This should create a new directory called "squashfs-root", with FreeCAD in it.
You can run FreeCAD from this directory ("./AppRun"), which will pick up any changes made inside the directory structure.
For the post files, they should be under "usr/Mod/Path/PathScripts/post":
I just tried the above, making a copy of the "linuxcnc_post.py" to "linuxcnc3_post.py", and it worked.
eg, was able to select linuxcnc3 in the Job dialog
Note that this requires running the application from the "squashfs-root" directory (eg "cd squashfs-root; ./AppRun"), rather than the original AppImage file, otherwise the changes won't be seen.
You do this by running the AppImage from the command line, with an argument of "--appimage-extract":
Code: Select all
$ ./FreeCAD_0.19-19285-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage --appimage-extract
Code: Select all
$ ls -la
total 416248
drwxr-xr-x 3 jc users 117 Jan 22 20:59 .
drwxr-xr-x 62 jc users 8192 Jan 20 11:45 ..
-rwxr-xr-x 1 jc users 426213416 Jan 18 00:38 FreeCAD_0.19-19285-Linux-Conda_Py3Qt5_glibc2.12-x86_64.AppImage
drwx------ 3 jc users 101 Jan 22 20:37 squashfs-root
$ cd squashfs-root
$ ls -la
total 12
drwx------ 3 jc users 101 Jan 22 20:37 .
drwxr-xr-x 3 jc users 188 Jan 22 20:37 ..
-rwxrwxr-x 1 jc users 658 Jan 22 20:37 AppRun
lrwxrwxrwx 1 jc users 17 Jan 22 20:37 .DirIcon -> freecad_conda.png
-rwxrwxr-x 1 jc users 250 Jan 22 20:37 freecad_conda.desktop
-rwxrwxr-x 1 jc users 3744 Jan 22 20:37 freecad_conda.png
drwx------ 23 jc users 313 Jan 22 20:37 usr
For the post files, they should be under "usr/Mod/Path/PathScripts/post":
Code: Select all
$ ls -la usr/Mod/Path/PathScripts/post
total 196
drwx------ 3 jc users 4096 Jan 22 20:43 .
drwx------ 4 jc users 4096 Jan 22 20:37 ..
-rw-rw-r-- 1 jc users 11608 Jan 22 20:37 centroid_post.py
-rw-rw-r-- 1 jc users 4277 Jan 22 20:37 comparams_post.py
-rw-rw-r-- 1 jc users 9714 Jan 22 20:37 dynapath_post.py
-rw-rw-r-- 1 jc users 4320 Jan 22 20:37 example_pre.py
-rw-rw-r-- 1 jc users 19889 Jan 22 20:37 grbl_post.py
-rw-rw-r-- 1 jc users 0 Jan 22 20:37 __init__.py
-rw-rw-r-- 1 jc users 12474 Jan 22 20:37 jtech_post.py
-rw-rw-r-- 1 jc users 14492 Jan 22 20:37 linuxcnc_post.py
-rw-rw-r-- 1 jc users 11338 Jan 22 20:37 opensbp_post.py
-rw-rw-r-- 1 jc users 8153 Jan 22 20:37 opensbp_pre.py
-rw-rw-r-- 1 jc users 24876 Jan 22 20:37 philips_post.py
drwxr-xr-x 2 jc users 38 Jan 22 20:43 __pycache__
-rw-rw-r-- 1 jc users 8134 Jan 22 20:37 rml_post.py
-rw-rw-r-- 1 jc users 3664 Jan 22 20:37 slic3r_pre.py
-rw-rw-r-- 1 jc users 14719 Jan 22 20:37 smoothie_post.py
eg, was able to select linuxcnc3 in the Job dialog
Note that this requires running the application from the "squashfs-root" directory (eg "cd squashfs-root; ./AppRun"), rather than the original AppImage file, otherwise the changes won't be seen.
-
- Posts: 9
- Joined: Sat May 18, 2019 7:31 pm
Re: How to add your own postprocerssor?
Thank you Justin,
I wanted to avoid that.
For me it would make much more sense if this was a userconfig and not a System config.
I wanted to avoid that.
For me it would make much more sense if this was a userconfig and not a System config.
-
- Posts: 22
- Joined: Tue Jan 14, 2020 12:58 pm
- Location: Australia
Re: How to add your own postprocerssor?
No worries.
Do you reckon your post processor would be useful for other people?
If so, then maybe the right approach is to contribute it to FreeCAD itself, so it's included for everyone?
Do you reckon your post processor would be useful for other people?
If so, then maybe the right approach is to contribute it to FreeCAD itself, so it's included for everyone?
-
- Posts: 9
- Joined: Sat May 18, 2019 7:31 pm
Re: How to add your own postprocerssor?
It just works if you create a new Job without a Template.
Or when I have a empty PostProcessor config in the Job Config and the list on export apears.
This also works from Macro Path.
But when I want to change It on an already created Job the list is not updated.
So I would need to recreate all Jobs.
Or when I have a empty PostProcessor config in the Job Config and the list on export apears.
This also works from Macro Path.
But when I want to change It on an already created Job the list is not updated.
So I would need to recreate all Jobs.
-
- Posts: 9
- Joined: Sat May 18, 2019 7:31 pm
Re: How to add your own postprocerssor?
No I just want to add G4 after M3 for my Spindle to spin up.JustinClift wrote: ↑Wed Jan 22, 2020 6:57 pm No worries.
Do you reckon your post processor would be useful for other people?
If so, then maybe the right approach is to contribute it to FreeCAD itself, so it's included for everyone?