[CONNECT .NET] MdlApplicationClass

The MicroStationAPI provides mdlSystem_getMdlAppClass/mdlSystem_setMdlAppClass that inform how the app was loaded (USER, DGNAPP, etc) in one of the MdlApplicationClass enum values.

I can't see a .NET equivalent in the MstnPlatformNET.

Parents
  • Hi Jon Summers,

    this information "might" be passed to an AddIn as shown in the code sample below. It is not well tested and probably not documented, so try it and let us know :-)

    Tom


    namespace Xyz
    {
        [Bentley.MstnPlatformNET.AddIn(MdlTaskID = "xyz")]
        internal sealed class App : Bentley.MstnPlatformNET.AddIn
        {
            private App(System.IntPtr mdlDesc) : base(mdlDesc)
            {}
    
            protected override int Run(string[] commandLine)
            {
                switch (commandLine[1])
                {
                    case "COMMANDREQUESTED":
                        // AddIn loaded by keyin from ribbon
                        break;
                        
                    case "USER":
                        // AddIn loaded from (start script) keyin; "mdl silentload xyz"
                        break;
                        
                    case "FIRSTDGNFILE":
                        // AddIn loaded as MS_DGNAPPS
                        break;
                        
                    default:
                        // there may be other
                        break;
                }
                return 0;
            }
        }
    }

Reply
  • Hi Jon Summers,

    this information "might" be passed to an AddIn as shown in the code sample below. It is not well tested and probably not documented, so try it and let us know :-)

    Tom


    namespace Xyz
    {
        [Bentley.MstnPlatformNET.AddIn(MdlTaskID = "xyz")]
        internal sealed class App : Bentley.MstnPlatformNET.AddIn
        {
            private App(System.IntPtr mdlDesc) : base(mdlDesc)
            {}
    
            protected override int Run(string[] commandLine)
            {
                switch (commandLine[1])
                {
                    case "COMMANDREQUESTED":
                        // AddIn loaded by keyin from ribbon
                        break;
                        
                    case "USER":
                        // AddIn loaded from (start script) keyin; "mdl silentload xyz"
                        break;
                        
                    case "FIRSTDGNFILE":
                        // AddIn loaded as MS_DGNAPPS
                        break;
                        
                    default:
                        // there may be other
                        break;
                }
                return 0;
            }
        }
    }

Children