Create UI.Application Object
Entry point
The Connector program requires an entry point from where it can be initialized and launched. The entry point is typically an application class.
Create UI.Application Object in the Entry Point
Create an object of the UI.Application class by passing a Model implementation and Configuration object.
A Configuration object contains details like the ConnectorLatestVersionInfoCallback and FeedBackURL. It also allows you to specify LogLevel, such as, Debug, Info, Error, and so on.
For constructing a Model class, pass an IClient implementation that takes in an SDKOptions object.
SDKOptions wraps up configuration details like Client ID, Client Secret, Auth Callback, and Application root path.
//Initialize SDKOptionsDefaultSetup
string ApplicationName = "Your Application Name";
string AuthClientID = "Your App Client id";
string AuthClientSecret = "Your App Client Secret";
string AuthCallBack = "Your App CallBack URL";
SDKOptionsDefaultSetup SdkOptionsDefaultSetup = new SDKOptionsDefaultSetup()
{
ClientId = AuthClientID,
ClientSecret = AuthClientSecret,
CallBack = AuthCallBack,
ConnectorName = "Revit-Connector",
ConnectorVersion = "1.0.0",
HostApplicationName = "Revit",
HostApplicationVersion = "2023.0.1"
};
//Create Client object
var Sdk = new Client(SdkOptionsDefaultSetup);
//Create Model object
DummyModel DummyModel = new DummyModel(Sdk);
//Create a UI configuration object
Autodesk.DataExchange.UI.Configuration UiConfiguration = new Autodesk.DataExchange.UI.Configuration();
var Application = new Autodesk.DataExchange.UI.Application(DummyModel, UiConfiguration);
//Display the Connector SDK UI
Application.Show();
Show More