Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.16 #975

Merged
merged 9 commits into from
Jul 29, 2023
34 changes: 23 additions & 11 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ group: Deployment & Configs
- Added 'Component Reference Plane' component.
- Added 'Reference Annotations' component.
- Improved 'Host Shape' performance.
- Now 'Query View Elements' filters out hidden UI categories.
- Now 'Query View Elements' filters out hidden UI _Categories_.
- Added 'Is Visible UI' to 'Query Categories' and 'Category Identity'.
- Added 'Query View Owned Elements' component.
- Renamed 'Query View Elements' to 'Query Visible Elements'.
- Renamed 'Query View Elements' -> 'Query Visible Elements'.
- Added 'Query Title Blocks' component.
- Added 'Query Viewports' component.
- Fixed 'Element Name' when used to Rename Subcategories in Multiple families at once. #974
- Fixed 'Element Name' when used to rename _Subcategories_ in multiple families at once.
[#898](https://github.com/mcneel/rhino.inside-revit/issues/898)
- Fix on 'Query Categories' it should output ordered by id.
- Fix on 'Query Visible Elements' when a `<None>` category is used.
- 'Element Subcategory' compoennt now works on `GenericForm` elements.


{% endcapture %}
{% include ltr/release_header_next.html title="Upcoming Changes" note=rc_release_notes %}
Expand All @@ -37,7 +42,7 @@ group: Deployment & Configs

- Added {% include ltr/comp.html uuid='440b6beb' %}
- Added {% include ltr/comp.html uuid='6388cfc0' %}
- Added {% include ltr/comp.html uuid='f9bc3f5e' %}
- Exposed {% include ltr/comp.html uuid='f9bc3f5e' %}
- Includes all changes under 1.15RC releases listed below

{% include ltr/release-header.html title="v1.15 RC2" version="v1.15.8571.17168" pre_release=true time="06/20/2023" %}
Expand Down Expand Up @@ -116,7 +121,8 @@ group: Deployment & Configs
- Moved Component Family related components to 'Component' panel.
- Renamed 'Host Inserts' component to {% include ltr/comp.html uuid='70ccf7a6' %}.
- Now {% include ltr/comp.html uuid='70ccf7a6' %} keep linked elements on linked documents.
- Fixd a bug on {% include ltr/comp.html uuid='ad88cf11' %} component 'Line Style' input when used on a Family document. #788
- Fixd a bug on {% include ltr/comp.html uuid='ad88cf11' %} component 'Line Style' input when used on a Family document.
[#788](https://github.com/mcneel/rhino.inside-revit/issues/788)
- Fixed a bug on previews when there are Groups on the canvas.
- Now {% include ltr/comp.html uuid='c2b9b045' %} treats relative paths as temporary.
- Now {% include ltr/comp.html uuid='c2b9b045' %} has a 'Path' output to allow chaining with 'Load Component Family'.
Expand Down Expand Up @@ -168,10 +174,12 @@ group: Deployment & Configs

{% include ltr/release-header.html title="v1.12 RC1" version="v1.12.8417.6530" pre_release=true time="01/17/2023" %}

- Fixed {% include ltr/comp.html uuid='01e86d7c' %} name is getting an unexpected integer added in creation. [#754](https://github.com/mcneel/rhino.inside-revit/issues/754)
- Fixed {% include ltr/comp.html uuid='01e86d7c' %} name is getting an unexpected integer added in creation.
[#754](https://github.com/mcneel/rhino.inside-revit/issues/754)
- Added {% include ltr/comp.html uuid='e4e08f99' %} component.
- Added {% include ltr/comp.html uuid='2922af4a' %} component.
- Added {% include ltr/comp.html uuid='b062c96e' %} component. [#753](https://github.com/mcneel/rhino.inside-revit/issues/753)
- Added {% include ltr/comp.html uuid='b062c96e' %} component.
[#753](https://github.com/mcneel/rhino.inside-revit/issues/753)


{% include ltr/release-header.html title="v1.11" version="v1.11.8425.15605" time="01/10/2023" %}
Expand Down Expand Up @@ -361,7 +369,8 @@ group: Deployment & Configs
- Fixed structural framing creation on a family document.
- Fixed curved Beams when in a vertical plane.
- Fixed dimensioning components, when working with Detail Lines and Reference Planes.
- {% include ltr/comp.html uuid='8f1ee110' %} casting issue with enums [#613](https://github.com/mcneel/rhino.inside-revit/issues/613)
- {% include ltr/comp.html uuid='8f1ee110' %} casting issue with enums
[#613](https://github.com/mcneel/rhino.inside-revit/issues/613)

{% include ltr/release-header.html title="v1.8 RC2" version="v1.8.8207.14855" pre_release=true time="06/21/2022" %}

Expand Down Expand Up @@ -443,7 +452,8 @@ group: Deployment & Configs

- Added support for Revit 2023
- Fixed conversion from {% include ltr/comp.html uuid='15ad6bf9' %} to Surface when slant angle is negative
- Fixed a bug on {% include ltr/comp.html uuid='0f251f87' %} [#507](https://github.com/mcneel/rhino.inside-revit/issues/507)
- Fixed a bug on {% include ltr/comp.html uuid='0f251f87' %}
[#507](https://github.com/mcneel/rhino.inside-revit/issues/507)
- Updated Revit download link when loaded in an unsupported version

{% include ltr/release-header.html title="v1.6 RC4" version="v1.6.8124.18574" pre_release=true time="04/05/2022" %}
Expand Down Expand Up @@ -539,7 +549,8 @@ group: Deployment & Configs
- Renamed 'Document Links' to {% include ltr/comp.html uuid='ebccfdd8-' %}.
- Renamed 'Binding' to 'Scope' in parameter components.
- Updated 'Element Dependents' to return original 'Elements' and also 'Referentials'.
- Fixed {% include ltr/comp.html uuid='b3bcbf5b-' %} and {% include ltr/comp.html uuid='8b85b1fb-' %}: Now both have an option _Expand Dependents_ in the context menu to extract dependent elements geometry. Outputs are grafted accordingly. Closes #509.
- Fixed {% include ltr/comp.html uuid='b3bcbf5b-' %} and {% include ltr/comp.html uuid='8b85b1fb-' %}: Now both have an option _Expand Dependents_ in the context menu to extract dependent elements geometry. Outputs are grafted accordingly.
[#509](https://github.com/mcneel/rhino.inside-revit/issues/509).
- Updated some 'Query' component input parameters names to match Revit parameter name.

{% include ltr/release-header.html title="v1.4 RC5" version="v1.4.8007.15883" pre_release=true time="12/07/2021" %}
Expand Down Expand Up @@ -612,7 +623,8 @@ group: Deployment & Configs

- Issues

- Fixed Non-C2-BREP edge conversion when knots are below tolerance. RE [#382](https://github.com/mcneel/rhino.inside-revit/issues/382).
- Fixed Non-C2-BREP edge conversion when knots are below tolerance.
[#382](https://github.com/mcneel/rhino.inside-revit/issues/382).

- Minor Fixes and Improvements

Expand Down
10 changes: 7 additions & 3 deletions src/RhinoInside.Revit.GH/Components/Element/QueryElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
if (categories is object)
{
var ids = categories.
Where(x => x?.IsValid == true && (x.Document is null || x.Document.Equals(view.Document))).
Select(x => x.Id).ToArray();
Where(x => x is object && (x.IsEmpty || x.IsValid) && (x.Document is null || x.Document.Equals(view.Document))).
Select(x => x.Id).
ToList();

elementCollector = elementCollector.WherePasses
(
Expand All @@ -198,7 +199,10 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
else
{
// Default category filtering
var hiddenCategories = BuiltInCategoryExtension.GetHiddenInUIBuiltInCategories(view.Document) as ICollection<ARDB.BuiltInCategory>;
var hiddenCategories = BuiltInCategoryExtension.GetHiddenInUIBuiltInCategories(view.Document).
Append(ARDB.BuiltInCategory.INVALID). // `ScheduleSheetInstance` Viewer has no Category, so we filter here
ToList();

elementCollector = elementCollector.WherePasses
(
new ARDB.ElementMulticategoryFilter(hiddenCategories, inverted: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public QueryCategories() : base
ParamDefinition.Create<Parameters.Param_Enum<Types.CategoryType>>("Type", "T", "Category type", ARDB.CategoryType.Model, optional: true, relevance: ParamRelevance.Primary),
ParamDefinition.Create<Parameters.Category>("Parent", "P", "Parent category", optional: true, relevance: ParamRelevance.Occasional),
ParamDefinition.Create<Param_String>("Name", "N", "Category name", optional: true),
ParamDefinition.Create<Param_Boolean>("Is Subcategory", "ISC", "Is subcategory", defaultValue: false, GH_ParamAccess.item, optional: true),
ParamDefinition.Create<Param_Boolean>("Is Subcategory", "ISC", "Is subcategory", defaultValue: false, optional: true),
ParamDefinition.Create<Param_Boolean>("Is Visible UI", "VUI", "Category is exposed in UI", defaultValue: true, optional: true, relevance: ParamRelevance.Primary),
ParamDefinition.Create<Param_Boolean>("Allows Subcategories", "ASC", "Category allows subcategories to be added", optional: true, relevance: ParamRelevance.Secondary),
ParamDefinition.Create<Param_Boolean>("Allows Parameters", "AP", "Category allows bound parameters", optional: true, relevance: ParamRelevance.Secondary),
Expand Down Expand Up @@ -126,7 +126,8 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
"Categories",
categories.
Select(x => new Types.Category(x)).
TakeWhileIsNotEscapeKeyDown(this)
TakeWhileIsNotEscapeKeyDown(this).
OrderBy(x => x.Id.ToValue())
);
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/RhinoInside.Revit.GH/Components/Views/QueryViewElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
if (categories is object)
{
var ids = categories.
Where(x => x?.IsValid == true && (x.Document is null || x.Document.Equals(view.Document))).
Select(x => x.Id).ToArray();
Where(x => x is object && (x.IsEmpty || x.IsValid) && (x.Document is null || x.Document.Equals(view.Document))).
Select(x => x.Id).
ToList();

elementCollector = elementCollector.WherePasses
(
Expand All @@ -66,7 +67,10 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
else
{
// Default category filtering
var hiddenCategories = BuiltInCategoryExtension.GetHiddenInUIBuiltInCategories(view.Document) as ICollection<ARDB.BuiltInCategory>;
var hiddenCategories = BuiltInCategoryExtension.GetHiddenInUIBuiltInCategories(view.Document).
Append(ARDB.BuiltInCategory.INVALID). // `ScheduleSheetInstance` Viewer has no Category, so we filter here
ToList();

elementCollector = elementCollector.WherePasses
(
new ARDB.ElementMulticategoryFilter(hiddenCategories, inverted: true)
Expand Down
2 changes: 1 addition & 1 deletion src/RhinoInside.Revit.GH/Parameters/Elevation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public ProjectElevation() : base
}
}

namespace RhinoInside.Revit.GH.Components.Input
namespace RhinoInside.Revit.GH.Components.Site
{
[ComponentVersion(introduced: "1.0", updated: "1.14")]
public class ConstructProjectElevation : ZuiComponent
Expand Down
4 changes: 2 additions & 2 deletions src/RhinoInside.Revit.GH/Parameters/LevelConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
}
}

Params.TrySetData(DA, "Elevation", () => level is object ? new Types.LevelConstraint(level, offset ?? 0.0) : default);
Params.TrySetData(DA, "Elevation", () => level is object || offset is object ? new Types.LevelConstraint(level ?? new Types.Level(), offset ?? 0.0) : null);
Params.TrySetData(DA, "Level", () => level);
Params.TrySetData(DA, "Offset", () => offset);
Params.TrySetData(DA, "Offset", () => offset ?? (level is null ? default(double?) : 0.0));
}
}
}
52 changes: 45 additions & 7 deletions src/RhinoInside.Revit.GH/Types/CombinableElement.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,74 @@
using System;
using System.Linq;
using Grasshopper.Kernel.Types;
using ARDB = Autodesk.Revit.DB;

namespace RhinoInside.Revit.GH.Types
{
[Kernel.Attributes.Name("Form")]
public class CombinableElement : GeometricElement, IGH_InstanceElement
[Kernel.Attributes.Name("Combinable")]
public class CombinableElement : GeometricElement
{
protected override Type ValueType => typeof(ARDB.CombinableElement);
public new ARDB.CombinableElement Value => base.Value as ARDB.CombinableElement;

public CombinableElement() { }
public CombinableElement(ARDB.CombinableElement element) : base(element) { }
}

[Kernel.Attributes.Name("Combination")]
public class GeomCombination : CombinableElement
{
protected override Type ValueType => typeof(ARDB.GeomCombination);
public new ARDB.GeomCombination Value => base.Value as ARDB.GeomCombination;

public GeomCombination() { }
public GeomCombination(ARDB.GeomCombination element) : base(element) { }
}

[Kernel.Attributes.Name("Form")]
public class GenericForm : CombinableElement
{
protected override Type ValueType => typeof(ARDB.GenericForm);
public new ARDB.GenericForm Value => base.Value as ARDB.GenericForm;

public GenericForm() { }
public GenericForm(ARDB.GenericForm element) : base(element) { }

#region Category
public override Category Category
public override Category Subcategory
{
get
{
var paramId = ARDB.BuiltInParameter.FAMILY_ELEM_SUBCATEGORY;
if (paramId != ARDB.BuiltInParameter.INVALID && Value is ARDB.Element element)
{
using (var parameter = element.get_Parameter(paramId))
{
if (parameter?.AsElementId() is ARDB.ElementId categoryId)
{
var category = new Category(Document, categoryId);
return category.APIObject?.Parent is null ? new Category() : category;
}
}
}

return default;
}

set
{
var paramId = ARDB.BuiltInParameter.FAMILY_ELEM_SUBCATEGORY;
if (value is object && Value is ARDB.Element element)
{
using (var parameter = element.get_Parameter(ARDB.BuiltInParameter.FAMILY_ELEM_SUBCATEGORY))
using (var parameter = element.get_Parameter(paramId))
{
if (parameter is null)
{
if (value.Id != ARDB.ElementId.InvalidElementId)
throw new Exceptions.RuntimeErrorException($"{((IGH_Goo) this).TypeName} '{DisplayName}' does not support assignment of a Category.");
throw new Exceptions.RuntimeErrorException($"{((IGH_Goo) this).TypeName} '{DisplayName}' does not support assignment of a Subcategory.");
}
else
{
AssertValidDocument(value, nameof(Category));
AssertValidDocument(value, nameof(Subcategory));
parameter.Update(value);
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/RhinoInside.Revit.GH/Types/DocumentObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ public bool Equals(ReferenceObject other) => other is object &&
#endregion

#region DocumentObject
public bool IsEmpty => !IsReferencedData;

public override object Value
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/RhinoInside.Revit.GH/Types/Element.Activator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public static Element FromReference(ARDB.Document doc, ARDB.Reference reference)
{ typeof(ARDB.ViewFamilyType), (element)=> new ViewFamilyType (element as ARDB.ViewFamilyType) },
{ typeof(ARDB.View), (element)=> new View (element as ARDB.View) },
{ typeof(ARDB.Viewport), (element)=> new Viewport (element as ARDB.Viewport) },
{ typeof(ARDB.ScheduleSheetInstance), (element)=> new ScheduleSheetInstance (element as ARDB.ScheduleSheetInstance)},
{ typeof(ARDB.ViewSheet), (element)=> new ViewSheet (element as ARDB.ViewSheet) },
{ typeof(ARDB.View3D), (element)=> new View3D (element as ARDB.View3D) },
{ typeof(ARDB.ViewPlan), (element)=> new ViewPlan (element as ARDB.ViewPlan) },
Expand All @@ -289,6 +290,8 @@ public static Element FromReference(ARDB.Document doc, ARDB.Reference reference)
{ typeof(ARDB.SketchPlane), (element)=> new SketchPlane (element as ARDB.SketchPlane) },
{ typeof(ARDB.CurveElement), (element)=> new CurveElement (element as ARDB.CurveElement) },
{ typeof(ARDB.CombinableElement), (element)=> new CombinableElement (element as ARDB.CombinableElement) },
{ typeof(ARDB.GeomCombination), (element)=> new GeomCombination (element as ARDB.GeomCombination) },
{ typeof(ARDB.GenericForm), (element)=> new GenericForm (element as ARDB.GenericForm) },

{ typeof(ARDB.DatumPlane), (element)=> new DatumPlane (element as ARDB.DatumPlane) },
{ typeof(ARDB.Level), (element)=> new Level (element as ARDB.Level) },
Expand Down
2 changes: 0 additions & 2 deletions src/RhinoInside.Revit.GH/Types/Element.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ Value.Category is ARDB.Category category ?
Category.FromCategory(category) :
new Category() :
default;

set => throw new Exceptions.RuntimeErrorException($"{((IGH_Goo) this).TypeName} '{DisplayName}' does not support assignment of a Category.");
}

public virtual ElementType Type
Expand Down
2 changes: 1 addition & 1 deletion src/RhinoInside.Revit.GH/Types/GraphicalElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public override bool CastTo<Q>(out Q target)
public virtual Category Subcategory
{
get => default;
set => throw new Exceptions.RuntimeErrorException($"{((IGH_Goo) this).TypeName} '{DisplayName}' does not support assignment of a Subcategory.");
set { if (value is object) throw new Exceptions.RuntimeErrorException($"{((IGH_Goo) this).TypeName} '{DisplayName}' does not support assignment of a Subcategory."); }
}

public virtual ARDB.ElementId LevelId => Value?.LevelId;
Expand Down
5 changes: 5 additions & 0 deletions src/RhinoInside.Revit.GH/Types/InstanceElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public InstanceElement(ARDB.Element element) : base(element) { }
}

#region IHostElementAccess
GraphicalElement IHostElementAccess.HostElement => Value is ARDB.Element element ?
element.ViewSpecific ? OwnerView?.Viewer :
HostElement :
default;

public virtual GraphicalElement HostElement => Value is ARDB.Element element ?
GetElement<GraphicalElement>(element.LevelId) :
default;
Expand Down
7 changes: 6 additions & 1 deletion src/RhinoInside.Revit.GH/Types/ObjectStyles/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,12 @@ public override string Nomen

public Category Parent => _IsSubcategory == false ? null : FromCategory(APIObject?.Parent);

public IEnumerable<Category> SubCategories => APIObject?.SubCategories?.Cast<ARDB.Category>().Select(FromCategory);
public IEnumerable<Category> SubCategories => APIObject?.
SubCategories?.
Cast<ARDB.Category>().
Where(x => !x.AllowsBoundParameters).
OrderBy(x => x.Id.ToValue()).
Select(FromCategory);

bool? _IsTagCategory;
public bool? IsTagCategory => _IsTagCategory ?? (_IsTagCategory = APIObject?.IsTagCategory);
Expand Down
Loading
Loading