Heather Posted February 13, 2002 Share Posted February 13, 2002 Is there anyway to find out what the size and location of a worksheet on a drawing and then re-set the location? When I re-calc my "Materials list" it changes size and I have to manually move it so that the bottom right corner is in the old location. As it is now the top left stays put and everything else changes to suit... I haven't found a vectorscript function that will get or set the "image location".Thanks, Heather Quote Link to comment
Fuge Posted February 13, 2002 Share Posted February 13, 2002 Heather, Name your worksheet,it's size and distance from the drawing area inthe CONST section and your good to go.Dave -------------------------------------------PROCEDURE WS;CONST WksName = 'My_WS_Name'; {Your worksheet name} Top =1; {Worksheet Top} Left=1; {Worksheet Left} Bottom=2; {Worksheet Bottom} Right=2; {Worksheet Right} WSPositionX=1"; { X Distance from drawing area } WSPositionY=1"; { Y Distance from drawing area }VAR WksH,WSImage : HANDLE; ws1X, ws1Y, ws2X, ws2Y ,d1X, d1Y, d2X, d2Y :REAL; BEGIN 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 ); END;RUN ( WS ); [ 02-13-2002: Message edited by: Fuge ] Quote Link to comment
Heather Posted February 14, 2002 Author Share Posted February 14, 2002 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 ); Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.