load default template
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files and screenshots.
Post one question per topic.
load default template
I need some help with scripting: I have made a drawing with a number of predefined layers that I use as a template for a new drawing. How can I replace the default drawing that is opened upon QCAD start-up with this template?
There's no preference for the default template (at this point).
A possible script solution would be:
template.js:
template.dxf: The template drawing
Starting QCAD:
A possible script solution would be:
template.js:
Code: Select all
var mainWindow = RMainWindowQt.getMainWindow();
var doc = mainWindow.getDocument();
var di = mainWindow.getDocumentInterface();
di.importFile("template.dxf");
di.regenerateScenes();
di.autoZoom();
doc.setFileName("");
Starting QCAD:
Code: Select all
./qcad -exec ./template.js
start up template
Thanks for your quick reply. When I type the start up code in the command line, it is ver2.2.2 that gets launched, not 3.0
Is it possible to make a short cut in the traditional Windows way?
(Win 7 -64)
Is it possible to make a short cut in the traditional Windows way?
(Win 7 -64)
default template
I got some positive results with this batch file:
@echo off
path C:\Program Files (x86)\QCAD-3\qcad-3.0.0-rc3-prof-win32
qcad -exec ./template.js
Windows did not like the "./" before qcad
To get the cmd file to work I had to locate the file "template.js" on the desktop...I am not an expert with Windows!
Thanks for your help.
@echo off
path C:\Program Files (x86)\QCAD-3\qcad-3.0.0-rc3-prof-win32
qcad -exec ./template.js
Windows did not like the "./" before qcad
To get the cmd file to work I had to locate the file "template.js" on the desktop...I am not an expert with Windows!
Thanks for your help.
Re: load default template
Under Windows 7 I placed the template.dxf and the script startup.js in the program directory of QCad.
In order to start QCad with these settings, just right-click on the shortcut in the start-menu, choose Properties and change the Target. In my case the correct setting is
Uwe.
In order to start QCad with these settings, just right-click on the shortcut in the start-menu, choose Properties and change the Target. In my case the correct setting is
Code: Select all
"C:\Program Files\QCAD Professional3\qcad.exe" -exec .\startup.js