UIApplication.PostCommand
程序员文章站
2022-06-11 08:07:17
...
UIApplication.PostCommand:将命令发布到Revit消息队列,以便控件从当前API上下文返回时调用。
该API可以调用Revit中的内部命令,使用方法如下
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication uiApp = commandData.Application;
UIDocument uiDoc = uiApp.ActiveUIDocument;
Document doc = uiDoc.Document;
uiApp.PostCommand(RevitCommandId.LookupPostableCommandId(PostableCommand.Door));//此命令是创建门
return Result.Succeeded;
}
其它的命令可以参照RevitAPI,PostableCommand的枚举