cannot export with post_processor

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
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

export with post processor

Post by giedrius9999 »

I cannot export with linuxcnc_post, neither with others posts

import linuxcnc_post
linuxcnc_post.export (myObjectName,"/path/to/outputFile.ncc", " ")

like explained in: https://www.freecadweb.org/wiki/Path_scripting

What I'm doing wrong?
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

cannot export with post_processor

Post by giedrius9999 »

I cannot export with linuxcnc_post, neither with others posts

import linuxcnc_post
linuxcnc_post.export (myObjectName,"/path/to/outputFile.ncc", " ")

like explained in: https://www.freecadweb.org/wiki/Path_scripting

What I'm doing wrong?
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot export with post_processor

Post by chrisb »

Which FreeCAD version do you use? Please post your FreeCAD info. Have you checked the wiki for Path Workbench?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot export with post_processor

Post by chrisb »

Please don't crosspost all over the forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

Re: cannot export with post_processor

Post by giedrius9999 »

chrisb wrote: Tue Apr 17, 2018 9:47 pm Which FreeCAD version do you use? Please post your FreeCAD info. Have you checked the wiki for Path Workbench?
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13509 (Git)
Build type: Release
Branch: releases/FreeCAD-0-17
Hash: 0258808ccb6ba3bd5ea9312f79cd023f1a8671b7
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedKingdom (en_GB)

Before the posting here I forgot to mention that with the GUI everything works perfectly. The reason of running the post export through the script is to build post processor (or to change one from existing) for 3D abrasive waterjet milling what practically could be done by two ways, activating/deactivating the abrasive mass flow or controlling the feed rate instead of controlling the Z axis position (when the jet moves slower, it erodes deeper). The F4 microwaterjet machine runs with flexium or beckhoff controllers. So I tried:

>>> import FreeCAD
>>> FreeCAD.open(u"C:/Users/ga/Desktop/test_fc.FCStd")
>>> App.setActiveDocument("test_fc")
>>> App.ActiveDocument=App.getDocument("test_fc")
>>> Gui.ActiveDocument=Gui.getDocument("test_fc")
>>> Gui.activateWorkbench("PathWorkbench")
>>> my_path = Path.Path("G0 X2 Y2 G1 X0 Y2")
>>> myPath = App.ActiveDocument.addObject("Path::Feature","myPathName")
>>> myPath.Path = my_path
>>> myPath
<Path::Feature object>
>>> my_path
Path [ size:2 length:4.8284 ]
>>> linuxcnc_post.export(myPath,"C:\Users\ga\Desktop\G_Code_Exp_2.ncc", "")
Show editor = 1

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\FreeCAD 0.17\Mod\Path\PathScripts\post\linuxcnc_post.py", line 158, in export
for obj in objectslist:
TypeError: 'App.DocumentObject' object is not iterable

OR
>>> linuxcnc_post.export(my_path,"C:\Users\ga\Desktop\G_Code_Exp_2.ncc", "")
Show editor = 1

Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\FreeCAD 0.17\Mod\Path\PathScripts\post\linuxcnc_post.py", line 158, in export
for obj in objectslist:
TypeError: 'Path.Toolpath' object is not iterable

ps: pre-processing works well
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot export with post_processor

Post by chrisb »

giedrius9999 wrote: Wed Apr 18, 2018 6:31 am Before the posting here I forgot to mention that with the GUI everything works perfectly.
Thanks for giving the details. The quoted statement means that others have to take over.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
giedrius9999
Posts: 24
Joined: Tue Apr 17, 2018 12:57 pm

Re: cannot export with post_processor

Post by giedrius9999 »

I didn't mean that others have to take over...Sorry for do not follow the rules!!! I'll look into the rules more detail
Last edited by giedrius9999 on Wed Apr 18, 2018 12:16 pm, edited 1 time in total.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: cannot export with post_processor

Post by chrisb »

giedrius9999 wrote: Wed Apr 18, 2018 11:07 am I didn't mean take over...Sorry for do not follow the rules!!! I'll look into more detail
I might have been not clear: I cannot contribute further if the post processors work from the GUI.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply