From 045e9decdaee7593189d6e59216b2a9cefe6f385 Mon Sep 17 00:00:00 2001 From: wxynotes Date: Thu, 4 Sep 2025 15:11:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:Env.GetDimblkId()=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=9C=A8=E8=AE=BE=E7=BD=AE"dimblk"=E7=B3=BB=E7=BB=9F=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=97=B6=EF=BC=8C=E8=A6=81=E6=A3=80=E6=9F=A5=E4=B8=80?= =?UTF-8?q?=E4=B8=8BoldDimblk=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA"dimblk"=E9=BB=98=E8=AE=A4=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CADShared/Runtime/Env.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CADShared/Runtime/Env.cs b/src/CADShared/Runtime/Env.cs index 024eb5d..888ee88 100644 --- a/src/CADShared/Runtime/Env.cs +++ b/src/CADShared/Runtime/Env.cs @@ -289,7 +289,8 @@ public static ObjectId GetDimblkId(DimblkType dimblk) var oldDimblk = Acaop.GetSystemVariable("dimblk"); Dimblk = dimblk; var id = HostApplicationServices.WorkingDatabase.Dimblk; - Acaop.SetSystemVariable("dimblk", oldDimblk); + if((string)oldDimblk!="") + Acaop.SetSystemVariable("dimblk", oldDimblk); return id; } -- Gitee From bfba787a7d0f3a93d0d4ce2b1176db79ac2ff308 Mon Sep 17 00:00:00 2001 From: wxynotes <397858859@qq.com> Date: Sun, 28 Sep 2025 15:09:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat(method):=20DBDictionaryEx=E7=9A=84AddG?= =?UTF-8?q?roup=E6=96=B9=E6=B3=95=E5=A2=9E=E5=8A=A0=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E6=9C=89=E9=BB=98=E8=AE=A4=E5=80=BC=E7=9A=84=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=88=E9=9D=9E=E7=A0=B4=E5=9D=8F=E6=80=A7=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CADShared/ExtensionMethod/DBDictionaryEx.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/CADShared/ExtensionMethod/DBDictionaryEx.cs b/src/CADShared/ExtensionMethod/DBDictionaryEx.cs index 829b1ae..1b701fa 100644 --- a/src/CADShared/ExtensionMethod/DBDictionaryEx.cs +++ b/src/CADShared/ExtensionMethod/DBDictionaryEx.cs @@ -303,15 +303,17 @@ public static void SetValue(this DataCell cell, CellType type, object value) /// 字典 /// 组名 /// 实体Id集合 + /// 组内所有图元能否被一起选中 + /// 编组的描述 /// 编组Id - public static ObjectId AddGroup(this DBDictionary dict, string name, ObjectIdCollection ids) + public static ObjectId AddGroup(this DBDictionary dict, string name, ObjectIdCollection ids, bool selectable = true, string description = "") { if (dict.Contains(name)) return ObjectId.Null; using (dict.ForWrite()) { - Group g = new(); + var g = new Group(description,selectable); g.Append(ids); dict.SetAt(name, g); var tr = DBTrans.GetTopTransaction(dict.Database); @@ -326,14 +328,16 @@ public static ObjectId AddGroup(this DBDictionary dict, string name, ObjectIdCol /// 字典 /// 组名 /// 实体Id集合 + /// 组内所有图元能否被一起选中 + /// 编组的描述 /// 编组Id - public static ObjectId AddGroup(this DBDictionary dict, string name, IEnumerable ids) + public static ObjectId AddGroup(this DBDictionary dict, string name, IEnumerable ids, bool selectable = true, string description = "") { if (dict.Contains(name)) return ObjectId.Null; using ObjectIdCollection idc = new(ids.ToArray()); //需要using吗? 暂无测试 - return dict.AddGroup(name, idc); + return dict.AddGroup(name, idc, selectable, description); } -- Gitee From a94930f7557863d61550621162ffe0b918144a84 Mon Sep 17 00:00:00 2001 From: wxynotes <397858859@qq.com> Date: Sun, 28 Sep 2025 16:27:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:Env.GetDimblkId()=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=BD=93=E6=97=A7oldDimblk=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E7=B3=BB=E7=BB=9F=E5=8F=98=E9=87=8F=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E8=AE=BE=E7=BD=AE=E4=B8=BA"."=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CADShared/Runtime/Env.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CADShared/Runtime/Env.cs b/src/CADShared/Runtime/Env.cs index 888ee88..1e89e8b 100644 --- a/src/CADShared/Runtime/Env.cs +++ b/src/CADShared/Runtime/Env.cs @@ -289,8 +289,7 @@ public static ObjectId GetDimblkId(DimblkType dimblk) var oldDimblk = Acaop.GetSystemVariable("dimblk"); Dimblk = dimblk; var id = HostApplicationServices.WorkingDatabase.Dimblk; - if((string)oldDimblk!="") - Acaop.SetSystemVariable("dimblk", oldDimblk); + Acaop.SetSystemVariable("dimblk", oldDimblk.ToString() == "" ? "." : oldDimblk); return id; } -- Gitee From 81df6104588caa842ed13de8d439958faa50814d Mon Sep 17 00:00:00 2001 From: wxynotes Date: Thu, 9 Oct 2025 21:58:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?style:=E4=BF=AE=E6=AD=A3=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/CADShared/ExtensionMethod/DBDictionaryEx.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CADShared/ExtensionMethod/DBDictionaryEx.cs b/src/CADShared/ExtensionMethod/DBDictionaryEx.cs index 1b701fa..38c6b97 100644 --- a/src/CADShared/ExtensionMethod/DBDictionaryEx.cs +++ b/src/CADShared/ExtensionMethod/DBDictionaryEx.cs @@ -313,7 +313,7 @@ public static ObjectId AddGroup(this DBDictionary dict, string name, ObjectIdCol using (dict.ForWrite()) { - var g = new Group(description,selectable); + var g = new Group(description, selectable); g.Append(ids); dict.SetAt(name, g); var tr = DBTrans.GetTopTransaction(dict.Database); -- Gitee