Conv-Current Units to Printed Page

From Vectorlab
Jump to: navigation, search


Function to convert current units to printed page. This takes layer scale and scaling factor into account. By Orso B. Schmid


{ Orso ************************************************ }
{ converts a dim in current units to page units, according to user's settings } { takes layer and print scaling into account }	
FUNCTION U_CurrUnits2PrintedPage(val: REAL; layH : HANDLE): REAL;
	VAR
		userLayer: STRING;
	BEGIN
		BeginContext;
		userLayer := GetLName(ActLayer);
		
		IF (GetLayerByName(GetLName(layH)) <> NIL) & (layH <> ActLayer) THEN
			Layer(GetLName(layH));
			
		U_CurrUnits2PrintedPage := val * GetPrefReal(152) / GetLScale(layH) / GetPrefReal(70); { scaling factor in print }
		
		Layer(userLayer);
		EndContext(0);
	END;