I want to get the name of my .NET task ID using C#. It's a static method...
AddIn.GetMdlTaskID (addInAttribute);
But what is the correct addInAttribute?
I'm looking for the .NET equivalent of the MicroStationAPI mdlSystem_getCurrTaskID ().
Hi Jon,
I don't know your code, but you should acess AddIn methods through reference obtained in your addin constructor.
If I use ManagedToolsExample, I guess you can use this code (not tested ;-):
string mdlTaskId = ManagedToolsExample.Instance().MdlTaskId;
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Unknown said:string mdlTaskId = ManagedToolsExample.Instance().MdlTaskId;
string
mdlTaskId = ManagedToolsExample.Instance().MdlTaskId;
Almost! It's the following, where Program is the class that inherits from Bentley.MstnPlatformNET.AddIn...
String mdlTaskId = Program.Addin.MdlTaskId;
Regards, Jon Summers LA Solutions
Glad to see you were able to get the Addin MdlTaskId string property name needed.
In case you would like a little more context (as originally asked above) on the AddInAttribute class.
In the devshell type: sdkdocs. In MSTNPlatformNET.CHM you will see: Bentley.MstnPlatformNET AddInAttribute class being derived from System.Attribute. This allows developers the ability to provide Addins some additional context (decoration - if you will) to the underlying MDL task management system allowing you to override, provide, or get:
ApplicationType (e.g. User, DesignApp, Required, Initapp, etc.) MdlTaskID (e.g. can be used to provide a "MDL task name" different than your Addin Class name) Password (Bentley Passcode attribute string) TypeId (internal system id)
HTH,Bob