<?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 How to recycle an 2014 VB.NET? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8743719#M22661</link>
    <description>&lt;P&gt;I need to update an old 2014 VB.net to renumber sheet sets to Autocad 2020.&lt;/P&gt;
&lt;P&gt;I'm using VS 2017 and VS 2019.&lt;/P&gt;
&lt;P&gt;I tried to do changes to the code as was recommended in other posts but I always have errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Original post :&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180" target="_blank"&gt;http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 824px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628320i61E81CDE3BCF5B87/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here my version:&lt;/P&gt;
&lt;PRE&gt;///tlbimp acsmcomponents19.tlb /out:Interop.ACSMCOMPONENTS19Lib.dll  /namespace:AcSm  /machine:x64
///tlbimp acsmcomponents23.tlb /out:Interop.ACSMCOMPONENTS23Lib.dll  /namespace:AcSm  /machine:x64
///"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\TlbImp.exe" "C:\Autodesk\ObjectARX_for_AutoCAD_2020_Win_64_bit\inc-x64\acsmcomponents23.tlb" /out:"C:\Autodesk\ObjectARX_for_AutoCAD_2020_Win_64_bit\inc-x64\Interop.ACSMCOMPONENTS23Lib.dll"  /namespace:AcSm  /machine:x64

/*
 * SheetSetTools. © Andrey Bushman, 2013, original
 * Modified to work with AUTOCAD 2020 x64 Enu
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */
 
using System;
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;
 
[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
 
namespace Bushman.AutoCAD.SheetSetTools {
 
    public class SheetSetCommands : Rtm.IExtensionApplication {
 
        const String ns = "bush"; // namespace
 
        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All() {
            Renumber();
        }
 
        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first() {
            Renumber(true);
        }
 
        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false) {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null) {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null) {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }
 
        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering) {
            Array array = null;
            component.GetDirectlyOwnedObjects(out array);
            if (array != null) {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array) {
                    if (item is Comp.IAcSmSubset) {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet) {
                        Comp.IAcSmSheet sheet = (Comp.IAcSmSheet)item;
 
                        String cur_str_value = sheet.GetNumber();
                        Int32 int_value = 0;
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int_value);
 
                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number)) {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first) {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist) {
                        Comp.IAcSmPersist persist = (Comp.IAcSmPersist)item;
                    }
                    else {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }
 
        #region IExtensionApplication Members
 
        public void Initialize() {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }
 
        public void Terminate() {
            // Empty body.
        }
        #endregion
    }
}
 &lt;/PRE&gt;
&lt;P&gt;So, How can I do it? (If possible, explain with a step to step)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2019 01:11:39 GMT</pubDate>
    <dc:creator>jtm2020hyo</dc:creator>
    <dc:date>2019-04-21T01:11:39Z</dc:date>
    <item>
      <title>How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8743719#M22661</link>
      <description>&lt;P&gt;I need to update an old 2014 VB.net to renumber sheet sets to Autocad 2020.&lt;/P&gt;
&lt;P&gt;I'm using VS 2017 and VS 2019.&lt;/P&gt;
&lt;P&gt;I tried to do changes to the code as was recommended in other posts but I always have errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Original post :&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180" target="_blank"&gt;http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 824px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628320i61E81CDE3BCF5B87/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here my version:&lt;/P&gt;
&lt;PRE&gt;///tlbimp acsmcomponents19.tlb /out:Interop.ACSMCOMPONENTS19Lib.dll  /namespace:AcSm  /machine:x64
///tlbimp acsmcomponents23.tlb /out:Interop.ACSMCOMPONENTS23Lib.dll  /namespace:AcSm  /machine:x64
///"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\TlbImp.exe" "C:\Autodesk\ObjectARX_for_AutoCAD_2020_Win_64_bit\inc-x64\acsmcomponents23.tlb" /out:"C:\Autodesk\ObjectARX_for_AutoCAD_2020_Win_64_bit\inc-x64\Interop.ACSMCOMPONENTS23Lib.dll"  /namespace:AcSm  /machine:x64

