Page 1 of 1

QCAD3 quits on startup script, no error msg.

Posted: Sat Mar 01, 2014 4:00 pm
by LeoP
Using WInXP, fully up-to-date.

Have QCAD3 installed in D:\QCAD Professional\QCAD 3.4.4 and it worked just fine with the quickstart from the desktop.
Until I wanted to add a default template, now it quits immedeately after starting up...

I followed the recipy from http://www.ribbonsoft.com/rsforum/viewt ... 5755#p5755, which resulted for me in:

Code: Select all

var mainWindow = RMainWindowQt.getMainWindow();
var doc = mainWindow.getDocument();
var di = mainWindow.getDocumentInterface();

di.importFile("_layerList.dxf");
di.regenerateScenes();
di.autoZoom();
doc.setFileName("");
This scriptfile is called GetLayerList.js and is located in the D:\QCAD Professional\QCAD 3.4.4\scripts directory.
The desired template is located in the D:\QCAD Professional\QCAD 3.4.4\libraries\templates directory.

I changed the Target: field in the quickstart link to "D:\QCAD Professional\QCAD 3.4.4\qcad.exe" -exec GetLayerList.js and expected to see a blank drawing with pre-defined layers; intead the program terminates without any warnings or messages...

I assume (dangerous, I know) that I do something not precisely right, but the what and how elude me.

Re: QCAD3 quits on startup script, no error msg.

Posted: Mon Mar 03, 2014 9:13 am
by andrew
This procedure is outdated.

Please use the new File > New from Template tool instead to start a drawing based on one of the templates in libraries/templates

Re: QCAD3 quits on startup script, no error msg.

Posted: Mon Mar 03, 2014 4:25 pm
by LeoP
Any chance of a user-defined template being selected as default?
After all, that was what I was trying to achieve...

Re: QCAD3 quits on startup script, no error msg.

Posted: Mon Mar 03, 2014 11:45 pm
by J-J
Hi,
It works for me, every time I launch QCAD, my custom drawing is opened:
Both, the file to open and the "file-name.js" reside in the QCAD main directory. This is invoke within the desktop shortcut, in my case: "C:\Program Files (x86)\QCAD-3.4.6\QCAD\qcad.exe" -exec .\template.js
And I observed, that if the command line cannot find the script, QCAD will terminate.
Hope this helps.

Re: QCAD3 quits on startup script, no error msg.

Posted: Tue Mar 04, 2014 1:25 am
by LeoP
I found a solution for my problem: the Target: field must include a path to the scriptfile following standard Windoze path syntax; so that QCAD can find it.
The path to the template in the script file must follow the linux syntax, i.e. use forward slashes instead of the Windoze backward (no pun intended) ones.
The location of the two files (script and template) is arbitrary, as long as the correct path name and syntax is used.