Hi 4 all!
Is it possible use blocks name in post processor to customize G-codes?
I need to extract saved block names as name for details - to make some special tag comments in generated G-code. This tags will use laser machine
Use blocks name in post processor to customize G-codes
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.
Always indicate your operating system and QCAD version.
Indicate the post processor used.
Attach drawing files and screenshots.
Post one question per topic.
Re: Use blocks name in post processor to customize G-codes
Yes, you can access the complete QCAD and Qt API from post processors.
For example, to get a list of all block names as ECMAScript array, you can use this code:
For example, to get a list of all block names as ECMAScript array, you can use this code:
Code: Select all
var blockNames = this.cadDocument.getBlockNames();
Re: Use blocks name in post processor to customize G-codes
We need, that post processor process named blocks (outer contours) in this wayYes, you can access the complete QCAD and Qt API from post processors.
For example, to get a list of all block names as ECMAScript array, you can use this code:
1) First cut named blocks that located inside another named blocks
2) After - process other named blocks, but never must be situation that we cut inner contours of another named block, before current block is completely cutted with all inner contours
3) Before every named block (named outer contour), we must insert this text in G-Code -
;#*Part_xxx
where Part_xxx mean extracted name of block
We need this for extra detail routines by our CNC laser machine
Thanks a lot for help
Re: Use blocks name in post processor to customize G-codes
This is quite different from how QCAD/CAM usually processes toolpaths.
Are your drawings already prepared in that way or are you creating new drawings this way?
If you are creating new drawings, I would suggest to drop the use of blocks for toolpaths and instead create QCAD/CAM toolpaths using the appropriate toolpath names (instead of the block name). You can insert the toolpath name in your G-Code where needed.
You can either create a separate toolpath for inner contours to make sure they are cut before outer contours, or you can let QCAD/CAM handle this can simply create a single toolpath containing outer and inner contours. QCAD/CAM will automatically process inner toolpaths first.
Are your drawings already prepared in that way or are you creating new drawings this way?
If you are creating new drawings, I would suggest to drop the use of blocks for toolpaths and instead create QCAD/CAM toolpaths using the appropriate toolpath names (instead of the block name). You can insert the toolpath name in your G-Code where needed.
You can either create a separate toolpath for inner contours to make sure they are cut before outer contours, or you can let QCAD/CAM handle this can simply create a single toolpath containing outer and inner contours. QCAD/CAM will automatically process inner toolpaths first.
Re: Use blocks name in post processor to customize G-codes
We plan to adopt QCAD/CAM to full cycle use begin fromAre your drawings already prepared in that way or are you creating new drawings this way?
1) making drawings of details
2) (if necessary) multiply county of some details
3) Make nesting on the same (98%) size sheets
4) Cut it by generated G-Codes on our Laser CNC Machine
It is great, because we use some different parameters for laser (speed, power) in depend on material and otherinstead create QCAD/CAM toolpaths using the appropriate toolpath names
But I don't understand clearly - Is it possible to assign names to details (contours) and extract it while forming G-Codes - with know entry point and known exit point (when cutting of current detail is complete).
We will use this to attach stickers with id code or make direct graving on every detail.
P.S. As I understand, Tab is inserted on contour only manually? Is it possible to insert tab automatically for every side / or by every xxx mm's of details contour?
Thanks for help
Re: Use blocks name in post processor to customize G-codes
Yes, every toolpath has a name which can be output into G-Code or can be used otherwise in your post processor.
If your contours are polylines, you can force QCAD/CAM to use the start of the polyline as start point.
You can attach any kind of additional information to toolpath by extending the toolpath dialog. This is all possible from within your post processor.
That's something you'd have to implement in the post processor (not straightforward). You could also copy a tab and then paste it along a polyline at given intervals (Edit > Paste along Entity).
Re: Use blocks name in post processor to customize G-codes
Thanks a lot for help. I'm diving in QCad very quick and deepThat's something you'd have to implement in the post processor (not straightforward).
I have found nice small CAM postprocessor guide (https://qcad.org/en/qcad-cam-postprocessor), but no information on developer guide https://qcad.org/doc/qcad/latest/developer/
We need to extract extra info about CAM toolpath's - as example - total cutting length, length of rapid moves between contours (laser not work), length of details contours (CAM Tool PATHS lengths - when laser works)