<?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: Get Active Sheet Set Properties in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814082#M18202</link>
    <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://blog.jtbworld.com/2005/01/sheet-set-manager-api-code-sample-for.html" target="_blank"&gt;https://blog.jtbworld.com/2005/01/sheet-set-manager-api-code-sample-for.html&lt;/A&gt; for how the logic is.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2020 22:36:45 GMT</pubDate>
    <dc:creator>JTBWorld</dc:creator>
    <dc:date>2020-10-20T22:36:45Z</dc:date>
    <item>
      <title>Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814065#M18201</link>
      <description>&lt;P&gt;In a &lt;A href="https://forums.autodesk.com/t5/net/sheet-set-api-project-number/m-p/9010374#M63730" target="_blank" rel="noopener"&gt;similar post&lt;/A&gt;, the sheet set IAcSMComponent&amp;nbsp; was cast to an AcSmSheet to access the sheet set properties GetName() GetNumber() etc. In my case it returns a NullReferenceException. I suspect this is because&amp;nbsp; the component "Deck" is a subset.&lt;/P&gt;&lt;P&gt;How can I get access to the sheets inside of "Deck" to get the sheet set properties?&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="SheetSetSnippet.PNG" style="width: 336px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/833830i4C71927E01D75352/image-size/large?v=v2&amp;amp;px=999" role="button" title="SheetSetSnippet.PNG" alt="SheetSetSnippet.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public void GetSheetSetProperties()
        {
            var sheetSetManager = new AcSmSheetSetMgr();
            var databaseEnum = sheetSetManager.GetDatabaseEnumerator();
            // Get the first database in list.
            AcSmDatabase database = databaseEnum.Next();
            database.LockDb(database);
            // Get the sheet set in the database.
            AcSmSheetSet sheetSet = database.GetSheetSet();       
            var sheetEnum = sheetSet.GetSheetEnumerator();

            // This gets the main component named "Deck" in the example tree.
            var component = sheetEnum.Next();


            #region DoesNotWork
            // Cast component to dummy sheet to get properties.
            var dummySheet = component as AcSmSheet;

            // Creates: System.NullReferenceException: 'Object reference not set to an instance of an object.'
            string ssName = dummySheet.GetName();
            string ssNumber = dummySheet.GetNumber();
            #endregion

            // TODO: Get the actual sheets i.e. the sheets under "Deck"

        }&lt;/LI-CODE&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 22:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814065#M18201</guid>
      <dc:creator>drobertsY4GL3</dc:creator>
      <dc:date>2020-10-20T22:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814082#M18202</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://blog.jtbworld.com/2005/01/sheet-set-manager-api-code-sample-for.html" target="_blank"&gt;https://blog.jtbworld.com/2005/01/sheet-set-manager-api-code-sample-for.html&lt;/A&gt; for how the logic is.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 22:36:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814082#M18202</guid>
      <dc:creator>JTBWorld</dc:creator>
      <dc:date>2020-10-20T22:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814136#M18203</link>
      <description>&lt;P&gt;Thanks Jimmy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at you're example, my suspicion was right. I needed to drill down to the AcSmSubset to get the actual sheet properties. What I was really trying to access however was the sheet set project info and thought perhaps I could use the sheets to do it. Is there another way?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the working code for getting subset sheets:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; public void GetSheetSetProperties()
        {
            var sheetSetManager = new AcSmSheetSetMgr();
            var databaseEnum = sheetSetManager.GetDatabaseEnumerator();
            // Get the first database in list.
            AcSmDatabase database = databaseEnum.Next();
            //database.LockDb(database);
            // Get the sheet set in the database.
            AcSmSheetSet sheetSet = database.GetSheetSet();       
            var sheetEnum = sheetSet.GetSheetEnumerator();
            var sheet = new AcSmSheet();
            string sheetSetName = "";
            string sheetSetNumber = "";
            bool sheetFound = false;

            // Get sheet from component or subcomponents.
            var component = sheetEnum.Next();
            while (component != null &amp;amp;&amp;amp; sheetFound != true)
            {
                if (component.GetTypeName() == "AcSmSheet")
                {
                    sheet = component as AcSmSheet;
                    sheetFound = true;
                }
                
                else if (component.GetTypeName() == "AcSmSubset")
                {
                    var subset = component as AcSmSubset;
                    var subComponent = subset.GetSheetEnumerator().Next();
                    while (subComponent != null &amp;amp;&amp;amp; sheetFound != true)
                    {                  
                            if (subComponent.GetTypeName() == "AcSmSheet")
                            {
                                sheet = subComponent as AcSmSheet;
                                sheetFound = true;                             
                                sheetSetName = sheet.GetName();
                                sheetSetNumber = sheet.GetNumber();
                            }

                        subComponent = subset.GetSheetEnumerator().Next();
                    }
                }

                component = sheetEnum.Next();
            }    
        }&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>Wed, 21 Oct 2020 00:42:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814136#M18203</guid>
      <dc:creator>drobertsY4GL3</dc:creator>
      <dc:date>2020-10-21T00:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814888#M18204</link>
      <description>&lt;P&gt;See&amp;nbsp;&lt;A href="https://blog.jtbworld.com/2006/04/sheet-set-manager-code-snippets.html" target="_blank"&gt;https://blog.jtbworld.com/2006/04/sheet-set-manager-code-snippets.html&lt;/A&gt; and&amp;nbsp;&lt;A href="https://adndevblog.typepad.com/autocad/2013/09/using-sheetset-manager-api-in-vbnet.html" target="_blank"&gt;https://adndevblog.typepad.com/autocad/2013/09/using-sheetset-manager-api-in-vbnet.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 11:26:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9814888#M18204</guid>
      <dc:creator>JTBWorld</dc:creator>
      <dc:date>2020-10-21T11:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815574#M18205</link>
      <description>&lt;P&gt;Thank you for the posts.&lt;/P&gt;&lt;P&gt;They work great for accessing custom properties.&lt;/P&gt;&lt;P&gt;How does one access the "regular" properties? In particular I am after the ones in the Project Control Section i.e. project number, project name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Custom Property snippet:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; string propName = "";
            AcSmCustomPropertyValue propValue;
            
            // Get custom propery enumerator from sheet set.
            var propEnum = sheetSet.GetCustomPropertyBag().GetPropertyEnumerator();
            propEnum.Next(out propName, out propValue);
            while (propName != null)
            {
                propEnum.Next(out propName, out propValue);
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 15:12:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815574#M18205</guid>
      <dc:creator>drobertsY4GL3</dc:creator>
      <dc:date>2020-10-21T15:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815585#M18206</link>
      <description>&lt;P&gt;Look at the documentation here &lt;A href="http://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-56F608AE-CEB3-471E-8A64-8C909B989F24" target="_blank"&gt;http://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-56F608AE-CEB3-471E-8A64-8C909B989F24&lt;/A&gt; and specifically&amp;nbsp;&lt;A href="http://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-D28ACEC0-BA5A-4568-B05F-7B60EBD08AF7" target="_blank"&gt;http://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-D28ACEC0-BA5A-4568-B05F-7B60EBD08AF7&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 15:17:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815585#M18206</guid>
      <dc:creator>JTBWorld</dc:creator>
      <dc:date>2020-10-21T15:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815597#M18207</link>
      <description>&lt;P&gt;Thank you again Jimmy.&lt;/P&gt;&lt;P&gt;You've been extraordinarily patient and of great help!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 15:21:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815597#M18207</guid>
      <dc:creator>drobertsY4GL3</dc:creator>
      <dc:date>2020-10-21T15:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get Active Sheet Set Properties</title>
      <link>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815772#M18208</link>
      <description>&lt;P&gt;The root of the problem I discovered is that the methods I needed are missing.&lt;/P&gt;&lt;P&gt;Please see the breakout post below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/net/missing-acsmsheetset-getprojectname-acsmsheetset/td-p/9815753" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/net/missing-acsmsheetset-getprojectname-acsmsheetset/td-p/9815753&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 16:24:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/get-active-sheet-set-properties/m-p/9815772#M18208</guid>
      <dc:creator>drobertsY4GL3</dc:creator>
      <dc:date>2020-10-21T16:24:59Z</dc:date>
    </item>
  </channel>
</rss>

