Andrew, how do you do it, that a script gets reloaded from file on each execution?
The first custom script, the one that is called from the menu or button, will be reloaded each time, if the "beginEvent" hook ends with a "delete Foo" statement, Foo being the name of the class itself.
But classes instantiated inside of this class will not be reloaded the next time the first one is instantiated, and if I delete them, they will be missing then.
There must be a special trick that you apply and that I dont understand. Would you explain?
Peter
Reloading of Script before execution
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
- hungerburg
- Premier Member
- Posts: 160
- Joined: Fri May 28, 2010 7:35 pm
- hungerburg
- Premier Member
- Posts: 160
- Joined: Fri May 28, 2010 7:35 pm
QCAD3 rocks
Ahh, this is good news for people like me, that follow a very iterative approach to development - Thank You.
I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript".
Using the path relative to the qcad3 root "scripts/..." works though. Using the -exec argument after a filename will even first load the file and then perform the action on it in one go. Great!
I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript".
Using the path relative to the qcad3 root "scripts/..." works though. Using the -exec argument after a filename will even first load the file and then perform the action on it in one go. Great!
Re: QCAD3 rocks
The -exec switch expects an absolute or relative path to a script that contains a class with the same name as the file name and has a beginEvent function.hungerburg wrote:I tried now calling a script from commandline with the name specified for such occasions in the "beginEvent", but get this Warning: RGuiAction::getByScriptFile: no action found: "MyScript".
If I understand you correctly, you tried to pass -exec a class name. That is an interesting thought. Feature request:
http://www.ribbonsoft.com/bugtracker/in ... ask_id=277
-
- Junior Member
- Posts: 10
- Joined: Sat Jun 02, 2018 7:59 pm
- Location: Walnut Creek, CA
Re: Reloading of Script before execution
Hi,
I'm trying to do this on Windows 10 command line with QCAD 3.20.1.0, using the modified form from within f:\Program Files\QCAD\.
qcad -always-load-scripts.
I get the splash screen but the program aborts. Is there another way to enter the command line switch?
Thanks in advance,
I'm trying to do this on Windows 10 command line with QCAD 3.20.1.0, using the modified form from within f:\Program Files\QCAD\.
qcad -always-load-scripts.
I get the splash screen but the program aborts. Is there another way to enter the command line switch?
Thanks in advance,
Mike Miller, P.E.
Re: Reloading of Script before execution
I can confirm this is broken and will likely be fixed in the next version.