<?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 Array Spacing Property in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049603#M86652</link>
    <description>&lt;P&gt;so its not possible to edit the column offset? just want to make sure I'm reading this correctly.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Mar 2026 17:22:19 GMT</pubDate>
    <dc:creator>knewsomeN8P59</dc:creator>
    <dc:date>2026-03-10T17:22:19Z</dc:date>
    <item>
      <title>Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040552#M86614</link>
      <description>&lt;P&gt;Hey guys,&lt;BR /&gt;&lt;BR /&gt;I'm working in a dynamic block I'm controlling with a .NET script. I need to be able to adjust the column offset of my array action using this script. Is there a way to do this outside of the block editor, for instance by linking a user parameter in the quickcalc or something like that? I'm having issues accessing the array action properties with my code. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 16:23:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040552#M86614</guid>
      <dc:creator>knewsomeN8P59</dc:creator>
      <dc:date>2026-03-03T16:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040619#M86615</link>
      <description>&lt;P&gt;Depending on which parameter type the array action is based (i.e.&amp;nbsp; Linear/Polar/XY parameter), the DynamicProperty to be manipulated in the dynamic block reference is the parameter's name (if the parameter is XY, then there are 2 DynamicProperties default to "X Distaince1" and "Y Distance1"). Of course you may rename the parameter to a more meaningful name. To change the value of the parameter (thus the array's row/column count would change accordingly), you simply do:&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;using (var tran = TheDatabase.TransactionManager.StartTransaction())
{
    var blk=(BlockReference)tran.GetObject(theblkreferenceId, OpenMode.ForRead);
    foreach (DynamicBlockReferenceProperty prop in 
        blk.DynamicBlockReferencePropertyCollection)
    {
        if (prop.PropertyName.Equals("TheParameterName"))
        {
            prop.Value=100; // whatever distance it should be
            break; // If there is only one property to change (one dimension array)
        }
    }
    tran.Commit()
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 17:16:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040619#M86615</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2026-03-03T17:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040655#M86616</link>
      <description>&lt;P&gt;Sorry, I already have that functionality working; perhaps I wasn't clear in my description. I have it associated with a linear parameter, and I can edit the parameter so it creates 3 wheels or whatever. I need to be able to edit the spacing of the array. Right now, it is always set at 50", in the Array Action properties for "Column Offset" when you are within the block editor. I need to edit that column offset property, which changes that spacing from 50" to 60" or whatever, depending on user input. Hopefully that illustrates the issue better.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 17:41:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14040655#M86616</guid>
      <dc:creator>knewsomeN8P59</dc:creator>
      <dc:date>2026-03-03T17:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14041069#M86617</link>
      <description>&lt;P&gt;If you post your code then someone might be able to give you some advice on how to get it to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2026 23:25:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14041069#M86617</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2026-03-03T23:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049444#M86649</link>
      <description>&lt;P&gt;here's my code (yes it is written by Claude):&lt;/P&gt;&lt;LI-CODE lang="general"&gt;// ================================================================
//  Set array column offset (spacing between array elements)
// ================================================================
private static void SetArrayColumnOffset(BlockReference blockRef, Transaction tr, 
                                         string paramName, double offset)
{
    try
    {
        var blockDef = (BlockTableRecord)tr.GetObject(blockRef.DynamicBlockTableRecord, OpenMode.ForRead);
        var extDict = blockDef.ExtensionDictionary;

        if (extDict.IsNull) return;

        var extDictObj = (DBDictionary)tr.GetObject(extDict, OpenMode.ForRead);
        if (!extDictObj.Contains("ACAD_ENHANCEDBLOCK")) return;

        var enhancedBlockId = extDictObj.GetAt("ACAD_ENHANCEDBLOCK");
        var enhancedBlock = (DBObject)tr.GetObject(enhancedBlockId, OpenMode.ForRead);

        var enhancedDict = enhancedBlock.ExtensionDictionary;
        if (enhancedDict.IsNull) return;

        var enhancedDictObj = (DBDictionary)tr.GetObject(enhancedDict, OpenMode.ForRead);
        if (!enhancedDictObj.Contains("ACAD_BLOCKACTIONPARAM")) return;

        var blockActionParamId = enhancedDictObj.GetAt("ACAD_BLOCKACTIONPARAM");
        var blockActionParamDict = (DBDictionary)tr.GetObject(blockActionParamId, OpenMode.ForRead);

        foreach (var entry in blockActionParamDict)
        {
            var actionId = entry.Value;
            var action = tr.GetObject(actionId, OpenMode.ForRead) as DBObject;
            
            if (action == null) continue;

            // Try to find matching array action by iterating through properties
            var actionType = action.GetType();
            var nameProperty = actionType.GetProperty("Name", 
                System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Public);
            
            if (nameProperty == null) continue;

            var actionName = nameProperty.GetValue(action) as string;
            if (string.Equals(actionName, paramName, StringComparison.OrdinalIgnoreCase))
            {
                // Found matching action — attempt to set ColumnOffset
                var offsetProperty = actionType.GetProperty("ColumnOffset",
                    System.Reflection.BindingFlags.IgnoreCase | System.Reflection.BindingFlags.Public);
                
                if (offsetProperty != null &amp;amp;&amp;amp; offsetProperty.CanWrite)
                {
                    action.UpgradeOpen();
                    offsetProperty.SetValue(action, offset);
                    return;
                }
            }
        }
    }
    catch
    {
        // Silently fail — column offset modification is not critical
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;and here's how it is called:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;SetArrayColumnOffset(blockRef, tr, "main_axles", ws);
SetArrayColumnOffset(blockRef, tr, "j_axles", wsJ);
SetArrayColumnOffset(blockRef, tr, "st_axles", wsSt);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Since it's written by Claude, I honestly don't know much of how it works. I'm a beginner in C# but don't know anything about integration with AutoCAD.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Here's a screenshot of what I need edited by this code:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-03-10 111559.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1624711i4F52890F9147A19C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-03-10 111559.png" alt="Screenshot 2026-03-10 111559.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Worst case I can just make it a manual edit with instructions for the user, as you are able to just edit it from the properties menu in the screenshot. But obviously if there's a way to do it with code, I'd like to include it in my trailer configurator program.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 15:17:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049444#M86649</guid>
      <dc:creator>knewsomeN8P59</dc:creator>
      <dc:date>2026-03-10T15:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049595#M86651</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It looks like you (as Claude) are confusing block reference (BlockReference) and block definition (BlockTableRecord).&lt;/P&gt;
&lt;P&gt;The column spacing of a dynamic array is defined in the block definition and cannot be set from a block reference and it cannot be edited by code because there's no API to create dynamic blocks.&lt;/P&gt;
&lt;P&gt;Only the 'distance' parameter which the array is linked to is available from the block reference and accessible by code.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 17:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049595#M86651</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2026-03-10T17:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049603#M86652</link>
      <description>&lt;P&gt;so its not possible to edit the column offset? just want to make sure I'm reading this correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 17:22:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049603#M86652</guid>
      <dc:creator>knewsomeN8P59</dc:creator>
      <dc:date>2026-03-10T17:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049639#M86653</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/17971514"&gt;@knewsomeN8P59&lt;/a&gt;&amp;nbsp; a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;so its not possible to edit the column offset? just want to make sure I'm reading this correctly.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, it is not possible to edit the column offset with .NET&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 17:47:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14049639#M86653</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2026-03-10T17:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14067779#M86696</link>
      <description>&lt;P&gt;Is it possible with LISP?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 17:21:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14067779#M86696</guid>
      <dc:creator>knewsomeN8P59</dc:creator>
      <dc:date>2026-03-26T17:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Block Array Spacing Property</title>
      <link>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14068057#M86700</link>
      <description>&lt;P&gt;It's not possible with LISP or .NET. It may be possible using the associative framework. It would involve creating an associative action that modifies the array column or row spacing when a dynamic property of the dynamic block reference changes. The Dynamic Property would effectively specify the row or column spacing. However, this solution is most definitely non-trivial and I've never attempted it. It may also be possible using a dimensional constraint rather than a dynamic property, but that is something that would require some investigation.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2026 20:52:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/dynamic-block-array-spacing-property/m-p/14068057#M86700</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2026-03-26T20:52:13Z</dc:date>
    </item>
  </channel>
</rss>

