小编sha*_*sha的帖子

获取元素类型的名称在 Iron python for Revit 中不起作用

我在 pyRevit 环境中使用 Iron python,我的代码如下:

element_types = \
        DB.FilteredElementCollector(doc)\
          .OfCategory(DB.BuiltInCategory.OST_Walls)\
          .WhereElementIsElementType()\ # getting family types not elements
          .ToElements()

for ele in element_types:
    print(ele.Name)
Run Code Online (Sandbox Code Playgroud)

根据 Revit API 文档,这应该可以工作,并且可能在 C# 中工作。ele.Name既可以作为 setter也可以作为 getter 使用。但是在 Ironpython 上面的代码失败,返回一个AttributeError: Name. 但是当我尝试时ele.Name = "new_family_type_name"它工作正常。

所以我的问题是如何进行ele.Name工作以获取家庭类型名称。

python ironpython revit-api revitpythonshell pyrevit

1
推荐指数
1
解决办法
201
查看次数