Page 2 of 2

Re: How do i configure CAM?

Posted: Sun Feb 09, 2014 7:09 am
by srl
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

Re: How do i configure CAM?

Posted: Mon Feb 10, 2014 9:31 am
by andrew
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.

Re: How do i configure CAM?

Posted: Wed Feb 12, 2014 8:58 am
by srl
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

Re: How do i configure CAM?

Posted: Fri Feb 14, 2014 11:17 am
by srl
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

Re: How do i configure CAM?

Posted: Sat Feb 15, 2014 10:14 am
by andrew
srl: yes, that looks about right. Does it work?

Re: How do i configure CAM?

Posted: Sat Feb 15, 2014 11:23 am
by srl
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.

Re: How do i configure CAM?

Posted: Sat Feb 15, 2014 11:38 am
by andrew
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