How to get a Layer Id quickly?
Posted: Thu May 23, 2013 11:12 pm
I have the following code inside an RImporter:
What is the right way to remember the Layer Id for later?
Thanks,
- Matthias
// what is the best practice to get the Document Interface inside an RImporter? var di = EAction.getDocumentInterface(); var di = RMainWindow.getMainWindow().getDocumentInterface(); var lt = document.getLinetypeId("CONTINUOUS"); var clr = new RColor(128,0,0); var layer = new RLayer(document, "01_Top", false, false, clr, lt); var operation = new RAddObjectOperation(layer); di.applyOperation(operation); //this.layerID[1] = layer.getId(); // <--- This code fails. Why? this.layerID[1] = document.getLayerId("01_Top"); // <---- This code works, but seems slowWhat is the right way to get the Document Interface?
What is the right way to remember the Layer Id for later?
Thanks,
- Matthias