arunkumarunicorn Posted December 4, 2017 Share Posted December 4, 2017 Hi, I have a requirement in layer management. There are many layers in a drawing. I need to give some layers as input through some application like excel or anything else. As a result the drawing should be opened with the input layers to be visible and remaining layer in off state or hidden. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 4, 2017 Share Posted December 4, 2017 The easiest way is to open the dwg and set the layers a small delay. You can also set the open which dwg if required. There are a couple of different ways to set the layers use "layer states" or read a text file with the layer settings. You can modify a dwg before opening but that is a bit more difficult. If using excel it can write all the code required as a script file. Else more info is required and a lisp can be provided, there a lot of this type of request. need to know more about the layers in the dwg as an example -layer s 0 off * n on w* Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted December 4, 2017 Share Posted December 4, 2017 You could use a ReadExcel function, Or a 'simple' list with the layers, and process that with a foreach function. Very simple example, no error catching or anytin' (defun C:CADTUTUOR ( / ) (setvar "CLAYER" "0") (setvar "Expert" 1) (command "-layer" "OFF" "*" "") (setq offlayerslist (list "Layer1" "Layer2")) (foreach x offlayerslist (command "-layer" "ON" x "") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
arunkumarunicorn Posted December 4, 2017 Author Share Posted December 4, 2017 Consider the drawing contains 30 layers. I need to open the drawing with a prompt that which are the layers should be shown? I will select 10 layers and others 20 will be hidden. Each time, I should not write a program or layers name. I need to select the layers through a checkbox or some other means. And these combinations will repeatedly change. Quote Link to comment Share on other sites More sharing options...
maratovich Posted December 4, 2017 Share Posted December 4, 2017 arunkumarunicorn Use this : Quote Link to comment Share on other sites More sharing options...
arunkumarunicorn Posted December 5, 2017 Author Share Posted December 5, 2017 Hi, I select the layers ( options & spec in excel ). Each spec is a layer in drawing. After selecting the layer from the excel, a process should initiate from excel to open the autocad drawing. The drawing should open with the checked layers from the excel as visible. Quote Link to comment Share on other sites More sharing options...
arunkumarunicorn Posted December 5, 2017 Author Share Posted December 5, 2017 Hi, I select the layers ( options & spec in excel ). Each spec is a layer in drawing. After selecting the layer from the excel, a process should initiate from excel to open the autocad drawing. The drawing should open with the checked layers from the excel as visible. Quote Link to comment Share on other sites More sharing options...
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.