Sheet Set API - Project Number

Sheet Set API - Project Number

JamieVJohnson2
Collaborator Collaborator
1,273 Views
2 Replies
Message 1 of 3

Sheet Set API - Project Number

JamieVJohnson2
Collaborator
Collaborator

Hello,

 

I am having difficulty understanding the Sheet Set manager API as it pertains to programming in Visual Studio 2019 with .Net 4.7. 

I got the sample (from Object ARX API package) and was able to 'monkey see monkey do', but the API Object browser shows access to a AcSmSheetSetClass that has direct access to Get/Set Project (Name, Number, Phase, etc.)  I am not able to instantiate an instance of that class, only the IAcSmSheetSet interface, which does not have access to the project properties (not even in the custom property bag).

 

Can somebody show me how to get this AcSmSheetSetClass object so I can use its methods?

 

Thank you,

 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Accepted solutions (1)
1,274 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator

I also notice there is an IAcSmSheetSet2 that has the properties, but how to I get an instance of that?

 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 3

moogalm
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

AcSmSheetClass is implementation of two interface IAcSmSheet, IAcSmSheet2, so to get the properties you may need to use both IAcSmSheet and IAcSmSheet2.

 

Example code:

 

    public void DispSheetDetails()
    {
        string dstFile;
        dstFile = @"D:\SSRN_2018_Test\TSheets\CaseTest.dst";
        AcSmSheetSetMgr mgr = new AcSmSheetSetMgr();
        AcSmDatabase db = new AcSmDatabase();
        db = mgr.OpenDatabase(dstFile, false);
        AcSmSheetSet ss = db.GetSheetSet();
        IAcSmEnumComponent EnumSheets = ss.GetSheetEnumerator();
        IAcSmComponent smComponent;
        IAcSmSheet sheet;
        IAcSmSheet2 sheet2;

        
        //  Get the first sheet
        smComponent = EnumSheets.Next();
        while (true)
        {
            if ((smComponent == null))
            {
                break;
            }


            sheet = smComponent as AcSmSheetClass;


            sheet = smComponent as IAcSmSheet;
            if (sheet == null) return;
            //  To access the revision number,
            //  Revision date, Purpose and Category,
            //  cast it as IAcSmSheet2
            sheet2 = smComponent as IAcSmSheet2;
            if (sheet2 != null)
            {
                // Revision Number
                string revNumber;
                revNumber = sheet2.GetRevisionNumber();
                // Revision Date
                string revDate;
                revDate = sheet2.GetRevisionDate();
                // Purpose
                string purpose;
                purpose = sheet2.GetIssuePurpose();
                // Category
                string cat;
                cat = sheet2.GetCategory();
            }

            smComponent = EnumSheets.Next();
        }

        mgr.Close(db);
    }
0 Likes