样式demo
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Architecture;
|
||||
using ShrlAlgoToolkit.Core.Assists;
|
||||
|
||||
namespace ShrlAlgoToolkit.Revit.Assists;
|
||||
namespace ShrlAlgoToolkit.Revit.Extensions;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -224,13 +225,12 @@ public static class RoomExtensions
|
||||
material == null
|
||||
? new SolidOptions(ElementId.InvalidElementId, ElementId.InvalidElementId)
|
||||
: new SolidOptions(material.Id, ElementId.InvalidElementId);
|
||||
options = new SolidOptions(material.Id, ElementId.InvalidElementId);
|
||||
var solid = GeometryCreationUtilities.CreateExtrusionGeometry(curveLoops, XYZ.BasisZ, height);
|
||||
var solid = GeometryCreationUtilities.CreateExtrusionGeometry(curveLoops, XYZ.BasisZ, height, options);
|
||||
|
||||
var directShape = doc.CreateDirectShapeInstance(
|
||||
"房间实体",
|
||||
BuiltInCategory.OST_GenericModel,
|
||||
new List<GeometryObject> { solid });
|
||||
[solid]);
|
||||
directShape.get_Parameter(BuiltInParameter.DOOR_NUMBER).Set(room.Name);
|
||||
//ds.SetName(room.Name);
|
||||
//var option = ds.GetOptions();
|
||||
@@ -241,11 +241,7 @@ public static class RoomExtensions
|
||||
var elements = new FilteredElementCollector(doc);
|
||||
var solidFillPattern = elements.OfClass(typeof(FillPatternElement)).Cast<FillPatternElement>().First(a => a.GetFillPattern().IsSolidFill);
|
||||
|
||||
var random = new Random(DateTime.Now.Millisecond);
|
||||
var r = Convert.ToByte(random.Next(0, 255));
|
||||
var g = Convert.ToByte(random.Next(0, 255));
|
||||
var b = Convert.ToByte(random.Next(0, 255));
|
||||
var color = new Color(r, g, b);
|
||||
var color = ColorAssist.GetDistinctColorById(directShape.Id);
|
||||
var ogs = new OverrideGraphicSettings();
|
||||
ogs.SetProjectionLineColor(color);
|
||||
#if REVIT2018
|
||||
|
||||
Reference in New Issue
Block a user