【问题标题】:read and export schedules multiple revit file using c# api使用 c# api 读取和导出多个 revit 文件
【发布时间】:2019-02-19 15:05:14
【问题描述】:

我在一个文件夹中有 150 个 revit 文件。我想编写 c# 控制台应用程序,为文件夹中的每个 revit 文件导出时间表。

我在论坛中找到了一些示例,但无法使用。

 public void Plot(string[] files)
        {
            ExternalCommandData commandData;
            UIApplication uiApplication = commandData.Application;

            foreach (string file in files)
            {
                Document document = uiApplication.OpenAndActivateDocument(@"C:\solar.rvt").Document;

            }
        }

【问题讨论】:

    标签: c# revit-api revit


    【解决方案1】:

    是的。

    你不能让它像那样工作。

    您不能像那样从外部驱动 Revit。

    不过,您可以使用Idling and External Events for Modeless Access and Driving Revit from Outside

    但是,对于您描述的场景,最简单的解决方案是编写一个简单的外部命令并从 Revit 内部启动该命令以驱动所需的功能。模态的,而不是无模态的。

    实现外部命令很容易,并且在getting started with the Revit API 上的材料开头有完整的介绍。

    此外,您很幸运,因为您描述的功能是由 The Building Coder 在The Schedule API and Access to Schedule Data 中描述的现有示例实现的。

    【讨论】:

      猜你喜欢
      • 2019-10-05
      • 2013-01-07
      • 2021-01-08
      • 1970-01-01
      • 1970-01-01
      • 2012-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多