Jump to content

Autocad layer automation through external applicaiton - need guidances


arunkumarunicorn

Recommended Posts

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.

Link to comment
Share on other sites

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*

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...