Jump to content
Developer Wiki and Function Reference Links ×

Layer Type


Recommended Posts

Hi Ben,

You can test layer handles with GetSheetLayerUserOrigin().

Raymond

Procedure test;
VAR
H :Handle;
X, Y :Real;

BEGIN
H := FLayer;
while (H<>nil) do begin
	if GetSheetLayerUserOrigin(H, X, Y) then
		Message(GetLName(H), ' - SheetLayer')
	else Message(GetLName(H), ' - DesignLayer');
	Wait(1);
	H := NextObj(H);
end;		{ while }
SysBeep;
END;
Run(test);

Link to comment

If you intend to query layer types a lot, perhaps adding a simple function to your code will make things more readable.

I have one here:

function isSheetLayer(LyrHnd :Handle) :Boolean;
{ Returns TRUE if LyrHnd points to a Sheet Layer, FALSE otherwise. }
Var
X, Y :Real;
Begin
isSheetLayer := GetSheetLayerUserOrigin(LyrHnd, X, Y);
End;		{ isSheetLayer }

HTH,

Raymond

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...