Jump to content
Developer Wiki and Function Reference Links ×

Script to delete sheet layers?


Recommended Posts

Hello @stayathomedad,

   One command you might want to use in your script is: 

GetObjectVariableInt(LyrHnd, 154));    { return the layer type of the layer referenced by LyrHnd }

where LyrHnd is a handle to a layer. This function will return a value of 1 for Design Layers, or 2 for Sheet Layers. Use this to test the layer handle before you delete it.

 

For example:

Message(GetObjectVariableInt(FLayer, 154));    { return the layer type of the First Layer in the drawing }

will always return 1, because there is always a design layer in a file and design layers are always stored below sheet layers. 

 

Conversely:

eg. - Message(GetObjectVariableInt(LLayer, 154));    { return the layer type of the Last Layer in the drawing }

can return 1 or 2. If there are any sheet layers in a drawing, the Last Layer will always be a sheet layer and the function will return 2. If there are no sheet layers in a drawing, then the Last Layer will be a design layer and the function will return 1.

 

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...