Thanks Fuge,
Works Great Since my drawings have several layer with several scales, I added a little bit to it. (You'll recongnize some of my additions to) When I get a spare minute (ya right) I want to make it so the worksheet is positioned relative to my drawing boarder rather that the page... We also print our drawings on severl printer on different size papers.
Again, thanks a million.
Heather
PROCEDURE WSrecalc;LABEL99;CONSTWksName = 'materials'; {The Worksheets name}Top =1; {Worksheet Top}Left=1; {Worksheet Left}Bottom=3; {Worksheet Bottom}Right=3; {Worksheet Right}WSPositionX=3.25"; { X Distance from drawing area }WSPositionY=.875"; { Y Distance from drawing area }
VARWksH,ObHd,WKspls2,WKspls1,WSImage,currentHd : HANDLE;ws1X, ws1Y, ws2X, ws2Y ,d1X, d1Y, d2X, d2Y :REAL;
BEGIN
WksH := Getobject ( WksName );{Checks if the worksheet exists by name}IF WksH = NIL THENBEGINSysbeep;AlrtDialog ( 'The worksheet "Materials" does not exist in this document!' );GOTO 99;END;
currentHd:=ActLayer;Layer('Border');WksH := Getobject ( WksName );ShowWS(WksH,True);SetWSPlacement(WksH,Top,Left,Bottom,Right);RecalculateWS(WksH);ShowWS(WksH,False);WSImage:=GetWSImage(WksH);GetBBox(WSImage,ws1X, ws1Y, ws2X, ws2Y );GetDrawingSizeRect(d1X, d1Y, d2X, d2Y );HMove(WSImage,(d2X - ws2X) - WSPositionX, ( d2Y - ws2Y ) + WSPositionY );Layer(GetLName(currentHd));
AlrtDialog ('The Materials list has be updated');
99 : END;RUN ( WSrecalc );