<?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: Changing Dynamic Block Visibility with a macro in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022318#M30493</link>
    <description>&lt;P&gt;I sure can, Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2019 19:49:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-12T19:49:49Z</dc:date>
    <item>
      <title>Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794485#M30475</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'd like to modify the code below (posted by Allen Johnson on Dynamic Blocks Forum) so that instead of modifying the visibility of "cirtagleader" block, I could modify the visibility of all the blocks in my drawing that the name start with SYM-M.&lt;BR /&gt;
&lt;BR /&gt;
Can any one help?&lt;BR /&gt;
&lt;BR /&gt;
Private Sub ScanBlks()&lt;BR /&gt;
Dim dybprop As Variant, i As Integer&lt;BR /&gt;
Dim bobj As AcadEntity&lt;BR /&gt;
For Each bobj In ThisDrawing.ModelSpace&lt;BR /&gt;
If bobj.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
If bobj.IsDynamicBlock Then&lt;BR /&gt;
If bobj.EffectiveName = "cirtagleader" Then&lt;BR /&gt;
dybprop = bobj.GetDynamicBlockProperties&lt;BR /&gt;
For i = LBound(dybprop) To UBound(dybprop)&lt;BR /&gt;
If dybprop(i).PropertyName = "Visibility" Then&lt;BR /&gt;
dybprop(i).Value = "Leader Off"&lt;BR /&gt;
End If&lt;BR /&gt;
Next i&lt;BR /&gt;
End If&lt;BR /&gt;
End If&lt;BR /&gt;
End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot,&lt;BR /&gt;
&lt;BR /&gt;
Maxime Sanschagrin</description>
      <pubDate>Wed, 18 Oct 2006 03:29:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794485#M30475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-18T03:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794486#M30476</link>
      <description>&lt;MAXIME sanschagrin=""&gt; wrote in message&lt;BR /&gt;
news:5365231@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'd like to modify the code below (posted by Allen Johnson on Dynamic Blocks&lt;BR /&gt;
Forum) so that instead of modifying the visibility of "cirtagleader" block,&lt;BR /&gt;
I could modify the visibility of all the blocks in my drawing that the name&lt;BR /&gt;
start with SYM-M.&lt;BR /&gt;
&lt;BR /&gt;
Can any one help?&lt;BR /&gt;
&lt;BR /&gt;
Private Sub ScanBlks()&lt;BR /&gt;
Dim dybprop As Variant, i As Integer&lt;BR /&gt;
Dim bobj As AcadEntity&lt;BR /&gt;
For Each bobj In ThisDrawing.ModelSpace&lt;BR /&gt;
If bobj.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
If bobj.IsDynamicBlock Then&lt;BR /&gt;
&lt;BR /&gt;
'&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;change here&lt;BR /&gt;
'If bobj.EffectiveName = "cirtagleader" Then&lt;BR /&gt;
If bobj.EffectiveName Like "SYM-M*" Then&lt;BR /&gt;
'&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
dybprop = bobj.GetDynamicBlockProperties&lt;BR /&gt;
For i = LBound(dybprop) To UBound(dybprop)&lt;BR /&gt;
If dybprop(i).PropertyName = "Visibility" Then&lt;BR /&gt;
dybprop(i).Value = "Leader Off"&lt;BR /&gt;
End If&lt;BR /&gt;
Next i&lt;BR /&gt;
End If&lt;BR /&gt;
End If&lt;BR /&gt;
End If&lt;BR /&gt;
Next&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
hth&lt;BR /&gt;
Mark&lt;/MAXIME&gt;</description>
      <pubDate>Wed, 18 Oct 2006 09:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794486#M30476</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-18T09:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794487#M30477</link>
      <description>Bingo!!!&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot MP.&lt;BR /&gt;
&lt;BR /&gt;
Maxime</description>
      <pubDate>Thu, 19 Oct 2006 14:15:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794487#M30477</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-19T14:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794488#M30478</link>
      <description>I would also strongly advise checking that there is a visibility state of "Leader Off"&lt;BR /&gt;
