Skip to content

Commit

Permalink
Merge pull request #919 from mcneel/1.14
Browse files Browse the repository at this point in the history
1.14
  • Loading branch information
kike-garbo authored May 19, 2023
2 parents 9b4c50b + 22c0a2d commit e4ea8a4
Show file tree
Hide file tree
Showing 15 changed files with 343 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ public QueryAreas() : base
),
new ParamDefinition
(
new Parameters.Element()
new Parameters.AreaScheme()
{
Name = "Area Scheme",
NickName = "AS",
Description = "Only areas on a specific Area Scheme.",
Optional = true
}, ParamRelevance.Secondary
}, ParamRelevance.Primary
),
new ParamDefinition
(
Expand Down Expand Up @@ -340,7 +340,7 @@ public class QueryAreaSchemes : ElementCollectorComponent
public override GH_Exposure Exposure => GH_Exposure.secondary;

static readonly ARDB.ElementFilter elementFilter = CompoundElementFilter.ElementClassFilter(typeof(ARDB.AreaScheme));
protected override ARDB.ElementFilter ElementFilter => CompoundElementFilter.ElementClassFilter(typeof(ARDB.AreaScheme));
protected override ARDB.ElementFilter ElementFilter => elementFilter;

public QueryAreaSchemes() : base
(
Expand Down Expand Up @@ -392,11 +392,12 @@ public QueryAreaSchemes() : base
{
new ParamDefinition
(
new Parameters.Element()
new Parameters.AreaScheme()
{
Name = "Area Schemes",
NickName = "AS",
Description = "Area Schemes list",
Access = GH_ParamAccess.list
}
)
};
Expand Down
3 changes: 2 additions & 1 deletion src/RhinoInside.Revit.GH/Parameters/BasePoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using System.Windows.Forms;
using Grasshopper.GUI;
using Grasshopper.Kernel;
using RhinoInside.Revit.External.DB.Extensions;
using ARDB = Autodesk.Revit.DB;

namespace RhinoInside.Revit.GH.Parameters
{
using External.DB.Extensions;

public class BasePoint : GraphicalElement<Types.IGH_BasePoint, ARDB.Element>
{
public override GH_Exposure Exposure => GH_Exposure.senary | GH_Exposure.obscure;
Expand Down
139 changes: 0 additions & 139 deletions src/RhinoInside.Revit.GH/Parameters/SpatialElement.cs

This file was deleted.

43 changes: 43 additions & 0 deletions src/RhinoInside.Revit.GH/Parameters/Topology/AreaElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Grasshopper.Kernel;
using ARDB = Autodesk.Revit.DB;
using ARUI = Autodesk.Revit.UI;

namespace RhinoInside.Revit.GH.Parameters
{
[ComponentVersion(introduced: "1.7")]
public class AreaElement : GraphicalElement<Types.AreaElement, ARDB.Area>
{
public override GH_Exposure Exposure => GH_Exposure.quinary | GH_Exposure.obscure;
public override Guid ComponentGuid => new Guid("66AAAE96-BA85-4DC7-A188-AC213FAD3176");

public AreaElement() : base
(
name: "Area",
nickname: "Area",
description: "Contains a collection of Revit area elements",
category: "Params",
subcategory: "Revit Elements"
)
{ }

#region UI
protected override IEnumerable<string> ConvertsTo => base.ConvertsTo.Append("Surface");

protected override void Menu_AppendPromptNew(ToolStripDropDown menu)
{
var AreaId = ARUI.RevitCommandId.LookupPostableCommandId(ARUI.PostableCommand.Area);
Menu_AppendItem
(
menu, $"Set new {TypeName}",
Menu_PromptNew(AreaId),
Revit.ActiveUIApplication.CanPostCommand(AreaId),
false
);
}
#endregion
}
}
23 changes: 23 additions & 0 deletions src/RhinoInside.Revit.GH/Parameters/Topology/AreaScheme.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using Grasshopper.Kernel;
using ARDB = Autodesk.Revit.DB;

namespace RhinoInside.Revit.GH.Parameters
{
[ComponentVersion(introduced: "1.14")]
public class AreaScheme : Element<Types.AreaScheme, ARDB.AreaScheme>
{
public override GH_Exposure Exposure => GH_Exposure.quinary | GH_Exposure.obscure;
public override Guid ComponentGuid => new Guid("B042539F-21FB-4BB3-BCA8-F93708CD140E");

public AreaScheme() : base
(
name: "Area Scheme",
nickname: "A-Scheme",
description: "Contains a collection of Revit area scheme elements",
category: "Params",
subcategory: "Revit Elements"
)
{ }
}
}
46 changes: 46 additions & 0 deletions src/RhinoInside.Revit.GH/Parameters/Topology/RoomElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Grasshopper.Kernel;
using ARDB = Autodesk.Revit.DB;
using ARUI = Autodesk.Revit.UI;

namespace RhinoInside.Revit.GH.Parameters
{
[ComponentVersion(introduced: "1.7")]
public class RoomElement : GraphicalElement<Types.RoomElement, ARDB.Architecture.Room>
{
public override GH_Exposure Exposure => GH_Exposure.quinary | GH_Exposure.obscure;
public override Guid ComponentGuid => new Guid("1E6825B6-4A7A-44EA-BC70-A9A110963E17");

public RoomElement() : base
(
name: "Room",
nickname: "Room",
description: "Contains a collection of Revit room elements",
category: "Params",
subcategory: "Revit Elements"
)
{ }

#region UI
protected override IEnumerable<string> ConvertsTo => base.ConvertsTo.Concat
(
new string[] { "Surface", "Brep" }
);

protected override void Menu_AppendPromptNew(ToolStripDropDown menu)
{
var RoomId = ARUI.RevitCommandId.LookupPostableCommandId(ARUI.PostableCommand.Room);
Menu_AppendItem
(
menu, $"Set new {TypeName}",
Menu_PromptNew(RoomId),
Revit.ActiveUIApplication.CanPostCommand(RoomId),
false
);
}
#endregion
}
}
46 changes: 46 additions & 0 deletions src/RhinoInside.Revit.GH/Parameters/Topology/SpaceElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Grasshopper.Kernel;
using ARDB = Autodesk.Revit.DB;
using ARUI = Autodesk.Revit.UI;

namespace RhinoInside.Revit.GH.Parameters
{
[ComponentVersion(introduced: "1.7")]
public class SpaceElement : GraphicalElement<Types.SpaceElement, ARDB.Mechanical.Space>
{
public override GH_Exposure Exposure => GH_Exposure.quinary | GH_Exposure.obscure;
public override Guid ComponentGuid => new Guid("30473B1D-6226-45CE-90A7-5F8E1E1DCBE3");

public SpaceElement() : base
(
name: "Space",
nickname: "Space",
description: "Contains a collection of Revit space elements",
category: "Params",
subcategory: "Revit Elements"
)
{ }

#region UI
protected override IEnumerable<string> ConvertsTo => base.ConvertsTo.Concat
(
new string[] { "Surface", "Brep" }
);

protected override void Menu_AppendPromptNew(ToolStripDropDown menu)
{
var SpaceId = ARUI.RevitCommandId.LookupPostableCommandId(ARUI.PostableCommand.Space);
Menu_AppendItem
(
menu, $"Set new {TypeName}",
Menu_PromptNew(SpaceId),
Revit.ActiveUIApplication.CanPostCommand(SpaceId),
false
);
}
#endregion
}
}
32 changes: 32 additions & 0 deletions src/RhinoInside.Revit.GH/Parameters/Topology/SpatialElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Grasshopper.Kernel;
using ARDB = Autodesk.Revit.DB;

namespace RhinoInside.Revit.GH.Parameters
{
public class SpatialElement : GraphicalElement<Types.SpatialElement, ARDB.SpatialElement>
{
public override GH_Exposure Exposure => GH_Exposure.quinary | GH_Exposure.hidden;
public override Guid ComponentGuid => new Guid("8774ACF3-7B77-474F-B12B-03D4CBBC3C15");
protected override string IconTag => string.Empty;

public SpatialElement() : base
(
name: "Spatial Element",
nickname: "Spatial Element",
description: "Contains a collection of Revit spatial elements",
category: "Params",
subcategory: "Revit Elements"
)
{ }

#region UI
protected override IEnumerable<string> ConvertsTo => base.ConvertsTo.Concat
(
new string[] { "Surface" }
);
#endregion
}
}
Loading

0 comments on commit e4ea8a4

Please sign in to comment.