<?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: Dynamic Block Hatch Not Updating to New Contour After Parameter Change in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-hatch-not-updating-to-new-contour-after-parameter/m-p/13793964#M85695</link>
    <description>&lt;P&gt;After extensive research, I was finally able to solve the problem. The magic word is EvaluateHatch.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        /// &amp;lt;summary&amp;gt;
        /// 
        /// Re-evaluates all &amp;lt;see cref="Hatch"/&amp;gt; objects that belong to the block definition
        /// used by the given block reference, and marks the reference graphics as modified (regen).
        /// 
        /// &amp;lt;/summary&amp;gt;
        /// 
        /// &amp;lt;param name="blockRefId"&amp;gt;
        /// 
        /// ObjectId of the &amp;lt;see cref="BlockReference"/&amp;gt; to refresh.
        /// 
        /// &amp;lt;/param&amp;gt;

        public static void 
        ReevaluateHatchesInBlock ( ObjectId blockRefId )
        {
            if ( blockRefId.IsNull || blockRefId.IsErased || !blockRefId.IsValid )
            {
                return;
            }

            var db = blockRefId.Database;

            using ( var tr = db.TransactionManager.StartTransaction() )
            {

                var br = tr.GetObject ( blockRefId, OpenMode.ForRead, false ) as BlockReference;

                if ( br == null || br.IsErased )
                {
                    tr.Abort();

                    return;
                }

                var btr = tr.GetObject(br.BlockTableRecord, OpenMode.ForRead, false) as BlockTableRecord;

                if ( btr != null &amp;amp;&amp;amp; !btr.IsErased )
                {
                    foreach (ObjectId entId in btr)
                    {
                        var hatch = tr.GetObject(entId, OpenMode.ForRead, false) as Hatch;

                        if (hatch != null &amp;amp;&amp;amp; !hatch.IsErased)
                        {

                            // Open in write mode to run EvaluateHatch

                            hatch.UpgradeOpen   ( );
                            hatch.EvaluateHatch ( true );
                        }
                    }
                }

                // Refresh the display of the BlockReference

                br.UpgradeOpen            ( );
                br.RecordGraphicsModified ( true );

             // br.Draw();

                tr.Commit();
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Sep 2025 06:00:22 GMT</pubDate>
    <dc:creator>M_Kocyigit</dc:creator>
    <dc:date>2025-09-03T06:00:22Z</dc:date>
    <item>
      <title>Dynamic Block Hatch Not Updating to New Contour After Parameter Change</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-hatch-not-updating-to-new-contour-after-parameter/m-p/13792729#M85693</link>
      <description>&lt;P&gt;I’m working with AutoCAD 2019 and insert dynamic blocks with visibility parameters via a .NET method, but the hatches do not automatically adjust to the new contour of the cross-section after parameter changes – is there a solution for this?&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-inline" image-alt="Hatch - Problem.JPG" style="width: 631px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1566799i71BB3ACB0C19AECB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Hatch - Problem.JPG" alt="Hatch - Problem.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 06:29:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-hatch-not-updating-to-new-contour-after-parameter/m-p/13792729#M85693</guid>
      <dc:creator>M_Kocyigit</dc:creator>
      <dc:date>2025-09-03T06:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Hatch Not Updating to New Contour After Parameter Change</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-hatch-not-updating-to-new-contour-after-parameter/m-p/13793964#M85695</link>
      <description>&lt;P&gt;After extensive research, I was finally able to solve the problem. The magic word is EvaluateHatch.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        /// &amp;lt;summary&amp;gt;
        /// 
        /// Re-evaluates all &amp;lt;see cref="Hatch"/&amp;gt; objects that belong to the block definition
        /// used by the given block reference, and marks the reference graphics as modified (regen).
        /// 
        /// &amp;lt;/summary&amp;gt;
        /// 
        /// &amp;lt;param name="blockRefId"&amp;gt;
        /// 
        /// ObjectId of the &amp;lt;see cref="BlockReference"/&amp;gt; to refresh.
        /// 
        /// &amp;lt;/param&amp;gt;

        public static void 
        ReevaluateHatchesInBlock ( ObjectId blockRefId )
        {
            if ( blockRefId.IsNull || blockRefId.IsErased || !blockRefId.IsValid )
            {
                return;
            }

            var db = blockRefId.Database;

            using ( var tr = db.TransactionManager.StartTransaction() )
            {

                var br = tr.GetObject ( blockRefId, OpenMode.ForRead, false ) as BlockReference;

                if ( br == null || br.IsErased )
                {
                    tr.Abort();

                    return;
                }

                var btr = tr.GetObject(br.BlockTableRecord, OpenMode.ForRead, false) as BlockTableRecord;

                if ( btr != null &amp;amp;&amp;amp; !btr.IsErased )
                {
                    foreach (ObjectId entId in btr)
                    {
                        var hatch = tr.GetObject(entId, OpenMode.ForRead, false) as Hatch;

                        if (hatch != null &amp;amp;&amp;amp; !hatch.IsErased)
                        {

                            // Open in write mode to run EvaluateHatch

                            hatch.UpgradeOpen   ( );
                            hatch.EvaluateHatch ( true );
                        }
                    }
                }

                // Refresh the display of the BlockReference

                br.UpgradeOpen            ( );
                br.RecordGraphicsModified ( true );

             // br.Draw();

                tr.Commit();
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 06:00:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-hatch-not-updating-to-new-contour-after-parameter/m-p/13793964#M85695</guid>
      <dc:creator>M_Kocyigit</dc:creator>
      <dc:date>2025-09-03T06:00:22Z</dc:date>
    </item>
  </channel>
</rss>

