LISP code to prevent any layers from being added to a DWG file

LISP code to prevent any layers from being added to a DWG file

Anonymous
Not applicable
2,299 Views
23 Replies
Message 1 of 24

LISP code to prevent any layers from being added to a DWG file

Anonymous
Not applicable

Hello,

I am trying to set up a 'standard template' with all the layers, LW, LType, colors predefined for my company.

My end goal is to have all the drawings created using only the layers from the template.

The issue is, if anyone tries to copy and paste an object (or anything for that matter) from an old file, it brings the layers along with it. 

Does anyone know a way that can prevent any additional layers from being added to my drawing, using LISP Code.

Maybe a dialog box can appear while pasting an object (with different layers), which will ask the user to reassign all layers from the selected object to any of the existing ones in the file.

Doing so, will ensure that no additional layers other than the predefined ones are populated in the drawings, making it more streamlined.

 

Any ideas would be greatly appreciated.

Thanks!

0 Likes
Accepted solutions (1)
2,300 Views
23 Replies
Replies (23)
Message 21 of 24

hak_vz
Advisor
Advisor

So we have to figure out what to do with dynamic blocks

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 22 of 24

Anonymous
Not applicable
Exactly, If we can somehow get the dynamic blocks to be assigned to 0
layer, we can have your .lsp file loaded on to the file where those blocks
are being copied to and it will all be assigned to a 'Wrong_Layer'. after
that the user can reassign the blocks into any of the standard layers.

Also, if there's a way to get those blocks directly to the 'wrong layer'
and prevent any additional / unwanted layers to be added to the drawing,
without running the 'BLKTO0' function, it would be a cherry on top. Just
Saying 😛
0 Likes
Message 23 of 24

hak_vz
Advisor
Advisor

I'll try to figure out something tomorrow or in next few days. 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 24 of 24

Anonymous
Not applicable
I will try and look into it as well. I will post it here if I get hold of a
thread.
Thanks!
0 Likes