Пример #1
0
 public void RunTest()
 {
     lock (locker)
     {
         while (actionItor.MoveNext())
         {
             _action = actionItor.Current;
             Autodesk.Windows.ComponentManager.Ribbon.Dispatcher.Invoke(() =>
             {
                 ExternalCommandHelper.executeExternalCommand(ribbonButton.Id);
             });
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 指定一个基于IExternalCommand全名称.执行此命令.
        /// </summary>
        public bool Execute(string className)
        {
            if (!m_CommandIds.ContainsKey(className))
            {
                return(false);
            }

            var commnadId = m_CommandIds[className];

            string text2 = string.Format("CustomCtrl_%{0}%{1}", "ZhongHao.He", commnadId);

            ExternalCommandHelper.executeExternalCommand(text2);

            return(true);
        }
Пример #3
0
 /// <summary>
 /// 指定Revit命令Id,调用内部命令.
 /// </summary>
 public bool Invoke(string cmdId)
 {
     if (ExternalCommandHelper.CanExecute(cmdId))
     {
         ExternalCommandHelper.executeExternalCommand(cmdId);
         return(true);
     }
     else if (CommandHandlerService.canExecute(cmdId))
     {
         CommandHandlerService.invokeCommandHandler(cmdId);
         return(true);
     }
     else
     {
         return(false);
     }
 }