/*
 * SheetSetTools. © Andrey Bushman, 2013, original
 * Modified to work with AUTOCAD 2020 x64 Enu
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */
 
using System;
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;
 
[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
 
namespace Bushman.AutoCAD.SheetSetTools {
 
    public class SheetSetCommands : Rtm.IExtensionApplication {
 
        const String ns = "bush"; // namespace
 
        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All() {
            Renumber();
        }
 
        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first() {
            Renumber(true);
        }
 
        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false) {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null) {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null) {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }
 
        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering) {
            Array array = null;
            component.GetDirectlyOwnedObjects(out array);
            if (array != null) {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array) {
                    if (item is Comp.IAcSmSubset) {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet) {
                        Comp.IAcSmSheet sheet = (Comp.IAcSmSheet)item;
 
                        String cur_str_value = sheet.GetNumber();
                        Int32 int_value = 0;
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int_value);
 
                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number)) {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first) {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist) {
                        Comp.IAcSmPersist persist = (Comp.IAcSmPersist)item;
                    }
                    else {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }
 
        #region IExtensionApplication Members
 
        public void Initialize() {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }
 
        public void Terminate() {
            // Empty body.
        }
        #endregion
    }
}
 &lt;/PRE&gt;
&lt;P&gt;So, How can I do it? (If possible, explain with a step to step)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 01:11:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8743719#M22661</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T01:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8743843#M22662</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Multiplying topics does not make it easy to understand what you are trying to do for those who are trying to help you as well as for those who have the same type of request.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;You cannot easily use existing .NET code if you do not know the basics of .NET and the way to use it with AutoCAD (you can start reading &lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-BA686431-C8BF-49F2-946E-9CEB2F7AE4FA" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;In your case:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Start a new class library project in Visual Studio 2017 (or upper)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Target the .NET Framework 4.7&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add accoremgd.dll, acdbmgd.dll and acmgd.dll references from 'ObjectARX 2020\inc' folder &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Set the Copy Local property of these reference to False&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add acsmcomponents23.tlb reference from 'ObjectARX 2020\inc-x64' folder&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Paste the original code in the class crated by Visual Studio&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Replace: 'using Comp = ACSMCOMPONENTS19lib' with 'using Comp = ACSMCOMPONENTS23lib'&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;That's all, the proct would compile without error.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 06:43:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8743843#M22662</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-04-21T06:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744085#M22663</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Multiplying topics does not make it easy to understand what you are trying to do for those who are trying to help you as well as for those who have the same type of request.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;You cannot easily use existing .NET code if you do not know the basics of .NET and the way to use it with AutoCAD (you can start reading &lt;A href="https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-BA686431-C8BF-49F2-946E-9CEB2F7AE4FA" target="_blank" rel="noopener"&gt;this topic&lt;/A&gt;).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;In your case:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Start a new class library project in Visual Studio 2017 (or upper)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Target the .NET Framework 4.7&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add accoremgd.dll, acdbmgd.dll and acmgd.dll references from 'ObjectARX 2020\inc' folder &lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Set the Copy Local property of these reference to False&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add acsmcomponents23.tlb reference from 'ObjectARX 2020\inc-x64' folder&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Paste the original code in the class crated by Visual Studio&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Replace: 'using Comp = ACSMCOMPONENTS19lib' with 'using Comp = ACSMCOMPONENTS23lib'&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;That's all, the proct would compile without error.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;In your case:&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Start a new class library project in Visual Studio 2017 (or upper)&lt;BR /&gt;I used C# Autodesk Wizard&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Target the .NET Framework 4.7&lt;BR /&gt;Automatically was target&amp;nbsp;Target the .NET Framework 4.7.1&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add accoremgd.dll, acdbmgd.dll and acmgd.dll references from 'ObjectARX 2020\inc' folder&lt;BR /&gt;Automatically was added those references for Autodesk Wizard.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Set the Copy Local property of these reference to False&lt;BR /&gt;All references were setting in FALSE&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Add acsmcomponents23.tlb reference from 'ObjectARX 2020\inc-x64' folder&lt;BR /&gt;I need to add AcSmComponents23, according to kdub in this post:&amp;nbsp;&lt;BR /&gt;&lt;A href="http://www.theswamp.org/index.php?topic=55116.msg594173#msg594173" target="_blank"&gt;http://www.theswamp.org/index.php?topic=55116.msg594173#msg594173&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 792px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628392i8D3C8B98585F901B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN class="tlid-translation translation"&gt;Paste the original code in the class created by Visual Studio&lt;BR /&gt;there was 2 created for AUTODESK Wizard with names "plug-in.cs" and "myCommands.cs".I deleted one and pasted my code.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;Replace: 'using Comp = ACSMCOMPONENTS19lib' with 'using Comp = ACSMCOMPONENTS23lib'&lt;BR /&gt;I already replaced inside the code.&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;// (C) Copyright 2019 by  
//
using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

