1) How can I add something to current DWG or DXF file by my script. I use:
Code: Select all
// init application name:
qApp.applicationName = "Nacti body";
// init DWG / DXF exporter:
RDwgExporterFactory.registerFileExporter();
var storage = new RMemoryStorage();
var spatialIndex = new RSpatialIndexNavel();
var document = new RDocument(storage, spatialIndex);
document.setUnit(RS.Meter);
// create document interface (needed for file export functionality):
var di = new RDocumentInterface(document);
// create an operation:
var operation = new RAddObjectsOperation();
...
// apply operation to document:
operation.apply(document);
// export document to DWG, version 2000:
di.exportFile(file_name.dwg "DWG 2000");
2) I'm not able to open GUI with created DWG file at the end of my script. I must open QCad GUI and load file manually. I run my script by command:
Code: Select all
./qcad-trial -autostart my_script.js
Code: Select all
./qcad -exec my_script.js
I try use something like this:
Code: Select all
var open = true;
if (open){
include("scripts/File/OpenFile/OpenFile.js");
var action = new OpenFile();
action.openFile("my_file.dwg");
action.finishEvent();
}
Code: Select all
NewFile.prototype.beginEvent [1339929706108]
EAction.prototype.showUiOptions: no options tool bar
Creating storage...
Creating spatial index...
Creating document...
RDocument::setCurrentBlock: removing block: 22
Init idle and default actions...
EAction.prototype.showUiOptions: no options tool bar
./qcad-trial: řádek 36: 6058 Neoprávněný přístup do paměti (SIGSEGV) LD_LIBRARY_PATH="$DIR" "$binary" $OPT1 $OPT2 "$@"