Hello all,
Long time VWX user, first time VS user..."not-a-programmer-boilerplate-intro.docx" I'm working on a custom seating tool and have run into what should be an elementary issue. I've written code to run various maths on a selected rectangle giving me numbers for what will eventually be a semi-parametric tool, but in order to get to the next step - I to find the X,Y coordinates of a previously selected rectangle via the known HANDLE. I see plenty of ways to do the opposite action...
I'm attaching my full code, but it's just under the BEGIN statement where I would expect to insert a Getcoord(h) or something.
I understand that my structure is not orthodox but it does compile and function thus-far.
Thanks!
{-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=--=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-
ASBESTOS - A BETTER SEATING TOOL
BETA_V.005
-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=--=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-=x=-}
Procedure ABST;
CONST
(*these vars will eventually be user/parametric inputs*)
CHAIRLENGTH=17;
CHAIRWIDTH=20;
CHAIRSPACE=2;
CHAIRSROW=14;
(*CHAIRSROWMIN=foo; *)
MAXROW=15;
(*MINROW=bar;*)
ROWSPACE=30; {is +6" of chairtool spacing}
AISLE=96;
(*Sub-constants for use in calculations*)
LIVIX=(CHAIRLENGTH*CHAIRSROW);
LIVOX=(CHAIRSROW-1);
VORIX=(CHAIRWIDTH*MAXROW);
VOROX=(MAXROW-2);
HZ_DIVISOR= (LIVIX)+(CHAIRSPACE*LIVOX)+(AISLE/2);
VR_DIVISOR=(VORIX)+(ROWSPACE*VOROX)+(AISLE/2);
SUBSECLEN= ((LIVIX)+(CHAIRSPACE*LIVOX));
SUBSECWID= Trunc((VORIX)+(ROWSPACE*VOROX));
{<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>}
(*these variable definitions are utilized within native VS functions*)
VAR
h :HANDLE;
(*these variable definitions are utilized within local functions*)
VERT : REAL;
HORZ : REAL;
LENGDIV: REAL;
TRUSECLEN: REAL;
TRUSECWID: REAL;
NUMHORZSEC: REAL;
NUMVERTSEC: REAL;
BEGIN
{these are calls to the VWX API funtions and serve to assign numerical value to the vars seen above}
h:= FSACTLAYER;
VERT:= HHeight(h);
HORZ:= HWidth(h);
{!!!}
{at this point, boundary height and length have been
defined and stored in the VERT and HORZ variables}
{<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>}
{this determines the boundry size of each seating section WITH AISLES}
TRUSECLEN:= Trunc(HZ_DIVISOR);
TRUSECWID:= Trunc(VR_DIVISOR);
{As reference, the constants SUBSECLEN and SUBSECWID determine the boundry size of each seating section WITHOUT AISLES}
{<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>}
{this divides the outer boundary by true calculated section size}
NUMHORZSEC:= Trunc(HORZ/HZ_DIVISOR);
NUMVERTSEC:= Trunc(VERT/VR_DIVISOR);
Message('TOTAL HORZ SECTIONS:', NUMHORZSEC, 'TOTAL VERT SECTIONS', NUMVERTSEC);
END;
Run(ABST);