How do I select all entities inside a box from script
Posted: Wed Oct 23, 2019 1:27 pm
I want to select all entities inside a box using the cross selection option.
I tried:
Which works great in the script console. But once I run it via the CLI I get:
What is the correct way to achieve the selection with cross selection enabled?
I tried:
Code: Select all
include("scripts/Select/SelectRectangle/SelectRectangle.js");
var d = new RDocument(new RMemoryStorage(), new RSpatialIndexNavel());
var di = new RDocumentInterface(d);
if (di.importFile(inFile) != RDocumentInterface.IoErrorNoError) {
di.destroy();
print("Cannot import file:", inFile);
return 1;
}
var ev = new SelectRectangle();
ev.setDocumentInterface(di);
ev.crossSelection = true;
ev.point1 = new RVector(0, 0);
ev.point2 = new RVector(3000, 200);
ev.selectEntities();
at the selectEntities() line."TypeError: Result of expression 'doc' [undefined] is not an object."
What is the correct way to achieve the selection with cross selection enabled?