/*
 * SheetSetTools. © Andrey Bushman, 2013
 * AutoCAD 2014 x64 Enu
 * 
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */


using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;

[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]

namespace Bushman.AutoCAD.SheetSetTools
{

    public class SheetSetCommands : Rtm.IExtensionApplication
    {

        const String ns = "bush"; // namespace

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All()
        {
            Renumber();
        }

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first()
        {
            Renumber(true);
        }

        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false)
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null)
            {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null)
                {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }

        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering)
        {
            Array array = null;
            component.GetDirectlyOwnedObjects(out array);
            if (array != null)
            {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array)
                {
                    if (item is Comp.IAcSmSubset)
                    {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet)
                    {
                        Comp.IAcSmSheet sheet = (Comp.IAcSmSheet)item;

                        String cur_str_value = sheet.GetNumber();
                        Int32 int_value = 0;
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int_value);

                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number))
                        {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first)
                        {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist)
                    {
                        Comp.IAcSmPersist persist = (Comp.IAcSmPersist)item;
                    }
                    else
                    {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }

        #region IExtensionApplication Members

        public void Initialize()
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }

        public void Terminate()
        {
            // Empty body.
        }
        #endregion
    }
}

&lt;/PRE&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 14:55:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744085#M22663</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T14:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744086#M22664</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Here 2 versions of the same developer, maybe there is the issue:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="bbc_code"&gt;&lt;A href="http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180" target="_blank"&gt;http://www.theswamp.org/index.php?topic=45672.msg508180#msg508180&lt;/A&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;...and here another version (a 3rd ) of the same code with same commands:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class="bbc_code"&gt;&lt;A href="https://sites.google.com/site/acadhowtodo/net/sheet-set/update-sheets-numbers" target="_blank"&gt;https://sites.google.com/site/acadhowtodo/net/sheet-set/update-sheets-numbers&lt;/A&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;...So, What can I do now?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 14:55:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744086#M22664</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T14:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744161#M22665</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I tried to fix this problem for my self, I compared that 3 versions of the same code and obtain this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*
 * SheetSetTools. © Andrey Bushman, 2013
 * AutoCAD 2014 x64 Enu
 * 
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */

using System;
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;

[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]

namespace Bushman.AutoCAD.SheetSetTools
{

    public class SheetSetCommands : Rtm.IExtensionApplication
    {

