Home

GetPtDimension:

Function GetPtDimension: REAL;
VAR
	Fraction: LONGINT;
	Display: LONGINT;
	Format: INTEGER;
	Upi: REAL;
	Uname,squareName: STRING;
BEGIN
GetUnits(fraction, display, format, upi, Uname, squareName);
GetPtSize:=upi/72*GetLScale(ActLayer);
END;
This function will return the dimension size of one point in the "current" drawing environment. Normally you can just use the active layer scale to determine this but there are several situations when active layer scale is not the layer the PIO is on!
A ViewPort annotation is one case where active layer scale does not help (ActLayer=0).
Also, when PIOs regenerate (after editing), they may regenerate on layers that are NOT the active layer. VW engineers must have addressed this for regenerating text because text in PIOs on different layer scales regenerates correctly. So my solution is to draw some text, measure it, divide it by its text size & delete the text to get the regenerating environment's dimension of 1 point.
There's some interesting juggling going on with font sizes as PIOs regernate on layers of different scales.
Also note that this dimension will vary a little according to the Font used.