在模板计算功能中用到了选择集SelectionFilterElement。记录下使用方法。
- 1、添加操作。摘自sdk
using (Transaction t = new Transaction(doc, "Create SelectionFilterElement"))
{
t.Start();
// Create selection filter and assign ids
SelectionFilterElement filterElement = SelectionFilterElement.Create(doc, setName);
filterElement.SetElementIds(eleIDs);
ElementId filterId = filterElement.Id;
// Add the filter to the view
view.AddFilter(filterId);
doc.Regenerate();
// Use the existing graphics settings, and change the color to Blue
OverrideGraphicSettings overrideSettings = view.GetFilterOverrides(filterId);
overrideSettings.SetProjectionLineColor(new Color(0x00, 0x00, 0xFF));
view.SetFilterOverrides(filterId, overrideSettings);