大量更新
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
|
||||
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
using Autodesk.Revit.UI;
|
||||
|
||||
using adWin = Autodesk.Windows;
|
||||
|
||||
namespace ShrlAlgoToolkit.Revit.Assists
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user