QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • 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
  • Private
Attached to Project: QCAD Bugtracker
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):


Closed by  Andrew
04.12.2019 09:06
Reason for closing:  Not a bug
Felix commented on 04.12.2019 08:59

On Linux it behaves a little different but also weired:

Calling via Shell Scripts works as expected:

[email protected]:/qcad# ./bbox -platform offscreen /data/10.09.03.dwg
QCAD version  3.23.0
07:45:31: Debug:

You are using a trial version of QCAD Professional.

07:45:31: Debug:    If you would like to use this software productively,
07:45:31: Debug:    please purchase the full version for a small license fee from our
07:45:31: Debug:    Online Shop at:
07:45:31: Debug:    http://www.ribbonsoft.com/shop

07:45:31: Debug:    Thank you for trying this add-on!


07:45:31: Debug:    Your script will start in 15 seconds...
07:45:46: Debug:    calling odInitialize
Min: 2419.9969114297623/-125.36162367587679
Max: 2689.9969114297623/64.63837647546899
Size: 270/190.00000015134577

Calling directly doesn't work:

[email protected]:/qcad# ./qcad -no-dock-icon -no-gui -allow-multiple-instances -autostart scripts/Pro/Tools/BoundingBox/BoundingBox.js -platform offscreen /data/10.09.03.dwg
QCAD version  3.23.0
08:55:50: Debug:

You are using a trial version of QCAD Professional.

08:55:50: Debug:    If you would like to use this software productively,
08:55:50: Debug:    please purchase the full version for a small license fee from our
08:55:50: Debug:    Online Shop at:
08:55:50: Debug:    http://www.ribbonsoft.com/shop

08:55:50: Debug:    Thank you for trying this add-on!


08:55:50: Debug:    Your script will start in 15 seconds...
No input file given. Try -h for help.

Admin
Andrew commented on 04.12.2019 09:06

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.

Felix commented on 04.12.2019 11:52

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:

pushd "%QCAD_HOME%"
"%QCAD_HOME%\qcad.exe" -no-gui -allow-multiple-instances -autostart scripts\Pro\Tools\BoundingBox\BoundingBox.js %0 %*
popd

SHELL - no redirect - but works:

pushd "${QCAD_HOME}" || exit
"${QCAD_HOME}/qcad" -platform offscreen -no-dock-icon -no-gui -allow-multiple-instances -autostart scripts/Pro/Tools/BoundingBox/BoundingBox.js "$0" "[email protected]"
popd || exit
Admin
Andrew commented on 04.12.2019 12:40

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.

Felix commented on 05.12.2019 07:23

Got it. Thx.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing