How do i configure CAM?

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.

User avatar
srl
Full Member
Posts: 65
Joined: Tue Aug 09, 2011 4:40 am

Re: How do i configure CAM?

Post by srl » Sun Feb 09, 2014 7:09 am

Hi Andrew
Can I make a request for some changes to CamExporter.prototype.exportContourEntity unless I have over looked something?

Your following code appears twice for ramp on and ramp off.

Code: Select all

e = new RLineEntity(this.getDocument(), new RLineData(line));
            e.copyAttributesFrom(entity);
            this.exportContourEntity(e);
My problem is that custom properties are not copied. So I can't make G41/42 stuff work before it reaches the shape proper. Layer name stuff is fine of course.
Can the 3 lines be turned into a overwrite function? Ramp in at angle is then a option. I really don't want to include whole CamExporter functions in my file for such a small thing.
srl

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

Re: How do i configure CAM?

Post by andrew » Mon Feb 10, 2014 9:31 am

I've refactored this into calling writeRampOn / writeRampOff with the ramp on / off shape and the first entity as parameters for the upcoming 3.4.6 release.

User avatar
srl
Full Member
Posts: 65
Joined: Tue Aug 09, 2011 4:40 am

Re: How do i configure CAM?

Post by srl » Wed Feb 12, 2014 8:58 am

Thank you Andrew
My angle down into a closed Contour is now working.
I have a problem with open contours.

The CAD file is just one contour of lines but in the CAM (log file) it is changed into two open contours.A problem when you set the start to the other end.
The files attached had a standard Gcode.js.
I had a look at CamExporter.prototype.appendToContour but is a bit much for me!
I have start and direction set fine in closed contours.

I'm getting close to releasing a good demo.

Stephen
Attachments
testsrl.log
Log file
(30 KiB) Downloaded 987 times
testsrl.dwg
(102.32 KiB) Downloaded 719 times

User avatar
srl
Full Member
Posts: 65
Joined: Tue Aug 09, 2011 4:40 am

Re: How do i configure CAM?

Post by srl » Fri Feb 14, 2014 11:17 am

Hi
Can someone look at my code for copying custompropertys.
GCodesrl.prototype.writeRampOn = function(shape, entity) {
   	
	var e = shapeToEntity(this.getDocument(), shape);
   	e.copyAttributesFrom(entity);
	var text =  entity.getCustomPropertyKeys();
	for(var i = 0;i<text.length;i++)
{
		var k= text;
		var v =  entity.getCustomProperty("QCAD",k , 0);
		e.setCustomProperty("QCAD", k, v);
		}

	e.setCustomProperty("QCAD", "A", 1);    // Delete this line if you dont want ramp in at angle.###############################
	



	this.exportContourEntity(e);
};



Sorry for being new at this.
srl

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

Re: How do i configure CAM?

Post by andrew » Sat Feb 15, 2014 10:14 am

srl: yes, that looks about right. Does it work?

User avatar
srl
Full Member
Posts: 65
Joined: Tue Aug 09, 2011 4:40 am

Re: How do i configure CAM?

Post by srl » Sat Feb 15, 2014 11:23 am

No I only get this-

Wrong number/types of arguments for RObject.getCustomPropertyKeys().

I tried push but I only got the same error. e_confused

Code: Select all

var text = [];
text.push(entity.getCustomPropertyKeys());
	for(var i = 0;i<text.length;i++)
{
		var k= text[i];
		var v =  entity.getCustomProperty("QCAD",k , 0);
		e.setCustomProperty("QCAD", k, v);
		}

I did get the ramp on to turn around for when cutting around the outside.

Code: Select all

if(entity.getCustomProperty("QCAD","CO" , 0))
		e.rotate(180,e.getEndPoint());


Stephen.

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

Re: How do i configure CAM?

Post by andrew » Sat Feb 15, 2014 11:38 am

OK, try:
entity.getCustomPropertyKeys("QCAD")
Starting with QCAD 3.4.0, custom properties can be stored per application and in the above code, "QCAD" is the application.
I think, this was not yet updated in the API doc online.

Edit: The API doc was now updated:
http://www.qcad.org/doc/qcad/latest/dev ... 4b45f8f7ff

Post Reply

Return to “QCAD/CAM”