import gCode

Here's the place for discussion related to CAM/CNC and the development of the Path module.
lalberts
Posts: 76
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: import gCode

Postby lalberts » Sun Jun 28, 2020 3:46 pm

Hello,

how to import the external code?
if opening a *.gcode file, it asks for a pre-processor, but also opens a new *.fcstd file.

doing a copy paste in the custom insert of gcode , the pre-processor filter does not apply.
so that formats may not be compatible (see pycam.ngc testfile).

like
;PYCAM_TOOLPATH_SETTINGS: START
;[Bounds]
;maxz = 0.0
;maxx = 142.0
;maxy = 54.0
;minx = -12.0
;miny = -4.0
;minz = -10.0
;
;[Tool]
;torus_radius = 0.2
;speed = 1000.0
;shape = ToroidalCutter
;tool_radius = 1.0
;feedrate = 200.0
;
;[Process]
;generator = ContourFollow
;pocketing_type = none
;engrave_offset = 0.0
;milling_style = conventional
;path_direction = x
;step_down = 1.5
;postprocessor = SimpleCutter
;overlap_percent = 0
;material_allowance = 0.0
;
;PYCAM_TOOLPATH_SETTINGS: END

which I removed.

coming closer..

Lukas

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21769 (Git)
Build type: Release
Branch: master
Hash: 801bfe4ba5f0910e9b2885917c521ab7fd8e9020
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Attachments
test.FCStd
(685.2 KiB) Downloaded 9 times
pycamtest.ngc.txt
(652.12 KiB) Downloaded 9 times
User avatar
freman
Posts: 1526
Joined: Tue Nov 27, 2018 10:30 pm

Re: import gCode

Postby freman » Sun Feb 07, 2021 9:32 am

What is the state of play on this. I'm certain I imported a gcode file last year but now using either File|Open or File|Import and selecting gcode_pre, I get messy errors.

Is this a regression or am I not doing it correctly?

Code: Select all

09:26:52  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/~/freecad-build/Mod/Path/PathScripts/post/gcode_pre.py", line 114, in insert
    obj = PathCustom.Create("Custom")
  File "/~/freecad-build/Mod/Path/PathScripts/PathCustom.py", line 77, in Create
    proxy = ObjectCustom(obj, name)
  File "/~/freecad-build/Mod/Path/PathScripts/PathOp.py", line 193, in __init__
    job = self.setDefaultValues(obj)
  File "/~/freecad-build/Mod/Path/PathScripts/PathOp.py", line 325, in setDefaultValues
    if 1 < len(job.Operations.Group):
<class 'AttributeError'>: 'NoneType' object has no attribute 'Operations'
09:26:52  Traceback (most recent call last):
This leaves a new "Custom" object with a blue tick. When I hit recompute I get the following.

Code: Select all

  File "<string>", line 1, in <module>
<class 'RuntimeError'>: 'NoneType' object has no attribute 'Operations'
09:27:51  PathOp.ERROR: No parent job found for operation.

OS: Fedora 31 (Thirty One) (LXDE/LXDE)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23935 (Git)
Build type: Release
Branch: master
Hash: d5b68febbb4989b290b9af36bb2cb21d61a87a2e
Python version: 3.7.9
Qt version: 5.13.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)