        const String ns = "bush"; // namespace

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All()
        {
            Renumber();
        }

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first()
        {
            Renumber(true);
        }

        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false)
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null)
            {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null)
                {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }

        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering)
        {
            Array array = null;
            component.GetDirectlyOwnedObjects(out array);
            if (array != null)
            {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array)
                {
                    if (item is Comp.IAcSmSubset)
                    {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet)
                    {
                        Comp.IAcSmSheet sheet = (Comp.IAcSmSheet)item;

                        String cur_str_value = sheet.GetNumber();
                        Int32 int_value = 0;
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int_value);

                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number))
                        {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first)
                        {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist)
                    {
                        Comp.IAcSmPersist persist = (Comp.IAcSmPersist)item;
                    }
                    else
                    {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }

        #region IExtensionApplication Members

        public void Initialize()
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }

        public void Terminate()
        {
            // Empty body.
        }
        #endregion
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;this code has minimal modifications, but now I have 4 "messages" in VS 2017:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Severity	Code	Description	Project	File	Line	Suppression State
Message	IDE0018	Variable declaration can be inlined	ss-renumber2	C:\Users\JuanJ\source\repos\ss-renumber-solution2\ss-renumber2\myCommands.cs	127	Active
Message	IDE0018	Variable declaration can be inlined	ss-renumber2	C:\Users\JuanJ\source\repos\ss-renumber-solution2\ss-renumber2\myCommands.cs	110	Active
Message	IDE0020	Use pattern matching	ss-renumber2	C:\Users\JuanJ\source\repos\ss-renumber-solution2\ss-renumber2\myCommands.cs	124	Active
Message	IDE0020	Use pattern matching	ss-renumber2	C:\Users\JuanJ\source\repos\ss-renumber-solution2\ss-renumber2\myCommands.cs	144	Active&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;after that VS solved such message automatically, obtaining this code:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*
 * SheetSetTools. © Andrey Bushman, 2013
 * AutoCAD 2014 x64 Enu
 * 
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */

using System;
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;

[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]

namespace Bushman.AutoCAD.SheetSetTools
{

    public class SheetSetCommands : Rtm.IExtensionApplication
    {

        const String ns = "bush"; // namespace

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All()
        {
            Renumber();
        }

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first()
        {
            Renumber(true);
        }

        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false)
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null)
            {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null)
                {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }

        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering)
        {
            component.GetDirectlyOwnedObjects(out Array array);
            if (array != null)
            {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array)
                {
                    if (item is Comp.IAcSmSubset)
                    {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet sheet)
                    {
                        String cur_str_value = sheet.GetNumber();
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int int_value);

                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number))
                        {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first)
                        {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist persist)
                    {
                    }
                    else
                    {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }

        #region IExtensionApplication Members

        public void Initialize()
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }

        public void Terminate()
        {
            // Empty body.
        }
        #endregion
    }
}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;When I tried to "Start Debugging", Just opened Autocad 2020 but typing the commands "SS-RENUMBER-ALL" and "SS-RENUMBER-ALL-BASES-OF-FIRST" do nothing, and does not show such command load...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;...But When I press "BUILD" and use NETLOAD for the ".DLL" file, then load without problems and typing commands I have a response:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628410i1C645906627C8961/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"SS-RENUMBER-ALL" and "SS-RENUMBER-ALL-BASES-OF-FIRST" simply does not works, So, What should I do now?&lt;/SPAN&gt;&lt;/P&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 16:09:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744161#M22665</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744169#M22666</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A leave a link with my project:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;https://send.firefox.com/download/28c7b36ab4b24481/#o45gijGnBHQydo8JsCeENQ
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 16:18:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744169#M22666</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T16:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744176#M22667</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"SS-RENUMBER-ALL" and "SS-RENUMBER-ALL-BASES-OF-FIRST" simply does not works, So, What should I do now?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I really do not know.&lt;/P&gt;
&lt;P&gt;What do you mean with "simply does not work"?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 16:47:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744176#M22667</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-04-21T16:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744190#M22668</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;When I tried to "Start Debugging", Just opened Autocad 2020 but typing the commands "SS-RENUMBER-ALL"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;when autocad starts from vs debug you have to use &lt;STRONG&gt;&lt;U&gt;netload&lt;/U&gt;&lt;/STRONG&gt;.&amp;nbsp; autocad does not know about your program yet&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 16:43:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744190#M22668</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2019-04-21T16:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744283#M22669</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"SS-RENUMBER-ALL" and "SS-RENUMBER-ALL-BASES-OF-FIRST" simply does not works, So, What should I do now?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I really do not know.&lt;/P&gt;
&lt;P&gt;What do you mean with "simply does not work"?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I really do not know.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;1 If possible check my project inside the .zip might be easy solver this problem.&lt;BR /&gt;2 If possible share the solved code with a .zip will be very appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;What do you mean with "simply does not work"?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;3 I mean both commands do nothing, does not renumber some sheet as say their description. So, what it's wrong now?&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 18:34:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744283#M22669</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744296#M22670</link>
      <description>&lt;P&gt;OMG, this works.&amp;nbsp;&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://forums.autodesk.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 941px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628436i691E5D802234ED69/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example using command "SS-renumber-all-bases-of-first"&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="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628438i8D29A5AF8FCAF21A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example using command "SS-renumber-all"&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="image.png" style="width: 803px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/628439i988E50B1C1256161/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PD: autodesk does not let me attach mi .DLL file. so here I leave a LInk, search for "&lt;A href="http://www.theswamp.org/index.php?action=dlattach;topic=55116.0;attach=36388" target="_blank"&gt;ss-renumber2.dll&lt;/A&gt;":&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;A href="http://www.theswamp.org/index.php?topic=55116.new#new" target="_blank"&gt;http://www.theswamp.org/index.php?topic=55116.new#new&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 18:54:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744296#M22670</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T18:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744300#M22671</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;1 If possible check my project inside the .zip might be easy solver this problem.wrong now?&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Insted of a solution that anyone should be able to build from some code, you should provide a file on wich the code "does not work".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;2 If possible share the solved code with a .zip will be very appreciated.&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;if you're looking for an 'out of the box' solution, you should try to contact the author (Andrey Bushman).&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2019 18:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744300#M22671</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2019-04-21T18:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to recycle an 2014 VB.NET?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744326#M22672</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/109424"&gt;@_gile&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;1 If possible check my project inside the .zip might be easy solver this problem.wrong now?&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Insted of a solution that anyone should be able to build from some code, you should provide a file on wich the code "does not work".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3529276"&gt;@jtm2020hyo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;2 If possible share the solved code with a .zip will be very appreciated.&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;if you're looking for an 'out of the box' solution, you should try to contact the author (Andrey Bushman).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;/*
 * SheetSetTools. © Andrey Bushman, 2013
 * AutoCAD 2014 x64 Enu
 * 
 * COMMANDS: 
 * SS-RENUMBER-ALL - Update the numeration for all sheets in the all opened sheet sets: 
 * numbering of each subgroup shall begin with 1.
 * 
 * SS-RENUMBER-ALL-BASES-OF-FIRST - Update the numeration: to continue numbering on the 
 * basis of the first element in the each subset (in the all opened sheet sets).
 * 
 * AutoCAD references:
 * AcCoreMgd.dll
 * AcDbMgd.dll
 * AcMgd.dll
 * Interop.ACSMCOMPONENTS23Lib.dll
 */

