Jump to content

Shortcut to change layer


PeterPan9720

Recommended Posts

Hi to everybody

I'm working again on my first issue in my post http://www.cadtutor.net/forum/showthread.php?t=48394&goto=newpost

 

Just to test I created a simple form with two command button PIU and MENO (+ & -).

The future scope will be to print the single layer.

 

The scope is to switch a layer off and switch the next one on.

But due to my low experience with VBA in autocad there is some problems.

 

I would like to switch off and on only the layer containing the word "DISEGNO" and of course I would like to avoid to switch off the layer 0 that's the current.

 

 

The main problem consist of the Item(I), which represent the Index of layers object in the drawing, doesn't match with the list that I'm seeing in the layer manager that are ordered by name.

 

Somebody could help me ? I have attached a dvb project.

 

Thank you

2Project.zip

Link to comment
Share on other sites

Hi to everybody

I'm working again on my first issue in my post http://www.cadtutor.net/forum/showthread.php?t=48394&goto=newpost

 

Just to test I created a simple form with two command button PIU and MENO (+ & -).

The future scope will be to print the single layer.

 

The scope is to switch a layer off and switch the next one on.

But due to my low experience with VBA in autocad there is some problems.

 

I would like to switch off and on only the layer containing the word "DISEGNO" and of course I would like to avoid to switch off the layer 0 that's the current.

 

 

The main problem consist of the Item(I), which represent the Index of layers object in the drawing, doesn't match with the list that I'm seeing in the layer manager that are ordered by name.

 

Somebody could help me ? I have attached a dvb project.

 

Thank you

 

After a lot of work, Now I have an array MyNome with the names of layers that I would like to plot, but I have some problems with plot controls.

I have a PC3 files so I don't need to setup page & On.

Somebody could help me ? below the code working fine to set the layer on and off, but some problems to plot with QuietErrorMode.

 

For I = 1 To A - 1

If ThisDrawing.Layers.Item(MyNome(I)).Freeze = True Then

ThisDrawing.Layers.Item(MyNome(I)).Freeze = False

ThisDrawing.Regen acAllViewports

End If

 

'Confirm = ThisDrawing.Plot.PlotToDevice

 

If ThisDrawing.Layers.Item(MyNome(I)).Freeze = False Then

ThisDrawing.Layers.Item(MyNome(I)).Freeze = True

ThisDrawing.Regen acAllViewports

End If

 

 

Next I

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