大量更新

This commit is contained in:
GG Z
2025-12-23 21:35:54 +08:00
parent cd4733ee01
commit ceccab9abb
211 changed files with 9439 additions and 6578 deletions

View File

@@ -54,7 +54,7 @@ public static class ExtensibleStorageExtensions
throw new ArgumentNullException(nameof(schemaName));
}
SchemaBuilder builder = new(Guid.NewGuid());
SchemaBuilder builder = new(SchemaGuid);
builder.SetReadAccessLevel(accessLevel);
builder.SetWriteAccessLevel(accessLevel);
builder.SetSchemaName(schemaName);
@@ -71,6 +71,34 @@ public static class ExtensibleStorageExtensions
#endif
return builder?.Finish();
}
public static readonly Guid SchemaGuid = new Guid("A519E82B-911C-4CA5-9BC5-ED509B2055D2");
public static Schema GetOrCreateSchema()
{
Schema schema = Schema.Lookup(SchemaGuid);
if (schema == null)
{
try
{
SchemaBuilder schemaBuilder = new SchemaBuilder(SchemaGuid);
schemaBuilder.SetReadAccessLevel(AccessLevel.Application);
schemaBuilder.SetWriteAccessLevel(AccessLevel.Application);
schemaBuilder.SetVendorId("SZMC");
schemaBuilder.SetApplicationGUID(SchemaGuid);
schemaBuilder.SetSchemaName("SignatureStorage");
schemaBuilder.AddMapField("SignatureImages", typeof(int), typeof(string));
schema = schemaBuilder.Finish();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "创建schema错误");
}
}
return schema;
}
/// <summary>
/// 通过字段名称获取Schema

View File

@@ -232,7 +232,6 @@ public static class RoomExtensions
BuiltInCategory.OST_GenericModel,
new List<GeometryObject> { solid });
directShape.get_Parameter(BuiltInParameter.DOOR_NUMBER).Set(room.Name);
var ds = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
//ds.SetName(room.Name);
//var option = ds.GetOptions();
//option.ReferencingOption = DirectShapeReferencingOption.NotReferenceable;
@@ -256,7 +255,7 @@ public static class RoomExtensions
ogs.SetCutFillColor(color);
ogs.SetCutFillPatternId(solidFillPattern.Id);
doc.ActiveView.SetElementOverrides(ds.Id, ogs);
doc.ActiveView.SetElementOverrides(directShape.Id, ogs);
#else
ogs.SetSurfaceBackgroundPatternColor(color);
ogs.SetSurfaceForegroundPatternId(solidFillPattern.Id);
@@ -266,7 +265,7 @@ public static class RoomExtensions
ogs.SetCutForegroundPatternColor(color);
ogs.SetCutForegroundPatternId(solidFillPattern.Id);
ogs.SetSurfaceTransparency(50);
doc.ActiveView.SetElementOverrides(ds.Id, ogs);
doc.ActiveView.SetElementOverrides(directShape.Id, ogs);
#endif
//foreach (Face face in solid.Faces)
//{
@@ -279,6 +278,6 @@ public static class RoomExtensions
// //}
//}
return ds;
return directShape;
}
}