Page 1 of 1

Re-OPEN SOLVED: Addressing regular Qcad scripts

Posted: Wed Aug 28, 2019 3:35 pm
by CVH
Andrew,

To make use of the addSpline simple API I included simple.js in my script.
Just as prescribed but I had to use 'include("scripts/simple.js");' ... and more
I had to put the physical scripts under the Qcad scripts folder.
Along with the script files: simple_create.js, simple_info.js, simple_input.js, simple_modify.js,
simple_transaction.js, simple_view.js.
And those are simply included by simple.js as a plain 'include("xyz,js").
Something similar is true for sprintf.js.
All in contradiction with eg. library.js that used to be not included in my script with no file present.
Or the inclusion of EAction in Misc.js as 'include("scripts/EAction.js");' with no file present.

I presumed that all scripts where present as compiled versions in a Win installer.

It seems that this is made straightforward for some but not for all.
OR
I am completely missing something here.

Regards

Re: Addressing regular Qcad scripts

Posted: Wed Aug 28, 2019 8:32 pm
by andrew

Code: Select all

include("scripts/simple.js");
should work (and does work here). No need to copy any files into your QCAD installation. All scripts are compiled into the qcadscripts plugin.

Re: Addressing regular Qcad scripts

Posted: Thu Aug 29, 2019 11:28 am
by CVH
SOLVED

Well, I have some well documented 'Include structures trees' in the top of several experimental scripts.
And their only purpose was to have an overview where what is included, literally how and if it was/is not present.
If they were not present and an error was trown at load or at runtime the appropriate files where sourced from Github.
Every update since ...
viewtopic.php?f=8&t=5624&p=20916#p20925

At the cost of countless hours of restarting Qcad over and over again.
Without, with and again without the debugger.

In the last year I updated regularly.
A few times I did a deïnstallation and a 'clean' install for what it's worth.
If that did not solved the issues in the past, and as a system restore from over a year ago is out of the question...
I have decided to wipe Qcad and any traces of the system before a reinstall.
I can't advice anyone to try this on a win system without having some experience in this process.
Any fault in this may irreversibel corrupt the complete system.
Also recommended is having a second system to source the internet when you get stuck.

I've added a verbose summary for the most daring.

Andrew, maybe you could update the header of simple.js and set the correct include text.

Thanks,
Regards

Re: SOLVED: Addressing regular Qcad scripts

Posted: Thu Aug 29, 2019 11:34 am
by andrew
Hmm.. uninstalling ("wiping") QCAD is as simple as deleting its installation folder (that is one single folder with all its contents) and that's it.

Resetting the configuration is slightly more involved to delete the file QCAD3.ini:
https://qcad.org/en/tutorial-resetting- ... figuration

I'd certainly not recommend anyone to go through the ordeal described in the above document ;)

Re: SOLVED: Addressing regular Qcad scripts

Posted: Thu Aug 29, 2019 11:40 am
by CVH
It's the only thing that did the trick so far.
Lets hope more of my issues were solved.

Regards

Re: SOLVED: Addressing regular Qcad scripts

Posted: Thu Aug 29, 2019 7:24 pm
by Husky
andrew wrote:
Thu Aug 29, 2019 11:34 am
I'd certainly not recommend anyone to go through the ordeal described in the above document ;)
I second that!

Re: Re-OPEN SOLVED: Addressing regular Qcad scripts

Posted: Sun Sep 08, 2019 6:31 am
by CVH
Re-encountered it with this topic:
https://qcad.org/rsforum/viewtopic.php?t=6552

This time I know exactly what I did: it only took me 35 min
And my memory is not that bad yet.

Downloaded most recent zip with Qcad master from Github >> Data drive / Copy downloads
Expanded under Copy downloads/master files.....
Created subfolder C:\Program Files\QCAD\scripts\Modify
UAC >> yes, I'm Admin
Created subfolder C:\Program Files\QCAD\scripts\Modify\Scale
UAC >> yes, I'm Admin
Copied Scale.js from master to C:\Program Files\QCAD\scripts\Modify\Scale
UAC >> yes, I'm Admin
Copied and renamed to Scale.js.org
UAC >> yes, yes, I'm Admin
Implemented change to Scale.js with NPP
Save >> Admin mode? yes, ... (NPP reopens in Admin mode)
Save

Started Qcad in debugger mode
Errors with associated files so closed Qcad
Tried to no avail some different include's eg. without path
Copied and renamed to Scale.js.new >> UAC...
Copied complete master Scale folder to C:\Program Files\QCAD\scripts\Modify >> UAC...
Deleted original Scale.js and renamed Scale.js.new back >> UAC...
Implemented Optionbutton in ScaleDialog.ui with Qt Designer (5.11.1)
Qt Designer can't write back to protected OS portion
Saved temporary on datadrive, this messes up the paths of the pics
Copied over to C:\Program Files\QCAD\scripts\Modify\Scale >> UAC...
Corrected pic paths with NPP
Saved (is in admin mode)
Implemented Optionbutton in Scale.js with NPP
Saved (is in admin mode)

Started Qcad in debugger mode
Errors with associated files in Modify folder so closed Qcad
Tried to no avail some different include's eg. without path
Copied all 6 files from master Modify folder to C:\Program Files\QCAD\scripts\Modify >> UAC...

Started Qcad in debugger mode
works as a charm

Again I have to have a copy of all files involved under Qcad

Help!?
CVH