TTY Mode
- Last UpdatedJan 26, 2023
- 3 minute read
Whitespace calculation cannot be performed using the 'pure tty' mode of draw.exe (which is draw.exe -tty) because of the 3D view dependency. Any attempt to do so results in an error:
* $m /w:\WSPML2.mac
(40,300) Whitespace can run in graphics mode only
In line 24 of Macro w:\WSPML2.mac
!ws.RunAndWrite('/MYSHEE', 300, 20)
(40,300) Whitespace can run in graphics mode only
A well supported scenario is to run mon.exe in TTY mode and let it run draw.exe in graphics mode. The Draw work area is not displayed at any time. Run mon.exe in tty mode and execute a PML macro, for example:
call "setupenv.bat"
%DRAW_ROOT%\Build\Sandpit\Release\mon.exe -proj=BAS -username=SYSTEM -pass=XXXXXX -mdb=/CTBHTEST -tty -macro="$m w:\MYMACRO.mac"
The macro can be similar to:
-- A quick macro example for running WS in the "TTY GRA" mode (so called (*)).
-- (While draw.exe actually runs in the graphics mode, not tty.)
-- Enable logging to a file.
alpha log "%TEMP%\ws.log" over
-- Run draw.exe in the graphics mode.
dev GRA
RUN DRAW
-- Now execute main whitespace logic (refer to the "Basic API"
-- example).
import 'Aveva.Pdms.SDInteraction.UI'
handle ANY
endhandle
using namespace 'Aveva.Pdms.SDInteraction.UI.Whitespace.PML'
!ws = object WSManager()
!ws.RunAndWrite('/MYSHEE', 300, 20)
-- We have to save work, obviously. Otherwise the result of computation
-- is not persisted.
savework
-- End logging to a file.
alpha log end
-- Shut E3D down.
finish
Mon.exe starts draw.exe, the whitespace calculation is performed, and then terminates. As draw.exe is run in graphics mode, the AVEVA E3D Design loading screen is displayed.

The AVEVA E3D Design loading screen is blocked in the 'Loading Applications' state as that is where the whitespace calculation takes place. The amount of time taken for whitespace calculation is dependent on the complexity of the macro and the amount of drawings processed, this can potentially take hours.
The macro can be used to create a log file, for example:
AVEVA E3D Design Draw Mk2.1.0.31[Z21031-10] (WINDOWS-NT 6.3) (13 Jul 2021 : 01:32)
Copyright 2012 to current year. AVEVA Solutions Limited and its
subsidiaries. All rights reserved.
whitespace: 19-Jul-21 16:58:27 Picture owner to optimize is 'MYSHEET'.
whitespace: 19-Jul-21 16:58:27 Timeout is 300.
whitespace: 19-Jul-21 16:58:27 MP limit is 40.
whitespace: 19-Jul-21 16:58:27 Opening picture owner...
whitespace: 19-Jul-21 16:58:27 Collecting whitespace input...
whitespace: 19-Jul-21 16:58:27 Grey space detection skipped (no A-GS penalty).
whitespace: 19-Jul-21 16:58:28 Calculation initialization completed.
whitespace: 19-Jul-21 16:58:33 Calculating...
whitespace: 19-Jul-21 16:58:33 Assigned job ID: 18827-526265b4-10e5-4ac9-8d94-0c6ac2ef2264
whitespace: 19-Jul-21 16:58:33 Computation context data upload completed [2.58 seconds]
whitespace: 19-Jul-21 16:58:33 Cloud computation started, job ID: 18827-526265b4-10e5-4ac9-8d94-0c6ac2ef2264.
whitespace: 19-Jul-21 16:58:39 Whitespace Engine version: 1.1+build20210406105157.
whitespace: 19-Jul-21 16:58:44 optimization started.
whitespace: 19-Jul-21 16:58:49 Result improved: T=4.4s AC=16 KFV=1 MP=80.20 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=NaturalViewAPCOG|ViewAPCOGDistance.
whitespace: 19-Jul-21 16:59:01 Result improved: T=4.4s AC=16 KFV=0 MP=100.20 (1) MD1=(19.93,0.00) MD2=(19.93,0.00) WPC=6 CR=KFVMovePairFirst.
whitespace: 19-Jul-21 16:59:01 Result improved: T=4.4s AC=16 KFV=0 MP=73.25 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=drop max.
whitespace: 19-Jul-21 16:59:01 Result improved: T=4.4s AC=16 KFV=0 MP=73.25 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=drop any.
whitespace: 19-Jul-21 16:59:01 Result improved: T=6.4s AC=16 KFV=0 MP=73.25 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=drop any.
whitespace: 19-Jul-21 16:59:01 Result improved: T=6.4s AC=16 KFV=0 MP=73.25 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=mut: scramble range (smf: 1, smc: 8) (start: 9, len: 6, cnt: 16).
whitespace: 19-Jul-21 16:59:01 Result improved: T=6.4s AC=16 KFV=0 MP=73.25 (1) MD1=(38.96,0.00) MD2=(38.96,0.00) WPC=5 CR=drop any.
whitespace: 19-Jul-21 16:59:01 Result improved: T=10.1s AC=16 KFV=0 MP=37.51 (1) MD1=(19.90,0.00) MD2=(19.90,0.00) WPC=6 CR=drop any.
whitespace: 19-Jul-21 16:59:01 Result improved: T=10.1s AC=16 KFV=0 MP=37.51 (1) MD1=(19.90,0.00) MD2=(19.90,0.00) WPC=6 CR=mut: swap any (smf: 1, smc: -1) (idx1: 2, idx2: 7, cnt: 16).
whitespace: 19-Jul-21 16:59:01 Result improved: T=10.1s AC=16 KFV=0 MP=37.51 (1) MD1=(19.90,0.00) MD2=(19.90,0.00) WPC=6 CR=mut: invert range (smf: 1, smc: 8) (start: 13, len: 3, cnt: 16).
whitespace: 19-Jul-21 16:59:02 optimization stopped: MP <= 40.
whitespace: 19-Jul-21 16:59:04 Writing result to database...
whitespace: 19-Jul-21 16:59:04 Finished.