<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Layers in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356514#M42743</link>
    <description>Advice: Don't even think about using the code &lt;BR /&gt;
Joe posted.  It can easily erase all the layers &lt;BR /&gt;
in your drawing.&lt;BR /&gt;
&lt;BR /&gt;
Suppose for example, the user adds one layer and &lt;BR /&gt;
deletes two or more others. In that case the number &lt;BR /&gt;
of layers will never be equal to what it was at the &lt;BR /&gt;
start of the command and so, Joe's code will just &lt;BR /&gt;
start deleting all the layers.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Nate Hunter" &lt;NHUNTER&gt; wrote in message news:4877243@discussion.autodesk.com...&lt;BR /&gt;
I need to be able to create a routine or reactor that will not allow my ADT &lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help &lt;BR /&gt;
would be appreciated.&lt;/NHUNTER&gt;</description>
    <pubDate>Thu, 16 Jun 2005 22:32:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-06-16T22:32:14Z</dc:date>
    <item>
      <title>Layers</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356511#M42740</link>
      <description>I need to be able to create a routine or reactor that will not allow my ADT &lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help &lt;BR /&gt;
would be appreciated.</description>
      <pubDate>Thu, 16 Jun 2005 18:51:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356511#M42740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-16T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Layers</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356512#M42741</link>
      <description>Perhaps something like this would do the trick!&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Dim lngLayers As Long&lt;BR /&gt;
&lt;BR /&gt;
Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)&lt;BR /&gt;
  If UCase(CommandName) = "LAYER" Then lngLayers = ThisDrawing.Layers.Count&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Sub AcadDocument_EndCommand(ByVal CommandName As String)&lt;BR /&gt;
  If UCase(CommandName) = "LAYER" And ThisDrawing.Layers.Count &amp;gt; 1 Then&lt;BR /&gt;
    Do While ThisDrawing.Layers.Count &amp;lt;&amp;gt; lngLayers&lt;BR /&gt;
      ThisDrawing.Layers(ThisDrawing.Layers.Count - 1).Delete&lt;BR /&gt;
    Loop&lt;BR /&gt;
  End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Nate Hunter" &lt;NHUNTER&gt; wrote in message &lt;BR /&gt;
news:4877243@discussion.autodesk.com...&lt;BR /&gt;
I need to be able to create a routine or reactor that will not allow my ADT&lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help&lt;BR /&gt;
would be appreciated.&lt;/NHUNTER&gt;</description>
      <pubDate>Thu, 16 Jun 2005 19:43:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356512#M42741</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-16T19:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Layers</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356513#M42742</link>
      <description>I was acutally ahead of you.  This is exactly what I did.  thanks for the &lt;BR /&gt;
input&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Joe Sutphin" &lt;JOESUTPHIN&gt; wrote in message &lt;BR /&gt;
news:4877347@discussion.autodesk.com...&lt;BR /&gt;
Perhaps something like this would do the trick!&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Dim lngLayers As Long&lt;BR /&gt;
&lt;BR /&gt;
Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)&lt;BR /&gt;
  If UCase(CommandName) = "LAYER" Then lngLayers = ThisDrawing.Layers.Count&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Private Sub AcadDocument_EndCommand(ByVal CommandName As String)&lt;BR /&gt;
  If UCase(CommandName) = "LAYER" And ThisDrawing.Layers.Count &amp;gt; 1 Then&lt;BR /&gt;
    Do While ThisDrawing.Layers.Count &amp;lt;&amp;gt; lngLayers&lt;BR /&gt;
      ThisDrawing.Layers(ThisDrawing.Layers.Count - 1).Delete&lt;BR /&gt;
    Loop&lt;BR /&gt;
  End If&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Nate Hunter" &lt;NHUNTER&gt; wrote in message&lt;BR /&gt;
news:4877243@discussion.autodesk.com...&lt;BR /&gt;
I need to be able to create a routine or reactor that will not allow my ADT&lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help&lt;BR /&gt;
would be appreciated.&lt;/NHUNTER&gt;&lt;/JOESUTPHIN&gt;</description>
      <pubDate>Thu, 16 Jun 2005 20:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356513#M42742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-16T20:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Layers</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356514#M42743</link>
      <description>Advice: Don't even think about using the code &lt;BR /&gt;
Joe posted.  It can easily erase all the layers &lt;BR /&gt;
in your drawing.&lt;BR /&gt;
&lt;BR /&gt;
Suppose for example, the user adds one layer and &lt;BR /&gt;
deletes two or more others. In that case the number &lt;BR /&gt;
of layers will never be equal to what it was at the &lt;BR /&gt;
start of the command and so, Joe's code will just &lt;BR /&gt;
start deleting all the layers.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Nate Hunter" &lt;NHUNTER&gt; wrote in message news:4877243@discussion.autodesk.com...&lt;BR /&gt;
I need to be able to create a routine or reactor that will not allow my ADT &lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help &lt;BR /&gt;
would be appreciated.&lt;/NHUNTER&gt;</description>
      <pubDate>Thu, 16 Jun 2005 22:32:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356514#M42743</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-16T22:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Layers</title>
      <link>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356515#M42744</link>
      <description>Good catch, didn't think of that ... but you're absolutely right.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4877565@discussion.autodesk.com...&lt;BR /&gt;
Advice: Don't even think about using the code&lt;BR /&gt;
Joe posted.  It can easily erase all the layers&lt;BR /&gt;
in your drawing.&lt;BR /&gt;
&lt;BR /&gt;
Suppose for example, the user adds one layer and&lt;BR /&gt;
deletes two or more others. In that case the number&lt;BR /&gt;
of layers will never be equal to what it was at the&lt;BR /&gt;
start of the command and so, Joe's code will just&lt;BR /&gt;
start deleting all the layers.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Nate Hunter" &lt;NHUNTER&gt; wrote in message &lt;BR /&gt;
news:4877243@discussion.autodesk.com...&lt;BR /&gt;
I need to be able to create a routine or reactor that will not allow my ADT&lt;BR /&gt;
2006 users to create or change any layers.  How can this be done.  Any help&lt;BR /&gt;
would be appreciated.&lt;/NHUNTER&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 17 Jun 2005 11:27:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/layers/m-p/1356515#M42744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-17T11:27:49Z</dc:date>
    </item>
  </channel>
</rss>

