Page 1 of 1

[solved] reopen the dxf file after it has been modified externally

Posted: Wed Oct 11, 2017 2:05 pm
by Nick1974
Hello.
How I can say to qcad so it reopens the dxf file after it has been modified externally?

I draw from ECMAScript:

1. Open qcad
2. Edit myscript.js and run from editor

Code: Select all

qcad -allow-multiple-instances -autostart myscript.js && qcad /tmp/myscript.dxf
3 View result in qcad
4. Switch to qcad
5. Close documet /tmp/myscript.dxf (Ctrl-W)
6. Switch to the editor
7. Goto 2

If qcad reopens the dxf file after it has been modified externally, I will be able to stay in the editor:

1. Open qcad
2. Edit myscript.js and run from editor

Code: Select all

qcad -allow-multiple-instances -autostart myscript.js && qcad /tmp/myscript.dxf
3 View result in qcad
4. Goto 2

Re: reopen the dxf file after it has been modified externally

Posted: Wed Oct 11, 2017 2:11 pm
by andrew
You could trigger a File > Revert after running your script:

1. Launch QCAD (and keep it running):

Code: Select all

qcad /tmp/myscript.dxf
2. Regenerate file and trigger File > Revert when done:

Code: Select all

qcad -allow-multiple-instances -autostart myscript.js && qcad -exec scripts/Pro/File/RevertFile/RevertFile.js
A warning dialog will be shown in QCAD if the file has been modified in QCAD.

Note that launching QCAD if it is already running will pass the arguments to the running instance. This way you can open additional files from the command line or trigger commands as shown above.

Re: reopen the dxf file after it has been modified externally

Posted: Mon Oct 16, 2017 12:01 pm
by Nick1974
Many thanks!