before making the change or else the routine will error out.&lt;BR /&gt;
Phil Custer, P.E.&lt;BR /&gt;
Custer Services, Inc.&lt;BR /&gt;
custer@landfillgas.com&lt;BR /&gt;
&lt;BR /&gt;
On Wed, 18 Oct 2006 09:08:21 +0000, MP &lt;NOSPAM&gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;&lt;MAXIME sanschagrin=""&gt; wrote in message&lt;BR /&gt;
&amp;gt;news:5365231@discussion.autodesk.com...&lt;BR /&gt;
&amp;gt;Hi,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;I'd like to modify the code below (posted by Allen Johnson on Dynamic Blocks&lt;BR /&gt;
&amp;gt;Forum) so that instead of modifying the visibility of "cirtagleader" block,&lt;BR /&gt;
&amp;gt;I could modify the visibility of all the blocks in my drawing that the name&lt;BR /&gt;
&amp;gt;start with SYM-M.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Can any one help?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Private Sub ScanBlks()&lt;BR /&gt;
&amp;gt;Dim dybprop As Variant, i As Integer&lt;BR /&gt;
&amp;gt;Dim bobj As AcadEntity&lt;BR /&gt;
&amp;gt;For Each bobj In ThisDrawing.ModelSpace&lt;BR /&gt;
&amp;gt;If bobj.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
&amp;gt;If bobj.IsDynamicBlock Then&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;'&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;change here&lt;BR /&gt;
&amp;gt;'If bobj.EffectiveName = "cirtagleader" Then&lt;BR /&gt;
&amp;gt;If bobj.EffectiveName Like "SYM-M*" Then&lt;BR /&gt;
&amp;gt;'&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;dybprop = bobj.GetDynamicBlockProperties&lt;BR /&gt;
&amp;gt;For i = LBound(dybprop) To UBound(dybprop)&lt;BR /&gt;
&amp;gt;If dybprop(i).PropertyName = "Visibility" Then&lt;BR /&gt;
&amp;gt;dybprop(i).Value = "Leader Off"&lt;BR /&gt;
&amp;gt;End If&lt;BR /&gt;
&amp;gt;Next i&lt;BR /&gt;
&amp;gt;End If&lt;BR /&gt;
&amp;gt;End If&lt;BR /&gt;
&amp;gt;End If&lt;BR /&gt;
&amp;gt;Next&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;End Sub&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;hth&lt;BR /&gt;
&amp;gt;Mark&lt;/MAXIME&gt;&lt;/NOSPAM&gt;</description>
      <pubDate>Thu, 19 Oct 2006 14:58:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794488#M30478</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-19T14:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794489#M30479</link>
      <description>I don't have any  knowledge of VB. What happens if the "routine will error out"? I tried it and it worked, but not all of my blocks have the visibility "Leader Off". I don't want to mess things up.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
Maxime.</description>
      <pubDate>Thu, 19 Oct 2006 15:03:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794489#M30479</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-19T15:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794490#M30480</link>
      <description>What I was refering to was checking the ".AllowedValues" variant array to insure that your&lt;BR /&gt;
visibility state is there.  It is not good practice to depend on AutoCAD VBA not producing&lt;BR /&gt;
an error in this version (they change the way things work with every version).&lt;BR /&gt;
&lt;BR /&gt;
Base on your previous code it would look like.&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Private Sub ScanBlks()&lt;BR /&gt;
  Dim dybprop As Variant, i As Integer&lt;BR /&gt;
  Dim bobj As AcadEntity&lt;BR /&gt;
  Dim varAllowVis as Variant&lt;BR /&gt;
  For Each bobj In ThisDrawing.ModelSpace&lt;BR /&gt;
    If bobj.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;
      If bobj.IsDynamicBlock Then&lt;BR /&gt;
        If bobj.EffectiveName Like "SYM-M*" Then&lt;BR /&gt;
          dybprop = bobj.GetDynamicBlockProperties&lt;BR /&gt;
          For i = LBound(dybprop) To UBound(dybprop)&lt;BR /&gt;
            If dybprop(i).PropertyName = "Visibility" Then&lt;BR /&gt;
Rem New Code Here&lt;BR /&gt;
              varAllowVis = dybprop(i).AllowedValues&lt;BR /&gt;
              For j = 0 to UBound(varAllowVis)&lt;BR /&gt;
                If varAllowVis(j) = "Leader Off" Then&lt;BR /&gt;
                  dybprop(i).Value = "Leader Off"&lt;BR /&gt;
                  Exit For&lt;BR /&gt;
                End If&lt;BR /&gt;
              Next j&lt;BR /&gt;
Rem End of New Code&lt;BR /&gt;
            End If&lt;BR /&gt;
          Next i&lt;BR /&gt;
        End If&lt;BR /&gt;
      End If&lt;BR /&gt;
    End If&lt;BR /&gt;
  Next&lt;BR /&gt;
