日常更新

This commit is contained in:
ShrlAlgo
2026-01-16 17:07:43 +08:00
parent b611efeed9
commit 3650f8550e
74 changed files with 2040 additions and 2151 deletions

View File

@@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Szmedi.CADkits")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Szmedi.CADkits")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("a8343f78-b04d-4c75-bde3-8133314b5597")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -17,9 +17,8 @@
<TextBlock
Grid.Row="0"
Margin="0,0,0,10"
TextWrapping="Wrap" Text="双击列表项可定位并选中块。使用“手动匹配”按钮可重新指定标高。">
</TextBlock>
Text="双击列表项可定位并选中块。使用“手动匹配”按钮可重新指定标高。"
TextWrapping="Wrap" />
<ListView
x:Name="ReviewListView"
@@ -55,23 +54,25 @@
x:Name="LocateInListButton"
Margin="5"
Click="LocateInListButton_Click"
Content="定位选中" />
Content="定位选中"
ToolTip="选择点的块,快速定位到列表中的位置" />
<Button
x:Name="MatchButton"
Margin="5"
Click="MatchButton_Click"
Content="手动匹配"
FontWeight="Bold" />
FontWeight="Bold"
ToolTip="选中列表中的行,选择文字,手动匹配" />
<Button
x:Name="CleanLinesButton"
Margin="5"
Click="CleanLinesButton_Click"
Content="清理连线" />
<Button
<!--<Button
x:Name="CloseButton"
Margin="5"
Click="CloseButton_Click"
Content="隐藏面板" />
Content="隐藏面板" />-->
</StackPanel>
</Grid>
</UserControl>

View File

@@ -87,9 +87,12 @@ namespace Szmedi.CADkits
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
// 通过控制父面板来隐藏
_parentPalette.Visible = false;
if (_parentPalette.Dock == DockSides.None)
{
// 通过控制父面板来隐藏
_parentPalette.Visible = false;
}
MatchButton.IsEnabled = false;
try
{
@@ -111,8 +114,13 @@ namespace Szmedi.CADkits
}
finally
{
// 操作结束后,重新显示父面板
_parentPalette.Visible = true;
if (_parentPalette.Dock == DockSides.None)
{
// 操作结束后,重新显示父面板
_parentPalette.Visible = true;
}
MatchButton.IsEnabled = true;
}
}
@@ -160,14 +168,18 @@ namespace Szmedi.CADkits
}
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
_parentPalette.Visible = false;
}
//private void CloseButton_Click(object sender, RoutedEventArgs e)
//{
// _parentPalette.Visible = false;
//}
// 辅助方法:缩放到实体
private void ZoomToEntity(ObjectId entId)
{
if (!entId.IsValid)
{
return;
}
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
if (doc == null) return;
Editor ed = doc.Editor;
@@ -241,8 +253,8 @@ namespace Szmedi.CADkits
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
ObjectId targetId = ObjectId.Null;
_isListeningToSelection = false; // 暂时关闭自动监听,避免冲突
LocateInListButton.IsEnabled = false;
try
{
@@ -255,8 +267,16 @@ namespace Szmedi.CADkits
}
else
{
// 2. 如果没有选中,则提示用户去选择
_parentPalette.Visible = false; // 隐藏面板方便用户选择
if (_parentPalette.Dock == DockSides.None)
{
// 2. 如果没有选中,则提示用户去选择
_parentPalette.Visible = false; // 隐藏面板方便用户选择
}
else
{
LocateInListButton.IsEnabled = false;
}
PromptEntityOptions peo = new PromptEntityOptions("\n请在图中选择一个地形点块进行定位: ");
peo.SetRejectMessage("\n选择的不是块参照。");
@@ -279,7 +299,13 @@ namespace Szmedi.CADkits
{
// 4. 无论如何都恢复UI状态
_isListeningToSelection = true; // 重新开启监听
_parentPalette.Visible = true;
if (_parentPalette.Dock == DockSides.None)
{
// 操作结束后,重新显示父面板
_parentPalette.Visible = true;
}
LocateInListButton.IsEnabled = true;
this.Focus();
}
}

View File

@@ -10,7 +10,7 @@ using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using Newtonsoft.Json;
//using Newtonsoft.Json;
namespace BoreholeTool
{
@@ -146,10 +146,12 @@ namespace BoreholeTool
}
// 输出
string json = JsonConvert.SerializeObject(finalLogs, Formatting.Indented);
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "BoreholeHybrid.json");
File.WriteAllText(path, json);
ed.WriteMessage($"\n处理完成共 {finalLogs.Count} 个钻孔。文件: {path}");
#region Json
//string json = JsonConvert.SerializeObject(finalLogs, Formatting.Indented);
//string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "BoreholeHybrid.json");
//File.WriteAllText(path, json);
//ed.WriteMessage($"\n处理完成共 {finalLogs.Count} 个钻孔。文件: {path}");
#endregion
}
// ----------------------------------------------------------------

View File

@@ -7,7 +7,16 @@
<LangVersion>10.0</LangVersion>
<UseWindowsForms>True</UseWindowsForms>
<Configurations>Debug;DefaultBuild;Release</Configurations>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>Szmedi.CADkits</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<Company>Szmedi</Company>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<ProductVersion>$(AssemblyVersion)</ProductVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Data.DataSetExtensions" />
@@ -18,6 +27,8 @@
<PackageReference Include="AutoCAD-2020.Net.Base" PrivateAssets="All" ExcludeAssets="runtime">
<Version>1.0.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>