diff --git a/src/CADShared/ExtensionMethod/DBDictionaryEx.cs b/src/CADShared/ExtensionMethod/DBDictionaryEx.cs index 829b1ae9b5751da28ddb9335b6e18a956fe994e4..38c6b973cfc5311654d6e26a85e57b427ade7ae4 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); }