Simple Script
Posted: Fri Jun 01, 2018 4:27 pm
Still strugling with simple change to ExDumpPolyline.js
I found the mirroring (arg(-v.y)) and the orientation change inappropriate, undocumented and misleading as an example.
All questions where finally cleared out by your reply on https://www.qcad.org/rsforum/viewtopic.php?f=8&t=5566 on May 17, 2018 11:47 am
Did found out that JavaScript isn't that hard to understand but that the syntax and the use of QCAD modules need carefull attention.
Next I find the command history an inappropriate place to dump the points data.
So I took a look at BlockListExport.js and the export to a CVS file is more appropriate.
Next I find the way java exports numbers unsatisfactory.
You proposed to use:
"%1".arg(numberToString(Math.PI, 12))
Math.PI is from java itself and is always present.
Math.PI returns a number and this checks out to be a number between 3.14159 and 3.14160 using comments to the command history.
numberToString is from the QCAD library.js lib.
Using this function ends the altered ExDumpPolyline.js script at this point.
So I presume library.js is not present, and even better, it is not to be found on my system.
I can't include it at the top of ExDumpPolyline.js script.
Reading the readme.txt in the C:\Program Files\QCAD\scripts one would think it is present as hardcoded.
I have not the intention to replace all hardcoded plugins with js files.
Because of the next two include branches I am troubled even further because scripts/Misc/Misc.js is also not found on my system but both scripts work.
ExMathSpiral.js : include("../MathExamples.js");
>> MathExamples.js : include("../Examples.js");
>> >> Examples.js : include("scripts/Misc/Misc.js");
ExDumpPolyline.js : include("../IOExamples.js");
>> IOExamples.js : include("../Examples.js");
>> >> Examples.js : include("scripts/Misc/Misc.js");
So I think I am missing a clue here.
I found the mirroring (arg(-v.y)) and the orientation change inappropriate, undocumented and misleading as an example.
All questions where finally cleared out by your reply on https://www.qcad.org/rsforum/viewtopic.php?f=8&t=5566 on May 17, 2018 11:47 am
Did found out that JavaScript isn't that hard to understand but that the syntax and the use of QCAD modules need carefull attention.
Next I find the command history an inappropriate place to dump the points data.
So I took a look at BlockListExport.js and the export to a CVS file is more appropriate.
Next I find the way java exports numbers unsatisfactory.
You proposed to use:
"%1".arg(numberToString(Math.PI, 12))
Math.PI is from java itself and is always present.
Math.PI returns a number and this checks out to be a number between 3.14159 and 3.14160 using comments to the command history.
numberToString is from the QCAD library.js lib.
Using this function ends the altered ExDumpPolyline.js script at this point.
So I presume library.js is not present, and even better, it is not to be found on my system.
I can't include it at the top of ExDumpPolyline.js script.
Reading the readme.txt in the C:\Program Files\QCAD\scripts one would think it is present as hardcoded.
I have not the intention to replace all hardcoded plugins with js files.
Because of the next two include branches I am troubled even further because scripts/Misc/Misc.js is also not found on my system but both scripts work.
ExMathSpiral.js : include("../MathExamples.js");
>> MathExamples.js : include("../Examples.js");
>> >> Examples.js : include("scripts/Misc/Misc.js");
ExDumpPolyline.js : include("../IOExamples.js");
>> IOExamples.js : include("../Examples.js");
>> >> Examples.js : include("scripts/Misc/Misc.js");
So I think I am missing a clue here.