예제 #1
0
 public Result OnStartup(UIControlledApplication application)
 {
     CreateRibbonPanel(application);
     ModelessWindowHandle.SetHandler(application.MainWindowHandle);
     ExternalExecutor.CreateExternalEvent();
     return(Result.Succeeded);
 }
예제 #2
0
    /// <summary>
    ///     This is the point where the ball starts rolling.  We'll walk down the object's class hierarchy,
    ///     continually trying to cast it to objects we know about.  NOTE: this is intentionally not Reflection.
    ///     We can do that elsewhere, but here we want to explicitly control how data is formatted and navigated,
    ///     so we will manually walk the entire hierarchy.
    /// </summary>
    /// <param name="obj">Object to collect data for</param>
    public Task Collect(object obj)
    {
        Data.Clear();

        return(obj is null
            ? Task.CompletedTask
            : ExternalExecutor.ExecuteInRevitContextAsync(_ => Collect(Document, this, obj)));
    }
예제 #3
0
        public Result OnStartup(UIControlledApplication application)
        {
            ModelessWindowHandle.RevitMainWindowHandle = application.MainWindowHandle;
            ExternalExecutor.CreateExternalEvent();
            AddMenu(application);
            AddAppDocEvents(application.ControlledApplication);

            return(Result.Succeeded);
        }
예제 #4
0
        /// <summary>
        ///     This is the point where the ball starts rolling.  We'll walk down the object's class hierarchy,
        ///     continually trying to cast it to objects we know about.  NOTE: this is intentionally not Reflection.
        ///     We can do that elsewhere, but here we want to explicitly control how data is formatted and navigated,
        ///     so we will manually walk the entire hierarchy.
        /// </summary>
        /// <param name="obj">Object to collect data for</param>
        public Task Collect(object obj)
        {
            MDataObjs.Clear();

            if (obj == null)
            {
                return(Task.CompletedTask);
            }

            return(ExternalExecutor.ExecuteInRevitContextAsync(app => Collect(app, SourceDocument, this, obj)));
        }