Request

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
KHE
Active Member
Posts: 37
Joined: Sat Oct 09, 2021 9:54 pm

Request

Post by KHE » Wed Sep 13, 2023 2:32 pm

Good morning

I'm not sure where to post this request. Attached is a screen shot of the toolpath dialog. Under Tool:. Would it be possible to add the description . Currently it only shows tool number and diameter. I use tools with the same diameter with different function. I do have the cam tools dialog open to view on a second screen but it would be more convenient to see it in the toolpath menus.
Attachments
2023-09-13 09_26_14-CAM Profile Toolpath.png
2023-09-13 09_26_14-CAM Profile Toolpath.png (5.17 KiB) Viewed 82264 times

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

Re: Request

Post by CVH » Wed Sep 13, 2023 3:42 pm

KHE wrote:
Wed Sep 13, 2023 2:32 pm
Would it be possible to add the description
Yes it would be and it can be done in your custom postprocessor.
You will need some knowledge of Qt and JS scripting.
The basic layout of the CamProfileToolpathDialog can be found on the forum.
https://www.qcad.org/rsforum/viewtopic. ... 659#p33659

For example: LinuxCNCEvanCNC2.prototype.initDialog adds a G-Code group to the CamProfileToolpathDialog widget.
Then the next question is then how and where to synchronize that with what.

Instead of looking at the cam tools dialog ...
The tool description is included in the Edit CAM tool dialog.
This is displayed when hitting the pencil button besides the tool field.
Cancel will simply close that.

Regards,
CVH

KHE
Active Member
Posts: 37
Joined: Sat Oct 09, 2021 9:54 pm

Re: Request

Post by KHE » Thu Sep 14, 2023 1:39 pm

Thanks, I will have a look at the scripting. That's above my paygrade but I know someone who may be able to help.

KHE
Active Member
Posts: 37
Joined: Sat Oct 09, 2021 9:54 pm

Re: Request

Post by KHE » Thu Sep 14, 2023 1:43 pm

Hi CVH

I just looked at the link. Very interesting. I tried searching for suggestions on my question topic but had no luck. I need to improve my search skills!

Deejay
Junior Member
Posts: 15
Joined: Mon Dec 30, 2024 10:25 am

Re: Request

Post by Deejay » Wed Jan 01, 2025 11:58 am

Hi,

I had the same thoughts and it seems that I found a way to change the shown values on the combo box.
Add the following lines to your postprocessor file and adapt it according to your needs.
It shows the following in the combo box: <tool name> [<tool diameter>, <tool type>, <tool description>].
If tool type cannot be determined or if tool description is empty, these values are left out.
Below I attached a screenshot how it looks like for me (in german language).

Code: Select all

<Name of your Postprocessor>.prototype.initToolComboItem = function(toolCombo, toolName, toolBlock) {
	var toolDiameter = toolBlock.getCustomProperty("QCAD", "CamDiameter", undefined);
	var toolDescription = toolBlock.getCustomProperty("QCAD", "CamDescription", undefined);
	var toolType = toolBlock.getCustomProperty("QCAD", "CamToolType");
	var itemText = toolName + " [\u00F8" + toolDiameter;
	
	if (!isNull(toolType) && !isNaN(toolType))
	{
		switch (parseInt(toolType))
		{
			case Cam.ToolType.Mill:
				toolType = "mill";
			break;
			case Cam.ToolType.Drill:
				toolType = "drill";
			break;
		}
		itemText += ", " + toolType;
	}
	
	if (!isNull(toolDescription))
		itemText += ", " + toolDescription;
	
	itemText += "]";
	toolCombo.addItem(itemText, toolName);

    //if (!isNull(toolDescription))
    //    toolCombo.setItemData(toolCombo.count-1, toolDescription, Qt.ToolTipRole);
};
The two lines commented out at the bottom are for the tool tip. For me, this is no longer necessary since all information is shown in the combo box itself.

Further, I changed the default behaviour of the description text field in the "CAM Edit Tool" dialog. Normally, this field is automatically generated each time you change the tool name or the diameter and contains "<toolname> <diameter of tool>". I want to use my own (useful) descriptions.
This can be achieved by overwrite the following function in your postprocessor file:

Code: Select all

<Name of your Postprocessor>.prototype.getToolTypeTitleTemplate = function(toolType) {
	return null;
}
Perhaps this helps.

Regards,
Deejay
Attachments
camtoolpathdialog.png
camtoolpathdialog.png (8.67 KiB) Viewed 49915 times

Post Reply

Return to “QCAD/CAM”