diff --git a/Revit_Adapter/Revit_Adapter.csproj b/Revit_Adapter/Revit_Adapter.csproj index b93f56501..0f801e86b 100644 --- a/Revit_Adapter/Revit_Adapter.csproj +++ b/Revit_Adapter/Revit_Adapter.csproj @@ -2,13 +2,13 @@ net472 - 7.0.0.0 + 8.0.0.0 https://github.com/BHoM/Revit_Toolkit 6.0.0 BHoM Copyright © https://github.com/BHoM BH.Adapter.Revit - 7.3.0.0 + 8.0.0.0 diff --git a/Revit_Core_Adapter/Revit_Core_Adapter.csproj b/Revit_Core_Adapter/Revit_Core_Adapter.csproj index 2aab41917..81052c5a4 100644 --- a/Revit_Core_Adapter/Revit_Core_Adapter.csproj +++ b/Revit_Core_Adapter/Revit_Core_Adapter.csproj @@ -1,13 +1,13 @@ - 7.0.0.0 + 8.0.0.0 https://github.com/BHoM/Revit_Toolkit 6.0.0 BHoM Copyright © https://github.com/BHoM BH.Revit.Adapter.Core - 7.3.0.0 + 8.0.0.0 diff --git a/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs b/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs index d738aef43..95a591555 100644 --- a/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs +++ b/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs @@ -440,6 +440,14 @@ private static FamilyInstance FamilyInstance_WorkPlaneBased(Document document, F if (orientation.BasisZ.DotProduct(orientation.BasisX.CrossProduct(orientation.BasisY)) < 0) refDir = -refDir; } + else if (((host.Location as LocationCurve)?.Curve) is Line line) + { + Transform linkTransform = linkInstance?.GetTotalTransform() ?? Transform.Identity; + if (!linkTransform.IsIdentity) + line = line.CreateTransformed(linkTransform) as Line; + + refDir = line.Direction; + } FamilyInstance familyInstance = document.Create.NewFamilyInstance(reference, location, refDir, familySymbol); diff --git a/Revit_Core_Engine/Query/LinkedElementsInView.cs b/Revit_Core_Engine/Query/LinkedElementsInView.cs index 25e02ca8a..4ff682b52 100644 --- a/Revit_Core_Engine/Query/LinkedElementsInView.cs +++ b/Revit_Core_Engine/Query/LinkedElementsInView.cs @@ -33,7 +33,6 @@ public static partial class Query /**** Public methods ****/ /***************************************************/ - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.LinkedElementsInView(Autodesk.Revit.DB.ViewPlan, Autodesk.Revit.DB.RevitLinkInstance, System.Collections.Generic.List)")] [Description("Return elements from the revit link instance located in the view scope (including hidden elements)")] [Input("view", "View to get visible elements from. The view needs to belong to the host document.")] [Input("linkInstance", "Revit link instance to get the elements from.")] diff --git a/Revit_Core_Engine/Query/SpecFromName.cs b/Revit_Core_Engine/Query/SpecFromName.cs index c0047fcfb..97733cb43 100644 --- a/Revit_Core_Engine/Query/SpecFromName.cs +++ b/Revit_Core_Engine/Query/SpecFromName.cs @@ -34,7 +34,6 @@ public static partial class Query /**** Public methods ****/ /***************************************************/ - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.UnitTypeByPropertyName(System.String)")] [Description("Returns Revit spec object (enum for Revit up to 2020 or ForgeTypeId for later versions) based on SpecTypeId property name that represents it.")] [Input("name", "Name of SpecTypeId property to be queried for the correspondent spec.")] [Output("spec", "Spec object under the input SpecTypeId property name.")] diff --git a/Revit_Core_Engine/Query/SpecName.cs b/Revit_Core_Engine/Query/SpecName.cs index 94bd92327..16781859b 100644 --- a/Revit_Core_Engine/Query/SpecName.cs +++ b/Revit_Core_Engine/Query/SpecName.cs @@ -33,8 +33,6 @@ public static partial class Query /**** Public methods ****/ /***************************************************/ - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.UnitTypePropertyName(Autodesk.Revit.DB.UnitType)")] - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.UnitTypePropertyName(Autodesk.Revit.DB.ForgeTypeId)")] [Description("Returns name of SpecTypeId property that contains a given Revit spec object (enum for Revit up to 2020 or ForgeTypeId for later versions).")] [Input("spec", "Spec object to be queried for the correspondent SpecTypeId property name.")] [Output("name", "Name of SpecTypeId property that contains the input spec object.")] @@ -55,7 +53,6 @@ public static string SpecName(this ForgeTypeId spec) /***************************************************/ - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.UnitTypePropertyName(Autodesk.Revit.DB.Parameter)")] [Description("Returns name of SpecTypeId property that contains given Revit parameter's spec object (enum for Revit up to 2020 or ForgeTypeId for later versions).")] [Input("parameter", "Parameter to be queried for the correspondent SpecTypeId property name.")] [Output("name", "Name of SpecTypeId property that contains the spec object correspondent to the input parameter.")] diff --git a/Revit_Core_Engine/Query/ViewSolid.cs b/Revit_Core_Engine/Query/ViewSolid.cs index f8393e31a..335c2d3ef 100644 --- a/Revit_Core_Engine/Query/ViewSolid.cs +++ b/Revit_Core_Engine/Query/ViewSolid.cs @@ -1,4 +1,4 @@ -/* +/* * This file is part of the Buildings and Habitats object Model (BHoM) * Copyright (c) 2015 - 2024, the respective contributors. All rights reserved. * @@ -35,7 +35,6 @@ public static partial class Query /**** Public methods ****/ /***************************************************/ - [PreviousVersion("7.3", "BH.Revit.Engine.Core.Query.ViewSolid(Autodesk.Revit.DB.View)")] [Description("Returns a solid that represents the 3-dimensional extents of a given view.")] [Input("view", "View to compute the solids.")] [Input("createUnlimitedIfViewUncropped", "If false, the method will return null in case of missing crop box (i.e. the view is unlimited, so it cannot be represented by a solid). If true, uncropped views will produce an 'unlimited' solid roughly 1e+6 by 1e+6 in dimensions perpendicular to the view direction, with depth equal to view depth or 1e+4 in case of views without depth.")] diff --git a/Revit_Core_Engine/Revit_Core_Engine.csproj b/Revit_Core_Engine/Revit_Core_Engine.csproj index 25f0e1092..1b92b3c47 100644 --- a/Revit_Core_Engine/Revit_Core_Engine.csproj +++ b/Revit_Core_Engine/Revit_Core_Engine.csproj @@ -1,12 +1,12 @@ - 7.0.0.0 + 8.0.0.0 https://github.com/BHoM/Revit_Toolkit 6.0.0 BHoM Copyright © https://github.com/BHoM BH.Revit.Engine.Core - 7.3.0.0 + 8.0.0.0 diff --git a/Revit_Engine/Create/Generic/RevitFilePreview.cs b/Revit_Engine/Create/Generic/RevitFilePreview.cs index af30edb5b..1c1c0df34 100644 --- a/Revit_Engine/Create/Generic/RevitFilePreview.cs +++ b/Revit_Engine/Create/Generic/RevitFilePreview.cs @@ -24,6 +24,7 @@ using BH.oM.Base.Attributes; using System.Collections.Generic; using System.ComponentModel; +using System.Linq; using System.Xml.Linq; namespace BH.Engine.Adapters.Revit @@ -39,14 +40,31 @@ public static partial class Create [Output("revitFilePreview")] public static RevitFilePreview RevitFilePreview(string path) { + // Find the family document XDocument xDocument = path.XDocument(); if (xDocument == null) return null; + // Get category and family name string categoryName = xDocument.CategoryName(); string familyName = System.IO.Path.GetFileNameWithoutExtension(path); + + // Scrape type names from the file itself List familyTypeNames = xDocument.FamilyTypeNames(); + + // Scrape type names from the sister .txt file if exists + string txtPath = path.Replace(".rfa", ".txt"); + if (System.IO.File.Exists(txtPath)) + { + foreach (string line in System.IO.File.ReadAllLines(txtPath).Skip(1)) + { + string[] splitLine = line.Split(','); + if (splitLine.Length != 0 && !familyTypeNames.Contains(splitLine[0])) + familyTypeNames.Add(splitLine[0]); + } + } + familyTypeNames.Sort(); return new RevitFilePreview(path, categoryName, familyName, familyTypeNames); } diff --git a/Revit_Engine/Revit_Engine.csproj b/Revit_Engine/Revit_Engine.csproj index e53e3d8f1..e7266b697 100644 --- a/Revit_Engine/Revit_Engine.csproj +++ b/Revit_Engine/Revit_Engine.csproj @@ -2,13 +2,13 @@ net472 - 7.0.0.0 + 8.0.0.0 https://github.com/BHoM/Revit_Toolkit 6.0.0 BHoM Copyright © https://github.com/BHoM BH.Engine.Revit - 7.3.0.0 + 8.0.0.0 diff --git a/Revit_oM/Revit_oM.csproj b/Revit_oM/Revit_oM.csproj index a653dc062..842f23cba 100644 --- a/Revit_oM/Revit_oM.csproj +++ b/Revit_oM/Revit_oM.csproj @@ -2,13 +2,13 @@ net472 - 7.0.0.0 + 8.0.0.0 https://github.com/BHoM/Revit_Toolkit 6.0.0 BHoM Copyright © https://github.com/BHoM BH.oM.Revit - 7.3.0.0 + 8.0.0.0