Skip to content

Commit

Permalink
Merge pull request #1182 from mcneel/1.24
Browse files Browse the repository at this point in the history
1.24
  • Loading branch information
kike-garbo authored Sep 8, 2024
2 parents 8ff4bd4 + 9c019fb commit 39ee474
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 17 deletions.
6 changes: 6 additions & 0 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ group: Deployment & Configs

### RC

- Fix on 'Host Shape' when input points overlap corners.
- Fixed 'Deconstruct Curtain Grid' when panels are not `FamilyInstance`.
- Fixed `ModelText.Location` property.
- Updated requirements message on Revit 2025.
- Change on Bake. Now shade-color is applied to the geometry directly.
- Fix on Brep.TryGetExtrusion extension method.

{% endcapture %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ public static IEnumerable<View> GetOpenViews(this Application app)
return uiDocument.GetOpenUIViews().Select(x => x.ViewId).ToList();
});

using (var uiDocument = new Autodesk.Revit.UI.UIDocument(doc))
{
foreach (var viewId in openViewIds)
yield return doc.GetElement(viewId) as View;
}
foreach (var viewId in openViewIds)
yield return doc.GetElement(viewId) as View;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AnalyzeCurtainGrid : Component
public AnalyzeCurtainGrid() : base
(
name: "Deconstruct Curtain Grid",
nickname: "D-CG",
nickname: "D-Grid",
description: "Deconstruct given curtain grid",
category: "Revit",
subCategory: "Architecture"
Expand Down Expand Up @@ -61,7 +61,7 @@ protected override void RegisterOutputParams(GH_OutputParamManager manager)

manager.AddParameter
(
param: new Parameters.GraphicalElement(), // may be Panel or Wall
param: new Parameters.GraphicalElement(), // May be Panel, FamilyInstance or Wall
name: "Panels",
nickname: "P",
description: "Grid panel elements generated by the given Curtain Grid",
Expand Down Expand Up @@ -153,7 +153,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
{
DA.SetDataList("Cells", grid.CurtainCells);
DA.SetDataList("Mullions", cgrid.GetMullionIds().Select(x => Types.Mullion.FromElementId(grid.Document, x)));
DA.SetDataList("Panels", cgrid.GetPanelIds().Select(x => Types.Panel.FromElementId(grid.Document, x)));
DA.SetDataList("Panels", cgrid.GetPanelIds().Select(x => Types.GeometricElement.FromElementId(grid.Document, x)));

// GetVGridLineIds returns grid lines perpendicular to V
DA.SetDataList("Vertical Lines", grid.VGridLines);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class AnalyzeCurtainGridCell : Component

public AnalyzeCurtainGridCell() : base
(
name: "Curtain Cell Geometry",
nickname: "A-CC",
name: "Curtain Cell Profile",
nickname: "CC-Profile",
description: "Deconstruct given curtain grid cell in to geometry",
category: "Revit",
subCategory: "Architecture"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AnalyzeCurtainGridLine : Component
public AnalyzeCurtainGridLine() : base
(
name: "Deconstruct Curtain Line",
nickname: "D-CL",
nickname: "D-CLine",
description: "Deconstruct given curtain grid line",
category: "Revit",
subCategory: "Architecture"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,12 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
mullionType.get_Parameter(ARDB.BuiltInParameter.RECT_MULLION_THICK) ??
mullionType.get_Parameter(ARDB.BuiltInParameter.CUST_MULLION_THICK) ??
mullionType.get_Parameter(ARDB.BuiltInParameter.TRAP_MULL_WIDTH);
DA.SetData("Thickness", thicknessParam.AsGoo());
if (thicknessParam is object)
{
var thickness = thicknessParam.AsGoo() as GH_Number;
DA.SetData("Thickness", thickness);
DA.SetData("Radius", thickness.Value * 0.5);
}

var depth1Param =
mullionType.get_Parameter(ARDB.BuiltInParameter.RECT_MULLION_WIDTH1) ??
Expand All @@ -215,7 +220,7 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
DA.SetData("Depth 2", depth2Param.AsGoo());

var radiusParam = mullionType.get_Parameter(ARDB.BuiltInParameter.CIRC_MULLION_RADIUS);
if (radiusParam != null)
if (radiusParam is object)
{
var radius = radiusParam.AsGoo() as GH_Number;
DA.SetData("Radius", radius);
Expand Down
6 changes: 3 additions & 3 deletions src/RhinoInside.Revit.GH/Types/HostObjects/CurtainCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class CurtainCell : DocumentObject,
IGH_PreviewData
{
public new ARDB.CurtainCell Value => base.Value as ARDB.CurtainCell;
public Panel Panel { get; private set; }
public GeometricElement Panel { get; private set; } // May be Panel, FamilyInstance or Wall

public CurtainCell() : base() { }
public CurtainCell(Panel panel, ARDB.CurtainCell value) : base(panel.Document, value)
public CurtainCell(GeometricElement panel, ARDB.CurtainCell value) : base(panel.Document, value)
{
Panel = panel;
}
Expand Down Expand Up @@ -107,7 +107,7 @@ public Plane Location
{
get
{
if (Panel is Panel panel)
if (Panel is GeometricElement panel)
{
var location = panel.Location;
location = new Plane(location.Origin, location.XAxis, Vector3d.CrossProduct(location.XAxis, location.YAxis));
Expand Down
2 changes: 1 addition & 1 deletion src/RhinoInside.Revit.GH/Types/HostObjects/CurtainGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public Mesh Mesh

public IEnumerable<CurtainCell> CurtainCells => Value is ARDB.CurtainGrid grid ?
grid.GetCurtainCells().Zip(grid.GetPanelIds(), (Cell, PanelId) => (Cell, PanelId)).
Select(x => new CurtainCell(Panel.FromElementId(Document, x.PanelId) as Panel, x.Cell)) :
Select(x => new CurtainCell(GeometricElement.FromElementId(Document, x.PanelId) as GeometricElement, x.Cell)) :
default;
#endregion

Expand Down
1 change: 1 addition & 0 deletions src/RhinoInside.Revit.GH/Types/HostObjects/Mullion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace RhinoInside.Revit.GH.Types
public class MullionPosition : ElementType
{
protected override Type ValueType => typeof(ARDB_MullionPosition);
public override bool IsValid => base.IsValid || (ReferenceDocument is object && Id.IsValid() && Enum.IsDefined(typeof(External.DB.BuiltInMullionPosition), Id.ToValue()));

public MullionPosition() { }
public MullionPosition(ARDB.Document doc, ARDB.ElementId id) : base(doc, id) { }
Expand Down
2 changes: 2 additions & 0 deletions src/RhinoInside.Revit.GH/Types/ProfileType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static bool IsValidElement(ARDB.Element element)
element.Category?.ToBuiltInCategory() == ARDB.BuiltInCategory.OST_ProfileFamilies;
}

public override bool IsValid => base.IsValid || (ReferenceDocument is object && Id.IsValid() && Enum.IsDefined(typeof(External.DB.BuiltInProfileType), Id.ToValue()));

public ProfileType() { }
public ProfileType(ARDB.Document doc, ARDB.ElementId id) : base(doc, id) { }
public ProfileType(ARDB_ProfileType profile) : base(profile)
Expand Down

0 comments on commit 39ee474

Please sign in to comment.