stayathomedad Posted December 12, 2022 Share Posted December 12, 2022 Is there a VS to delete sheet layers? I am very new to VS and I have a project where I would like to delete sheet layers. I can see when I create a Braceworks report that there are sheet layers being created and deleted. I would like to create a VS that does a similar process. Thanks for your time. Quote Link to comment
Pat Stanford Posted December 12, 2022 Share Posted December 12, 2022 DelObject() will delete a layer if you pass it a handle to the layer. 1 Quote Link to comment
MullinRJ Posted December 13, 2022 Share Posted December 13, 2022 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 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.