Automating QCAD/CAM 3 functions using scripts

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Post Reply
ash120
Junior Member
Posts: 11
Joined: Tue Apr 17, 2012 7:50 am
Location: Australia

Automating QCAD/CAM 3 functions using scripts

Post by ash120 » Wed Jun 07, 2017 4:15 pm

Hi

I'm looking to automate Qcad / cam by writing a script to batch process dxf files so they will be automatically toolpathed by layer, and then Gcode automatically saved for each file.

I have read your article on setting a Gcode configuration, but I wanted to see what CAM functions are available to scripts.

From the GCodeBase configuration I can see its derived from CamExporterV2 script So i 'm assuming that is where i have to look, but i cant find documentation on the functions in CamExporterV2 script.

Thanks for your help!

User avatar
andrew
Site Admin
Posts: 5554
Joined: Fri Mar 30, 2007 6:07 am

Re: Automating QCAD/CAM 3 functions using scripts

Post by andrew » Fri Jun 09, 2017 2:56 pm

All functions in CamExporterV2 are listed at:
https://www.qcad.org/doc/qcad/latest/de ... er_v2.html

CamExporterV2 exports all toolpaths in a drawing to the configured output format. It is the base class for all postprocessors.

You could create toolpaths automatically through other means than using the CAM > Add Profile Toolpath tool. Essentially, your script would have to create a block for each tool to be used and a block for each toolpath.

Blocks for tools and toolpaths must follow a naming convention and must have certain custom properties attached.

Tool blocks are tagged with custom properties defining the:
- tool diameter
- default spindle speed
- default feedrate
- etc.

Toolpath blocks are also tagged with various custom properties:
- a copy of the properties from the tool used for the toolpath
- properties for lead in/out
- direction and side for tool radius compensation
- Z levels
- etc.

You can inspect these properties as follows:
- Enable Edit > Application Preferences > Property Editor > Display properties of current block and current layer
- Double click a tool or toolpath block in the block list
- In the property editor, choose the Selection "Block"

The entities inside toolpath blocks are also tagged with various custom properties to define custom properties that might vary for every entity:
- definitive feedrate
- CamNotOffset for entities that are part of a contour that is not offset (these coordinates are exported if the postprocessor uses G41/G42 for tool radius compensation)
- CamOffset for entities that are part of a calculated offset contour (these coordinates are used for simulation as well as when the postprocessor does not use G41/G42 for tool radius compensation)
- etc.

Once these blocks have been created, QCAD/CAM will automatically recognize them as tools or toolpaths. These toolpath blocks can then be exported using any available postprocessor.

ash120
Junior Member
Posts: 11
Joined: Tue Apr 17, 2012 7:50 am
Location: Australia

Re: Automating QCAD/CAM 3 functions using scripts

Post by ash120 » Sun Jun 11, 2017 2:05 pm

Hi Andrew,

Thanks for your reply and help with explaining the toolpath blocks, I 'll give it a go.. :D

Post Reply

Return to “QCAD/CAM”