using System;
using cad = Autodesk.AutoCAD.ApplicationServices.Application;
using App = Autodesk.AutoCAD.ApplicationServices;
using Db = Autodesk.AutoCAD.DatabaseServices;
using Ed = Autodesk.AutoCAD.EditorInput;
using Rtm = Autodesk.AutoCAD.Runtime;
using Comp = ACSMCOMPONENTS23Lib;

[assembly: Rtm.ExtensionApplication(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]
[assembly: Rtm.CommandClass(typeof(Bushman.AutoCAD.SheetSetTools.SheetSetCommands))]

namespace Bushman.AutoCAD.SheetSetTools
{

    public class SheetSetCommands : Rtm.IExtensionApplication
    {

        const String ns = "bush"; // namespace

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration for all sheets in the all opened sheet sets: numbering of 
        /// each subgroup shall begin with 1.
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all", Rtm.CommandFlags.Modal)]
        public void Renumber_All()
        {
            Renumber();
        }

        /// &amp;lt;summary&amp;gt;
        /// Update the numeration: to continue numbering on the basis of the first element 
        /// in the each subset (in the all opened sheet sets).
        /// &amp;lt;/summary&amp;gt;
        [Rtm.CommandMethod(ns, "ss-renumber-all-bases-of-first", Rtm.CommandFlags.Modal)]
        public void Renumber_all_bases_of_first()
        {
            Renumber(true);
        }

        /// &amp;lt;summary&amp;gt;
        /// To update numbering of all sheets in the all opened sheet sets.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void Renumber(Boolean continue_numbering = false)
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Db.Database db = doc.Database;
            Ed.Editor ed = doc.Editor;
            Comp.AcSmSheetSetMgr mng = new Comp.AcSmSheetSetMgr();
            Comp.IAcSmEnumDatabase enumerator = mng.GetDatabaseEnumerator();
            enumerator.Reset();
            Comp.AcSmDatabase smDb = null;
            while ((smDb = enumerator.Next()) != null)
            {
                smDb.LockDb(db);
                String fname = smDb.GetFileName();
                Comp.AcSmSheetSet sheetset = smDb.GetSheetSet();
                String name = sheetset.GetName();
                String descr = sheetset.GetDesc();
                ed.WriteMessage("\nSheet Set name: {0}\n", name);
                Int32 ren_count = 0; // count of renamed sheets.
                Comp.IAcSmEnumComponent encomp = sheetset.GetSheetEnumerator();
                encomp.Reset();
                Comp.IAcSmComponent component = null;
                while ((component = encomp.Next()) != null)
                {
                    ProcessElement(ed, component, ref ren_count, continue_numbering);
                }
                encomp.Reset();
                smDb.UnlockDb(db, true);
                ed.WriteMessage("Renumbered sheets count: {0}\n", ren_count);
            }
            enumerator.Reset();
        }

        /// &amp;lt;summary&amp;gt;
        ///  Recursive processing of the elements: change the sheet's number.
        /// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="ed"&amp;gt;An Editor for the output.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="component"&amp;gt;Component of Sheet Set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="ren_count"&amp;gt;The count of renumbered sheets in the sheet set.&amp;lt;/param&amp;gt;
        /// &amp;lt;param name="continue_numbering"&amp;gt;True - to continue numbering on the basis 
        /// of the first element in the each subset (in the all opened sheet sets);
        /// False - Numbering of each subgroup shall begin with 1 (in the all opened 
        /// sheet sets).&amp;lt;/param&amp;gt;
        void ProcessElement(Ed.Editor ed, Comp.IAcSmComponent component,
            ref Int32 ren_count, Boolean continue_numbering)
        {
            component.GetDirectlyOwnedObjects(out Array array);
            if (array != null)
            {
                Int32 sheet_number = 1;
                Boolean basis_of_first = continue_numbering;
                foreach (var item in array)
                {
                    if (item is Comp.IAcSmSubset)
                    {
                        ProcessElement(ed, (Comp.IAcSmSubset)item, ref ren_count, continue_numbering);
                    }
                    else if (item is Comp.IAcSmSheet sheet)
                    {
                        String cur_str_value = sheet.GetNumber();
                        Boolean is_int32 = Int32.TryParse(cur_str_value, out int int_value);

                        if (!is_int32 || (!basis_of_first &amp;amp;&amp;amp; int_value != sheet_number))
                        {
                            sheet.SetNumber(sheet_number.ToString());
                            ++ren_count;
                        }
                        else if (basis_of_first)
                        {
                            sheet_number = int_value;
                        }
                        ++sheet_number;
                        basis_of_first = false;
                    }
                    else if (item is Comp.IAcSmPersist persist)
                    {
                    }
                    else
                    {
                        ed.WriteMessage("Unknown object: {0}", item.GetType().ToString());
                    }
                }
            }
        }

        #region IExtensionApplication Members

        public void Initialize()
        {
            App.Document doc = cad.DocumentManager.MdiActiveDocument;
            Ed.Editor ed = doc.Editor;
            ed.WriteMessage("\nSheetSetTools. © Andrey Bushman, 2013\n\n");
        }

        public void Terminate()
        {
            // Empty body.
        }
        #endregion
    }
}&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Apr 2019 19:32:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-recycle-an-2014-vb-net/m-p/8744326#M22672</guid>
      <dc:creator>jtm2020hyo</dc:creator>
      <dc:date>2019-04-21T19:32:30Z</dc:date>
    </item>
  </channel>
</rss>

