添加项目文件。

This commit is contained in:
GG Z
2026-02-28 21:01:57 +08:00
parent 9fe4e5a9aa
commit 7a229067cc
175 changed files with 18060 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
using System;
using System.Windows;
using Bentley.DgnPlatformNET;
using Bentley.MstnPlatformNET;
namespace MSDevTool.Views
{
/// <summary>
/// SelectByElementId.xaml 的交互逻辑
/// </summary>
public partial class SelectByElementId : Window
{
public SelectByElementId()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var dgnModel = Session.Instance.GetActiveDgnModel();
var splitStrs = TbElementId.Text.Split(',', ' ', '', ';', '');
if (splitStrs.Length == 0)
{
return;
}
//ElementAgenda agenda = new ElementAgenda();//声明元素容器
//agenda.Empty(true);
SelectionSetManager.EmptyAll();
foreach (var item in splitStrs)
{
if (string.IsNullOrEmpty(item))
{
continue;
}
try
{
var elementId = long.Parse(item);
var element = dgnModel.FindElementById(new ElementId(ref elementId));
//if (element != null)
//{
// agenda.Insert(element, true);//将元素插入容器
//}
SelectionSetManager.AddElement(element, dgnModel);//将元素容器添加到选择集
}
catch (Exception)
{
}
}
//SelectionSetManager.BuildAgenda(ref agenda);//从当前选择集中获得元素
}
}
}