Ben624 Posted June 20, 2007 Share Posted June 20, 2007 Is there any way for VS to differentiate between design layers and sheet layers? I want my script to cycle through all the design layers in a document, but not sheet layers. Ben Quote Link to comment
MullinRJ Posted June 20, 2007 Share Posted June 20, 2007 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); Quote Link to comment
MullinRJ Posted June 20, 2007 Share Posted June 20, 2007 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 Quote Link to comment
Ben624 Posted June 20, 2007 Author Share Posted June 20, 2007 worked like a charm. Thank you! 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.