1 回答
TA贡献1833条经验 获得超4个赞
您可以在pyRevitMEP 源代码中找到示例。我还写了一篇文章来解释如何使用 ISelectionFilter :[Revit] ISelectionFilter example using python。这是一个示例(使用 revitpythonshell 运行):
from Autodesk.Revit.UI.Selection import ISelectionFilter
class CustomISelectionFilter(ISelectionFilter):
def __init__(self, category_name):
self.category_name = category_name
def AllowElement(self, e):
if e.Category.Name == self.category_name:
return True
else:
return False
def AllowReference(self, ref, point):
return true
try:
ductsel = uidoc.Selection.PickObject(ObjectType.Element,
CustomISelectionFilter("Ducts"),
"Select a Duct")
except Exceptions.OperationCanceledException:
TaskDialog.Show("Operation canceled","Canceled by the user")
__window__.Close()
您可以在这里找到另一个在 pyRevit 下运行的示例: [pyRevitMEP] ConnectTo : connect MEP elements
添加回答
举报