Jump to content
arunkumarunicorn

Autocad layer automation through external applicaiton - need guidances

Recommended Posts

arunkumarunicorn

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.

Share this post


Link to post
Share on other sites
BIGAL

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*

Share this post


Link to post
Share on other sites
Aftertouch

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

Share this post


Link to post
Share on other sites
arunkumarunicorn

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.

Share this post


Link to post
Share on other sites
maratovich

arunkumarunicorn

Use this :

lay.jpg

Share this post


Link to post
Share on other sites
arunkumarunicorn

open?id=1XK7niatNfJG-LA_YMnrSaZ7lqfQLH_1M

 

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.

Share this post


Link to post
Share on other sites
arunkumarunicorn

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.

ref.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×