【问题标题】:How to get elements from links in Revit using macros with C#?如何使用 C# 中的宏从 Revit 中的链接中获取元素?
【发布时间】:2020-04-18 15:15:38
【问题描述】:

如何使用 C# 语言中的宏从链接模型列表中获取某个类别的元素到我的项目中?我应用了 FilteredElementCollector 并获取了链接,但是我无法让 GetLinkedDocument 对其进行迭代并获取我想要获取的元素。 希望我的问题很清楚。

//Get Document:
Document doc = this.Document;

//Get links:
FilteredElementCollector links = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_RvtLinks);

//Get elements:
string names = "";
foreach (Element e in links) 
{
    FilteredElementCollector coll = new FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_PlumbingFixtures);
    names += coll + "\n" + "\n";
}

//Mostrar resultado:

TaskDialog.Show("Document", "Document Name " + "\n" + "\n" + names);

【问题讨论】:

    标签: c# macros revit


    【解决方案1】:

    这是对accessing lined element 的讨论,其中包含一些指向进一步相关讨论的指针。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-27
      • 2019-01-08
      • 1970-01-01
      • 2013-04-19
      • 1970-01-01
      • 2019-03-29
      相关资源
      最近更新 更多