[SOLVED] No GCode except for pre- and postamble after postprocessing

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!
Post Reply
Samu
Posts: 51
Joined: Fri Jan 29, 2021 2:16 pm

[SOLVED] No GCode except for pre- and postamble after postprocessing

Post by Samu »

Code: Select all

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: d492ac30838e4fb07b1ce4b378730f2fb38b9ba3
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods: 
  * Render 2022.1.0
  * A2plus
  * CurvedShapes
  * FeedsAndSpeeds 0.4.0
When I create the operations in the attached file with the attached Macro only the pre- and postamble are showing up in my .ngc file.

The macro creates paths to machine fillets with the edge of an endmill on 'inside' holes where you can not used a toolbit designed for processing fillets.
It is applied by selecting the fillet face you want to machine and run the Macro.

The approach in the Macro is mostly an adapted copy of this video series by sliptonic https://www.youtube.com/watch?v=Ic9Kip5ufDE and it used to work until a couple of updates ago and still works in e.g. the FC version below:

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git) AppImage
Build type: Release
Branch: master
Hash: 9c6e9184930a52b165a0b7274e3a45d1006bfe67
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)

The described behaviour is independent of the postprocessor used (tried linuxcnc, haidenhein, fanuc and a couple of my own postprocessors)
Does anyone have an idea why it's not working anymore?

PS:
The Macro is used to 'emulate' a 4/5 axis mill on chamfers parallel to the y-axis by cutting only with the cutter edge of an endmill. It's very useful if you do not have 4 or 5 axis or if they can not be used due to collision between spindle and part.

It could easily be modified to chamfers not parallel to any axis if someone would need it.

Additionally I have a version for fillets as well.
Attachments
Ramps_paths.FCMacro
(2.15 KiB) Downloaded 18 times
Fis_Double_Bottom_Ramps_Passstifte.FCStd
(120.08 KiB) Downloaded 16 times
Last edited by Samu on Fri Jun 10, 2022 6:16 am, edited 1 time in total.
Samu
Posts: 51
Joined: Fri Jan 29, 2021 2:16 pm

Re: No GCode except for pre- and postamble after postprocessing

Post by Samu »

Update:
if I use

Code: Select all

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git) AppImage
Build type: Release
Branch: master
Hash: 9c6e9184930a52b165a0b7274e3a45d1006bfe67
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
I get the following error thrown at me after postprocessing:

Code: Select all

14:10:00  Traceback (most recent call last):
  File "/tmp/.mount_FreeCABbMY3l/usr/Mod/Path/PathScripts/PathJob.py", line 400, in execute
    obj.Path = obj.Operations.Path
<class 'AttributeError'>: 'App.DocumentObjectGroup' object has no attribute 'Path'
However, the gcode is still postprocessed correctly and I clearly add a 'Path' to the job in the Macro as well.

In the 'PathJob.py' in version:

Code: Select all

OS: Ubuntu 20.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: d492ac30838e4fb07b1ce4b378730f2fb38b9ba3
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, OCC 7.5.2
Locale: English/United States (en_US)
Installed mods: 
  * Render 2022.1.0
  * A2plus
  * CurvedShapes
  * FeedsAndSpeeds 0.4.0
the line 672 which throws the error:

Code: Select all

...
670    def execute(self, obj):
671        if getattr(obj, "Operations", None):
672            # obj.Path = obj.Operations.Path
673            self.getCycleTime()
...
is commented out. That keeps me wondering if something has changed in the way paths/operations are added to a job so that my approach in the Macro does not work anymore?
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: No GCode except for pre- and postamble after postprocessing

Post by sliptonic »

Several things have changed in that might affect your macro.
This PR was the biggest change.
https://github.com/FreeCAD/FreeCAD/pull/4911
Samu
Posts: 51
Joined: Fri Jan 29, 2021 2:16 pm

Re: No GCode except for pre- and postamble after postprocessing

Post by Samu »

sliptonic wrote: Tue May 31, 2022 2:06 pm Several things have changed in that might affect your macro.
This PR was the biggest change.
https://github.com/FreeCAD/FreeCAD/pull/4911
Thank you for your reply.

The solution was found in PathPost.py:

Code: Select all

...
357                if not PathUtil.opProperty(obj, "Active"):
358                    continue
...
I was simply missing:

Code: Select all

...
o.addProperty('App::PropertyBool', 'Active', 'Path')
o.Active = True
...
The Macro is now working perfectly again
Attachments
Ramps_paths.FCMacro
(2.38 KiB) Downloaded 16 times
Post Reply