Skip to content

Instantly share code, notes, and snippets.

@marekw2143
Last active October 2, 2023 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marekw2143/4a2791d4ca38f901c53c9a30e1e308a9 to your computer and use it in GitHub Desktop.
Save marekw2143/4a2791d4ca38f901c53c9a30e1e308a9 to your computer and use it in GitHub Desktop.
include("scripts/EAction.js");
include("scripts/File/File.js");
include("scripts/EAction.js");
include("scripts/Tools/arguments.js");
include("scripts/sprintf.js");
include("scripts/simple.js");
function dbg(text){
var toLog = "Krokus::" + text;
qDebug( toLog );
};
Krokus.prototype = new EAction();
function Krokus(guiAction) {
EAction.call(this, guiAction);
dbg("init called");
this.setUiOptions("Krokus.ui");
dbg("init setUiOptions called");
};
Krokus.prototype = new EAction();
Krokus.prototype.beginEvent = function() {
qDebug("Krokus - entering beginEvent");
EAction.prototype.beginEvent.call(this);
EAction.handleUserMessage("rysowanie linii!");
// create a document:
var doc = EAction.getDocument();
// add something to the document:
startTransaction(doc);
addLine(0,0, 100,100);
endTransaction();
// export the document to a DXF file:
// var di = new RDocumentInterface(doc);
// di.exportFile("qcad_createdrawing.dxf");
};
function addLine(doc) {
startTransaction( doc );
addLine(0,0, 100, 100);
endTransaction();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment