
! script name: plot.d/digitsetup
! topic: Sample - set up digitizer

!A
!A NAME:
!A
!A 	Set up digitizer
!A
!A DESCRIPTION:
!A
!A	This script is for plotting a view on a plotter to scale.  The
!A 	perspective (e.g. isometric, top, front, or side) of the main
!A 	view is centered and fitted on the plotter.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT PAPER SIZE A B C D E: Enter the paper size to be used for
!B 	plotting.
!B
!C NOTES:
!C
!C 	The A size is the default paper.  The data files for the different
!C 	size paper are in:
!C
!C  	        "/usr/weber/util/tooldata/plotconfig"
!C
!C 	The files may need to be modified depending on the type of plotter
!C 	being used.  New files may be added by following the format of the
!C 	other files.  If a new file is added, make sure the option is added
!C 	to the question and answer selections.
!C
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: plot to scale ")

OPTION BASE 1
DIM Destination$[256]
DIM Answer$[256]

Xlength= 1
Ylength= 1
Units= CurrentUnits
Plotter_units=1016
IF Units= WsMetric THEN plotter_units= 40


P1x= 0
P1y= 0
P2x= Xlength*Plotter_units
P2y= Ylength*Plotter_units


PRINT "P1 & P2",P1x,P1y,P2x,P2y

Start:Digitizer_view= FindView("DIGITIZER")
IF Digitizer_view THEN	Leave

xmin= 0
xmax= Xlength
ymin= 0
ymax= Ylength
stat= DigitizerView("DIGITIZER","temp",xmin,xmax,ymin,ymax,p1x,p1y,p2x,p2y)


Leave:!
Stat=SetInputFormat("n4","")
IF (NOT LEN(Destination$)) THEN
         LOAD "typecontrol"
ELSE
         LOAD Destination$
END IF
END
