- Status Closed
- Percent Complete
- Task Type Bug Report
- Category QCAD (main)
-
Assigned To
Andrew - Operating System All
- Severity Low
- Priority Very Low
- Reported Version 3.23.0
- Due in Version Undecided
-
Due Date
Undecided
-
Votes
1
- Felix (04.12.2019)
- Private
Attached to Project: QCAD Bugtracker
Opened by Felix - 04.12.2019
Last edited by Andrew - 04.12.2019
Opened by Felix - 04.12.2019
Last edited by Andrew - 04.12.2019
FS#2008 - windows: cannot call scripts\Pro\Tools\BoundingBox\BoundingBox.js directly, but bbox.bat works
Calling bbox tool via batch file works:
C:\Program Files\QCAD>bbox.bat D:\tmp\dwgtester\10.09.03.dwg
Output:
09:42:15: Debug: You are using a trial version of QCAD Professional. 09:42:15: Debug: If you would like to use this software productively, 09:42:15: Debug: please purchase the full version for a small license fee from our 09:42:15: Debug: Online Shop at: 09:42:15: Debug: http://www.ribbonsoft.com/shop 09:42:15: Debug: Thank you for trying this add-on! 09:42:15: Debug: Your script will start in 15 seconds... 09:42:30: Debug: calling odInitialize Min: 2419.9969114297623/-125.36162367587679 Max: 2689.9969114297623/64.63837647546899 Size: 270/190.00000015134577
Calling bbox tool directly doesn’t work:
C:\Program Files\QCAD>qcad.exe -no-gui -allow-multiple-instances -autostart scripts\Pro\Tools\BoundingBox\BoundingBox.js D:\tmp\dwgtester\10.09.03.dwg
Output (empty line):
On Linux it behaves a little different but also weired:
Calling via Shell Scripts works as expected:
Calling directly doesn't work:
Unlike macOS and Linux applications, Windows applications cannot have a GUI and write to stdout (for historical reasons), so you’ll have to direct the output to a file and output that file, for example in the same way as the batch script does.
Thx for the quick reply.
I know many windows applications that write to stdout. e.g. ImageMagick, Java, Node an many others.
And why can't I perform a direct call on linux either? (see above comment)
As a workarroud I'm now using a batch/shell script acting as proxy to the actual call. Doing no output redirection in my scripts, but it works. So I'm still convinced there is some issue inside qcad.
BATCH - no redirect - but works:
SHELL - no redirect - but works:
On Linux, try:
./qcad -no-dock-icon -no-gui -allow-multiple-instances -platform offscreen -autostart scripts/Pro/Tools/BoundingBox/BoundingBox.js /data/10.09.03.dwg
Reason:
All parameters before -autostart are for the QCAD binary. All parameters after -autostart and the script file are for the script.
Yes, there are certainly Windows apps that write to the console. These are command line only apps (no GUI). There are also workarounds to this Windows limitation (e.g. providing a separate .cmd file with the same name or Pseudoconsoles or trying to re-attach the terminal to the app). For QCAD this all seems a bit overkill. I'd recommend to use the batch files or an equivalent direct call.
Got it. Thx.