<?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: change blockreference visibility using c# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12776666#M3955</link>
    <description>&lt;P&gt;My blockreference is not dynamic, then what to do?&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2024 04:21:17 GMT</pubDate>
    <dc:creator>1930331246064</dc:creator>
    <dc:date>2024-05-16T04:21:17Z</dc:date>
    <item>
      <title>change blockreference visibility using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12775105#M3953</link>
      <description>&lt;P&gt;I have created two visibilities VisibilityState0 and VisibilityState1 for a blockreference, now if i want to change the visibility of that block using c# code, how can i do it if I have a blockreference object?&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 14:38:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12775105#M3953</guid>
      <dc:creator>1930331246064</dc:creator>
      <dc:date>2024-05-15T14:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: change blockreference visibility using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12775256#M3954</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can use this method:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;public static void SetDynamicPropertyValue(BlockReference block, string propName, object value)
{
    if (block.IsDynamicBlock)
    {
        var props = block.DynamicBlockReferencePropertyCollection;
        foreach (DynamicBlockReferenceProperty prop in props)
        {
            if (prop.PropertyName.Equals(propName))
            {
                try
                {
                    prop.Value = value;
                }
                catch (System.Exception ex)
                {
                    var ed = Application.DocumentManager.MdiActiveDocument.Editor;
                    ed.WriteMessage($"\n{ex.Message}");
                }
                break;
            }
        }
    }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 May 2024 15:30:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12775256#M3954</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2024-05-15T15:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: change blockreference visibility using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12776666#M3955</link>
      <description>&lt;P&gt;My blockreference is not dynamic, then what to do?&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 04:21:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12776666#M3955</guid>
      <dc:creator>1930331246064</dc:creator>
      <dc:date>2024-05-16T04:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: change blockreference visibility using c#</title>
      <link>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12776679#M3956</link>
      <description>&lt;P&gt;Visibility states only work with dynamic blocks. Other than attributes, non-dynamic blocks cannot have insertions that have a differing appearance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 04:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/change-blockreference-visibility-using-c/m-p/12776679#M3956</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-05-16T04:30:38Z</dc:date>
    </item>
  </channel>
</rss>