End Sub&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Phil Custer, P.E.&lt;BR /&gt;
Custer Services, Inc.&lt;BR /&gt;
custer@landfillgas.com&lt;BR /&gt;
&lt;BR /&gt;
On Thu, 19 Oct 2006 15:03:17 +0000, Maxime Sanschagrin &amp;lt;&amp;gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;I don't have any  knowledge of VB. What happens if the "routine will error out"? I tried it and it worked, but not all of my blocks have the visibility "Leader Off". I don't want to mess things up.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Thanks,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Maxime.</description>
      <pubDate>Thu, 19 Oct 2006 21:04:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794490#M30480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-19T21:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794491#M30481</link>
      <description>Thanks a lot Phil! Really nice of you to help someone like me who doesn't know nothing about VBA. I'll be taking VBA lessons soon and I hope I'll be able to help people instead of "begging" for help ;o)&lt;BR /&gt;
&lt;BR /&gt;
Maxime</description>
      <pubDate>Fri, 20 Oct 2006 12:41:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794491#M30481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-20T12:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794492#M30482</link>
      <description>Trust me I need the help just as much as anyone!&lt;BR /&gt;
&lt;BR /&gt;
On Fri, 20 Oct 2006 12:41:06 +0000, Maxime Sanschagrin &amp;lt;&amp;gt; wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt;Thanks a lot Phil! Really nice of you to help someone like me who doesn't know nothing about VBA. I'll be taking VBA lessons soon and I hope I'll be able to help people instead of "begging" for help ;o)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;Maxime</description>
      <pubDate>Fri, 20 Oct 2006 18:11:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/1794492#M30482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-20T18:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/4839757#M30483</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;im curious as to what i have to change to get it to look in paper space instead of model?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ive tryed changing&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Each bobj In ThisDrawing.ModelSpace&lt;/P&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Each bobj In ThisDrawing.ActiveLayout&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i just get errors. any help would be great thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 03:20:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/4839757#M30483</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-02-26T03:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/5600481#M30484</link>
      <description>&lt;P&gt;Hi, I'm trying to switch off/on the visibility of my block, but I'm trying to do this with a command Button. How do I make this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would &amp;nbsp;like to click in a Check box, activating and deactivating the visibility, of various dynamics blocks. For example 4 dynamic blocks. How can I do it?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Private Sub CommandButton1_Click()&lt;/P&gt;&lt;P&gt;Dim dybprop As Variant&lt;BR /&gt;Dim i As Integer&lt;BR /&gt;Dim bobj As AcadEntity&lt;BR /&gt;For Each bobj In ThisDrawing.ModelSpace&lt;BR /&gt;If bobj.ObjectName = "AcDbBlockReference" Then&lt;BR /&gt;If bobj.IsDynamicBlock Then&lt;BR /&gt;If bobj.EffectiveName = "Luminaria_Dinamica" Then&lt;BR /&gt;dybprop = bobj.GetDynamicBlockProperties&lt;BR /&gt;For i = LBound(dybprop) To UBound(dybprop)&lt;BR /&gt;If dybprop(i).PropertyName = "Visibility" Then&lt;BR /&gt;dybprop(i).Value = "leader off"&lt;BR /&gt;End If&lt;BR /&gt;Next i&lt;BR /&gt;End If&lt;BR /&gt;End If&lt;BR /&gt;End If&lt;BR /&gt;Next&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 21:57:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/5600481#M30484</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-20T21:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/5602739#M30485</link>
      <description>&lt;P&gt;For Each bobj In ThisDrawing.ModelSpace&lt;/P&gt;&lt;P&gt;to&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Each bobj In ThisDrawing.ActiveLayout&lt;STRONG&gt;.block&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Might seem unlogical at first, but the 'block' part of a layout contains all the geometry and is the equivalent of 'ModelSpace'. 'PaperSpace' would work too, but ActiveLayout.block is more universal.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2015 11:39:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/5602739#M30485</guid>
      <dc:creator>kasperwuyts</dc:creator>
      <dc:date>2015-04-22T11:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022019#M30486</link>
      <description>&lt;P&gt;Hello everyone, I am trying to do something very similar to the original macro provided but for some reason it's not working for. I think this might be a simple solution but I just wanted to see if you guys have some input, as i am running out of ideas. Any and all help will be appreciated. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="macro not working.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/676708i497D47033ACA8E81/image-size/large?v=v2&amp;amp;px=999" role="button" title="macro not working.PNG" alt="macro not working.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 17:35:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022019#M30486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T17:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022055#M30487</link>
      <description>&lt;P&gt;You need to tell us more than "Its not working". What errors are you getting? I see you are in break mode. What line is failing to complete? Describe your problem in more detail.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 17:47:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022055#M30487</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-09-12T17:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022137#M30488</link>
      <description>&lt;P&gt;Thank you for replying so quickly! When I try to run it I get the "Run time error '424': Object Required"; Messagebox gives me the option to end or debug, I click end and nothing happens or I click debug and&amp;nbsp; it highlights "For Each bobj In ThisDrawing.ModelSpace". I'm not sure what the problem is because I also have turned on the references to the AutoCAD libraries so I think it should be able to understand the autocad references.&amp;nbsp; I'm not sure what the issue is. I have another code I use (to insert blocks) where the libraries are not needed ( non-binding, i think it's called) and the autocad references are dimmed as objects and such and I'm not sure if maybe I should try to translate this code into that manner. But with this code i am trying to incorporate control over visibility.&amp;nbsp; Please let me know if&lt;/P&gt;&lt;P&gt;I missed anything, thank you!&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ACAD libarary.PNG" style="width: 426px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/676732i2E12AFDA726DBB18/image-size/large?v=v2&amp;amp;px=999" role="button" title="ACAD libarary.PNG" alt="ACAD libarary.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snip.PNG" style="width: 669px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/676733i83B7AF2C05D176AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="snip.PNG" alt="snip.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:23:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022137#M30488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T18:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022156#M30489</link>
      <description>&lt;P&gt;The code you show in your last post doesn't appear to have anything to do with your first post. However, it looks like you are running inside xl. The ThisDrawing object doesn't exist in xl. You need to dim it and then instantiate it via&lt;/P&gt;
&lt;P&gt;Set ThisDrawing = AcadApplication.ActiveDocument&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, when you show code, don't give us a picture of it. Paste the actual code into a code window using the &amp;lt;/&amp;gt; symbol on the reply toolbar.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:34:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022156#M30489</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-09-12T18:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022210#M30490</link>
      <description>&lt;P&gt;Correct, the code in the last picture doesnt have anything to do with this one I just wanted to show you a reference of how I got blocks to be inserted in a different code. Also, you're right, I am doing this via Excel. Now I've dimmed ThisDrawing As AcadDocument and the code doesn't break when I run it anymore, but now nothing is happening, no the dynamic block on AutoCAD is not changing at all. Here's what I have :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Private Sub ScanBlks()
Dim dybprop As Variant, i As Integer
Dim bobj As AcadEntity
Dim ThisDrawing As AcadDocument
Set ThisDrawing = AcadApplication.ActiveDocument
For Each bobj In ThisDrawing.ModelSpace
If bobj.ObjectName = "AcDbBlockReference" Then
If bobj.IsDynamicBlock Then
If bobj.EffectiveName = "FSM4L-ENDCAPS" Then
dybprop = bobj.GetDynamicBlockProperties
For i = LBound(dybprop) To UBound(dybprop)
If dybprop(i).PropertyName = "Visibility" Then
dybprop(i).Value = "FSM4L-TF-ENDCAP"
End If
Next i
End If
End If
End If
Next

End Sub&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 18:56:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022210#M30490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T18:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022224#M30491</link>
      <description>&lt;P&gt;Can you post a dwg with your block in it?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:07:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022224#M30491</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-09-12T19:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022242#M30492</link>
      <description>&lt;P&gt;Yes I can. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:16:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022242#M30492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T19:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022318#M30493</link>
      <description>&lt;P&gt;I sure can, Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 19:49:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022318#M30493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-12T19:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Dynamic Block Visibility with a macro</title>
      <link>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022376#M30494</link>
      <description>&lt;P&gt;I made the following changes in red.&lt;/P&gt;
&lt;PRE&gt;Public Sub ScanBlks()
    Dim dybprop As Variant, i As Integer
    Dim bobj As AcadEntity
    Dim ThisDrawing As AcadDocument
    Set ThisDrawing = AcadApplication.ActiveDocument
    For Each bobj In ThisDrawing.ModelSpace
        If bobj.ObjectName = "AcDbBlockReference" Then
            If bobj.IsDynamicBlock Then
                If bobj.EffectiveName = "FSM4L-ENDCAPS" Then
                    dybprop = bobj.GetDynamicBlockProperties
                    For i = LBound(dybprop) To UBound(dybprop)
                        If dybprop(i).PropertyName = "Visibility&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;" Then
                            dybprop(i).Value = "FSM4L-TF-ENDCAP"
                            &lt;FONT color="#FF0000"&gt;ThisDrawing.Regen acActiveViewport&lt;/FONT&gt;
                        End If
                    Next i
                End If
            End If
        End If
    Next&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 20:19:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/changing-dynamic-block-visibility-with-a-macro/m-p/9022376#M30494</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-09-12T20:19:26Z</dc:date>
    </item>
  </channel>
</rss>

