Could anyone help me with this code?
Code: Select all
HatchFromSelection.prototype.beginEvent = function() {
EAction.prototype.beginEvent.call(this);
var doc = this.getDocument();
var di = this.getDocumentInterface();
var hatchData = new RHatchData();
hatchData.setDocument(doc);
hatchData.setLineweight(RLineweight.Weight015);
hatchData.newLoop();
hatchData.addBoundary(new RLine(new RVector(0,0), new RVector(100,0)));
hatchData.addBoundary(new RLine(new RVector(100,0), new RVector(200,0)));
hatchData.addBoundary(new RLine(new RVector(200,0), new RVector(0,0)));
EAction.handleUserWarning(qsTr("hatchData.getExploded: "+hatchData.getExploded()), true);
hatchData.setSolid(true);
hatchData.setScale(1);
hatchData.setAngle(10);
hatchData.setPatternName("Test");
var hatch = new RHatchEntity(doc, hatchData);
var op = new RAddObjectOperation(hatch, false, false);
di.applyOperation(op);
di.autoZoom();
EAction.handleUserWarning(qsTr("beginEvent finished"), true);
this.terminate();
};