更新
This commit is contained in:
@@ -210,7 +210,7 @@ public static class RoomExtensions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到房间的三位实体
|
||||
/// 得到房间的三维实体
|
||||
/// </summary>
|
||||
/// <param name="room"></param>
|
||||
/// <param name="curveLoops"></param>
|
||||
@@ -227,13 +227,18 @@ public static class RoomExtensions
|
||||
options = new SolidOptions(material.Id, ElementId.InvalidElementId);
|
||||
var solid = GeometryCreationUtilities.CreateExtrusionGeometry(curveLoops, XYZ.BasisZ, height);
|
||||
|
||||
var ds = DirectShape.CreateElement(doc, new ElementId(BuiltInCategory.OST_GenericModel));
|
||||
ds.SetName(room.Name);
|
||||
var option = ds.GetOptions();
|
||||
option.ReferencingOption = DirectShapeReferencingOption.NotReferenceable;
|
||||
ds.SetOptions(option);
|
||||
ds.AppendShape(new List<GeometryObject> { solid });
|
||||
room.Document.Regenerate();
|
||||
var directShape = doc.CreateDirectShapeInstance(
|
||||
"房间实体",
|
||||
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;
|
||||
//ds.SetOptions(option);
|
||||
//ds.AppendShape(new List<GeometryObject> { solid });
|
||||
//room.Document.Regenerate();
|
||||
var elements = new FilteredElementCollector(doc);
|
||||
var solidFillPattern = elements.OfClass(typeof(FillPatternElement)).Cast<FillPatternElement>().First(a => a.GetFillPattern().IsSolidFill);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user