Scripting Path workbench

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Post Reply
tcs_ulrich
Posts: 34
Joined: Mon Aug 28, 2017 10:11 am

Scripting Path workbench

Post by tcs_ulrich » Wed Jan 09, 2019 9:52 am

Hi,

I want to generate G-code from an in Script created Object (an Plate with Text as Pocket).
But i find no Documentation how to generate the "Path Operation" and the "Profile based on Faces"

best regards
Christian
tcs_ulrich
Posts: 34
Joined: Mon Aug 28, 2017 10:11 am

Re: Scripting Path workbench

Post by tcs_ulrich » Fri Mar 20, 2020 9:42 am

Hi, in meantime ive get an patially working Solution in this German Thread: https://forum.freecadweb.org/viewtopic. ... 45#p378645

But i have at time no working Solution to Create an Tool definition and Assign Tools to Path Operations, has anyone an clue how that can be done in an python script ?
etrombly
Posts: 31
Joined: Thu Dec 05, 2019 6:50 pm

Re: Scripting Path workbench

Post by etrombly » Fri Mar 20, 2020 4:13 pm

This is how I create a PathCustom and assign it to a job and toolcontroller. You should be able to modify it to do what you need.

Code: Select all

obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython", "Custom")
    PathScripts.PathCustom.ObjectCustom(obj)
    obj.ViewObject.Proxy = 0
    obj.Gcode = gcode
    PathScripts.PathUtils.addToJob(obj)
    obj.ToolController = PathScripts.PathUtils.findToolController(obj)
edit: This just assigns the first active tool. Not sure about creating a new one.
tcs_ulrich
Posts: 34
Joined: Mon Aug 28, 2017 10:11 am

Re: Scripting Path workbench

Post by tcs_ulrich » Fri Mar 27, 2020 10:17 am

Ive found an solution i can Create an TC with

Code: Select all

drill1mm = Path.Tool("1mm Endmill",tooltype="EndMill",diameter=1)
tc1mm = PathToolController.Create('drill1mm', tool=drill1mm)
And Assign with

Code: Select all

FontCut.ToolController = tc1mm
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest