Hi,
I'd like to be able to export a DWG through my custom script file (-autostart). I'm trying to use the BitmapExport.prototype.exportBitmap method but I'm getting the following error:
Warning: RScriptHandlerEcma::eval: script engine exception: "TypeError: Result of expression 'view' [null] is not an object."
I assume it's because I'm instantiating a document and documentInterface as follows:
var doc = new RDocument(new RMemoryStorage(), new RSpatialIndexNavel());
var di = new RDocumentInterface(doc);
and I assume that that's why there's no view instantiated.
Can you please share the code inside Dwg2Bmp.js so I can see how to do it properly? or rather can you advise on how to resolve this error?
Export to BMP from script file
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Re: Export to BMP from script file
To attach a view (off screen):
Code: Select all
var scene = new RGraphicsSceneQt(di);
var view = new RGraphicsViewImage();
view.setScene(scene, false);
Re: Export to BMP from script file
Worked. Thanks.