Custom Postprocessor Axis value without Axis name

Discussions around the CAM Add-On of QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Indicate the post processor used.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Lpkkk
Newbie Member
Posts: 4
Joined: Sun Mar 20, 2022 1:01 am

Custom Postprocessor Axis value without Axis name

Post by Lpkkk » Tue Aug 08, 2023 11:42 am

Hi
How can i get a value but without Axis name in front of it? eg. [ZD] will return Z-4 i need just the value so -4.
Greatful for any help

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Custom Postprocessor Axis value without Axis name

Post by CVH » Wed Aug 09, 2023 2:19 am

Lpkkk wrote:
Tue Aug 08, 2023 11:42 am
How can i get a value but without Axis name in front of it?
For example in GCodeBase.js "ZD" is defined with a prefix:

Code: Select all

    // variables:
    //                    name,                  ID,                     always, prefix, decimals, options
    this.registerVariable("zCuttingDepth",       "ZD",                   true,  "Z", "DEFAULT", "DEFAULT");
One can overwrite this in a custom postprocessor with:

Code: Select all

    this.registerVariable("zCuttingDepth",       "ZD",                   true,  "", "DEFAULT", "DEFAULT");
Custom postprocessors for G-Code are all based in one way or another on GCodeBase.js.
You should not alter GCodeBase.js as that is overwritten when QCAD/CAM is updated or reinstalled.
All postprocessors are based in one way or another on CamExporterV2.js (Without an open source reference).

G-Code as this is not functional to my knowledge, the CNC driver would not know what the '-4' in 'G1 -4' is for.

Regards,
CVH

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

Re: Custom Postprocessor Axis value without Axis name

Post by andrew » Wed Aug 16, 2023 12:00 pm

You can also use [ZD#] in your post processor to only output the value, and not the prefix.

Post Reply

Return to “QCAD/CAM”