I am struggling trying to call InfoDistancePP from my Library item script (like MyRectangle.js).
I would like to let the user drop the library script onto the drawing but before the item is drawn I would like to call InfoDistancePP to get a distance then use this to draw the actual item into the drawing (in this case MyRectangle.js), is this possible?
I found this post (#6) http://www.qcad.org/rsforum/viewtopic.php?f=30&t=1927&hilit=export where Andrew is calling OpenFile from a script and thought I might be able to use it as a base to call InfoDistancePP.
Code: Select all
var open = new OpenFile();
If I try this code in my MyRectangle.js script it fails in the debugger with the error "TypeError: Result of expression 'open.openFile' [undefined] is not a function."
Where is the call to openFile defined, I cannot find it in OpenFile.js script (or NewFile.js for that matter)?
Hope someone can shed some light, I am struggling with the scripting side of things.