Util-Get Layer Scale

From Vectorlab
Jump to: navigation, search


Function to get the scale of the layer of an object. Works in symbols, groups or any viewport group (annotations, crops). By Orso B. Schmid


{ Orso ************************************************ }
{ gets layer scale unregarded the parent container }
FUNCTION U_GetLayScale(h: HANDLE): REAL;
	BEGIN
		IF (h = NIL) THEN
			h := ActLayer
			
		ELSE WHILE (h <> NIL) & (GetType(h) <> 32) DO
			h := GetParent(h);
			
		CASE GetType(h) OF 
		31: U_GetLayScale := GetLScale(h);
		
		OTHERWISE 
			U_GetLayScale := GetLScale(ActLayer);
		END;
	END;