<?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: Turning Layers on through VBA in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645025#M4334</link>
    <description>&lt;P&gt;The only thing I can think of is that it was a typo. Anyway, glad the second one helped.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jul 2020 17:04:21 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2020-07-20T17:04:21Z</dc:date>
    <item>
      <title>Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9644960#M4327</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have written VBA code in AutoCad that will open a certain drawing for the user, but I want it to turn on certain layers based on user input.&amp;nbsp; Let's say for this example I want to turn on the layer named "Walls".&amp;nbsp; How would I go about this?&amp;nbsp; The layer is off when the document is opened.&amp;nbsp; I'm sure this is a simple couple lines of code but I just can't seem to figure it out.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:31:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9644960#M4327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T16:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645001#M4328</link>
      <description>&lt;P&gt;If you're not concerned about viewport visibility, then its just like below.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;    Dim oLay As AcadLayer
    For Each oLay In ThisDrawing.Layers
        If oLay.Name = "Walls" Then
            oLay.LayerOn = True
        End If
    Next&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:51:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645001#M4328</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2020-07-20T16:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645006#M4329</link>
      <description>&lt;P&gt;Looks like oLay is throwing an error. "Can't find project or library" not sure what is going on there.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 16:55:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645006#M4329</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T16:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645015#M4330</link>
      <description>&lt;P&gt;Are you working in AutoCAD vba? You're not doing this from exel are you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a more efficient version. Although it could throw an error if "Walls" doesn't exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;ThisDrawing.Layers("Walls").LayerOn = True&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:01:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645015#M4330</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2020-07-20T17:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645019#M4331</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have read well, the initial requirement was &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;".....&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;based on user input...."&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;, and question is if would you like to have the same dialog "layer state" windows or a simple user form.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;On the opposite&amp;nbsp;@Anonymous&amp;nbsp;accepted Ed solution so the starting request now falls.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm wrong ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:00:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645019#M4331</guid>
      <dc:creator>grobnik</dc:creator>
      <dc:date>2020-07-20T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645020#M4332</link>
      <description>&lt;P&gt;That did it.&amp;nbsp; I am in AutoCad VBA not excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:01:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645020#M4332</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T17:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645024#M4333</link>
      <description>&lt;P&gt;I had it based on a userform, depending on what the user chooses in a drop box is what layer turns on.&amp;nbsp; I got it figured out now, sorry for marking the wrong solution I meant to just reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:04:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645024#M4333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T17:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Layers on through VBA</title>
      <link>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645025#M4334</link>
      <description>&lt;P&gt;The only thing I can think of is that it was a typo. Anyway, glad the second one helped.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:04:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/turning-layers-on-through-vba/m-p/9645025#M4334</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2020-07-20T17:04:21Z</dc:date>
    </item>
  </channel>
</rss>

