PeterPan9720 Posted May 29, 2010 Share Posted May 29, 2010 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 Quote Link to comment Share on other sites More sharing options...
PeterPan9720 Posted May 29, 2010 Author Share Posted May 29, 2010 Hi to everybodyI'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 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.