diff --git a/Install/RevitIFCSetupWix/Product.wxs b/Install/RevitIFCSetupWix/Product.wxs index 2549e131..d576e33b 100644 --- a/Install/RevitIFCSetupWix/Product.wxs +++ b/Install/RevitIFCSetupWix/Product.wxs @@ -2,7 +2,7 @@ - + @@ -19,10 +19,10 @@ - + - + @@ -38,9 +38,9 @@ - + - + @@ -48,12 +48,12 @@ - + - + @@ -64,25 +64,25 @@ - - - - + + - - - - + + - - - - + + - + @@ -93,14 +93,14 @@ - + - + @@ -131,11 +131,11 @@ - + diff --git a/Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj b/Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj index 7d00b691..09179c65 100644 --- a/Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj +++ b/Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj @@ -6,15 +6,18 @@ 3.8 7dfbd495-c588-4c7b-b8f6-5b793adb06f2 2.0 - Revit IFC for Revit 2015 + Revit IFC for Revit 2018 Package $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets Always - Perforce Project - MSSCCI:Perforce SCM + + + + - . + + $(SolutionDir)..\$(Configuration)$(PlatformName)\ @@ -22,7 +25,7 @@ Debug - $(SolutionDir)..\$(Configuration)$(PlatformName)\ + $(SolutionDir)\Setup\$(Configuration)$(PlatformName)\ obj\$(Configuration)\ @@ -42,8 +45,8 @@ - - BIM.IFC.Common + + Revit.IFC.Common {032ea4dc-181f-4453-9f93-e08de1c07d95} True True diff --git a/Install/RevitIFCSetupWix/buildInstaller.bat b/Install/RevitIFCSetupWix/buildInstaller.bat index c4640d4d..bae28424 100644 --- a/Install/RevitIFCSetupWix/buildInstaller.bat +++ b/Install/RevitIFCSetupWix/buildInstaller.bat @@ -5,15 +5,19 @@ echo %2 set ThisBatFileRoot=%~dp0 rem Set this path to your Wix bin directory. -set WixRoot=%ThisBatFileRoot%..\..\..\..\..\..\ThirdParty\Wix\ +rem set WixRoot=%ThisBatFileRoot%..\..\..\..\..\..\ThirdParty\Wix\ +set WixRoot="C:\Program Files (x86)\WiX Toolset v3.11\bin\" rem It is necessary to add the Wix bin directory to the system path temporarily to use the -ext flag below. SET PATH=%PATH%;%WixRoot% candle.exe -dProjectDir=%2 -ext WixUtilExtension %2Product.wxs -light.exe -ext WixUtilExtension -out RevitIFC2019.msi product.wixobj -ext WixUIExtension +rem light.exe -ext WixUtilExtension -out RevitIFC2019.msi product.wixobj -ext WixUIExtension +rem light.exe -ext WixUtilExtension -out RevitIFC2018_18410.msi product.wixobj -ext WixUIExtension +light.exe -ext WixUtilExtension -out RevitIFC2018_18410.msi product.wixobj -ext WixUIExtension -copy RevitIFC2019.msi %1..\Releasex64 -del RevitIFC2019.msi +rem copy RevitIFC2019.msi %1..\Releasex64 +rem echo %1..\Releasex64\RevitIFC2019.msi -echo %1..\Releasex64\RevitIFC2019.msi +del "*.wix*" +del "Revit IFC for Revit 2018.msi" diff --git a/Revit.IFC.sln b/Revit.IFC.sln index b02f825c..73fde64c 100644 --- a/Revit.IFC.sln +++ b/Revit.IFC.sln @@ -1,12 +1,15 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.489 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Revit.IFC.Import", "Source\Revit.IFC.Import\Revit.IFC.Import.csproj", "{7F987D09-9716-4F50-ADE0-278E4B537101}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Revit.IFC.Export", "Source\Revit.IFC.Export\Revit.IFC.Export.csproj", "{BCE5141A-291B-4CD8-A69B-7B9345AA00E9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Revit.IFC.Common", "Source\Revit.IFC.Common\Revit.IFC.Common.csproj", "{032EA4DC-181F-4453-9F93-E08DE1C07D95}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IFCExporterUI", "Source\IFCExporterUIOverride\IFCExporterUIOverride.csproj", "{BF694550-5BEB-4DCF-8EC2-A5904690DC17}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IFCExporterUIOverride", "Source\IFCExporterUIOverride\IFCExporterUIOverride.csproj", "{BF694550-5BEB-4DCF-8EC2-A5904690DC17}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Install", "Install", "{88C55E9A-2767-48B7-A035-E3D864C4FF09}" EndProject @@ -79,6 +82,9 @@ Global GlobalSection(NestedProjects) = preSolution {7DFBD495-C588-4C7B-B8F6-5B793ADB06F2} = {88C55E9A-2767-48B7-A035-E3D864C4FF09} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A466EE46-9A7B-493D-A047-4F929CB6ADFA} + EndGlobalSection GlobalSection(DPCodeReviewSolutionGUID) = preSolution DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} EndGlobalSection diff --git a/Source/IFCExporterUIOverride/IFCExportConfiguration.cs b/Source/IFCExporterUIOverride/IFCExportConfiguration.cs index 97109681..8ffa8cf3 100644 --- a/Source/IFCExporterUIOverride/IFCExportConfiguration.cs +++ b/Source/IFCExporterUIOverride/IFCExportConfiguration.cs @@ -220,6 +220,8 @@ public class IFCExportConfiguration /// public string COBieProjectInfo { get; set; } = ""; + public bool DoorBelongsToRoom { get; set; } + /// /// Value indicating whether steel elements should be exported. /// @@ -292,6 +294,7 @@ private IFCExportConfiguration() this.ExportSpecificSchedules = false; this.TessellationLevelOfDetail = 0.5; this.UseOnlyTriangulation = false; + this.DoorBelongsToRoom = false; this.StoreIFCGUID = false; this.m_isBuiltIn = false; this.m_isInSession = false; @@ -360,6 +363,7 @@ private IFCExportConfiguration() // The default tesselationLevelOfDetail will be low configuration.TessellationLevelOfDetail = 0.5; configuration.UseOnlyTriangulation = false; + configuration.DoorBelongsToRoom = false; configuration.StoreIFCGUID = false; configuration.m_isBuiltIn = true; configuration.m_isInSession = false; @@ -410,6 +414,7 @@ private IFCExportConfiguration(IFCExportConfiguration other) this.IncludeSiteElevation = other.IncludeSiteElevation; this.TessellationLevelOfDetail = other.TessellationLevelOfDetail; this.UseOnlyTriangulation = other.UseOnlyTriangulation; + this.DoorBelongsToRoom = other.DoorBelongsToRoom; this.StoreIFCGUID = other.StoreIFCGUID; this.m_isBuiltIn = other.m_isBuiltIn; this.m_isInSession = other.m_isInSession; @@ -465,6 +470,7 @@ private IFCExportConfiguration(String name, IFCExportConfiguration other) this.IncludeSiteElevation = other.IncludeSiteElevation; this.TessellationLevelOfDetail = other.TessellationLevelOfDetail; this.UseOnlyTriangulation = other.UseOnlyTriangulation; + this.DoorBelongsToRoom = other.DoorBelongsToRoom; this.ActivePhaseId = other.ActivePhaseId; this.ExportRoomsInView = other.ExportRoomsInView; this.m_isBuiltIn = false; @@ -538,6 +544,7 @@ public void UpdateOptions(IFCExportOptions options, ElementId filterViewId) options.AddOption("SitePlacement", SitePlacement.ToString()); options.AddOption("TessellationLevelOfDetail", TessellationLevelOfDetail.ToString()); options.AddOption("UseOnlyTriangulation", UseOnlyTriangulation.ToString()); + options.AddOption("DoorBelongsToRoom", DoorBelongsToRoom.ToString()); options.AddOption("ActiveViewId", ActiveViewId.ToString()); options.AddOption("StoreIFCGUID", StoreIFCGUID.ToString()); diff --git a/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml b/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml index 59a08b14..6c54685f 100644 --- a/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml +++ b/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml @@ -102,7 +102,8 @@ - + + + \ No newline at end of file diff --git a/Source/Revit.IFC.Export/Toolkit/IFCInstanceExporter.cs b/Source/Revit.IFC.Export/Toolkit/IFCInstanceExporter.cs index 238f19fa..9336c8f5 100644 --- a/Source/Revit.IFC.Export/Toolkit/IFCInstanceExporter.cs +++ b/Source/Revit.IFC.Export/Toolkit/IFCInstanceExporter.cs @@ -5847,6 +5847,37 @@ public static IFCAnyHandle CreateCurveBoundedSurface(IFCFile file, IFCAnyHandle IFCAnyHandle door = CreateInstance(exporterIFC.GetFile(), IFCEntityType.IfcDoor, element); IFCAnyHandleUtil.SetAttribute(door, "OverallHeight", overallHeight); IFCAnyHandleUtil.SetAttribute(door, "OverallWidth", overallWidth); + + // ------------------------------------------------------------------------------ + // Jo64 + if (ExporterCacheManager.ExportOptionsCache.DoorBelongsToRoom.GetValueOrDefault()) + { + var familyInstance = element as FamilyInstance; + if (familyInstance != null) + { + ElementId roomId; + + var toRoomId = ((FamilyInstance)element).ToRoom?.Id; + if (toRoomId != null) + roomId = toRoomId; + else + roomId = ((FamilyInstance)element).Room?.Id; + + //var fromRoomId = ((FamilyInstance)element).FromRoom?.Id; + if (roomId != null) + { + bool containedInSpace = (roomId != ElementId.InvalidElementId); + if (containedInSpace) + { + ExporterCacheManager.DoorBelongsToRoomCache.Add(door); + ExporterCacheManager.SpaceInfoCache.RelateToSpace(roomId, door); + } + } + } + } + // ------------------------------------------------------------------------------ + + if (ExporterCacheManager.ExportOptionsCache.ExportAs4) { string validatedPreDefinedType = IFCValidateEntry.ValidateStrEnum(preDefinedType); diff --git a/Source/Revit.IFC.Export/Utility/ExportOptionsCache.cs b/Source/Revit.IFC.Export/Utility/ExportOptionsCache.cs index 1906657d..82889290 100644 --- a/Source/Revit.IFC.Export/Utility/ExportOptionsCache.cs +++ b/Source/Revit.IFC.Export/Utility/ExportOptionsCache.cs @@ -198,6 +198,8 @@ public static ExportOptionsCache Create(ExporterIFC exporterIFC, Document docume bool? includeSteelElements = GetNamedBooleanOption(options, "IncludeSteelElements"); cache.IncludeSteelElements = includeSteelElements.HasValue && includeSteelElements.Value; + cache.DoorBelongsToRoom = GetNamedBooleanOption(options, "DoorBelongsToRoom"); + // There is a bug in the native code that doesn't allow us to cast the filterView to any sub-type of View. Work around this by re-getting the element pointer. if (filterView != null) cache.FilterViewForExport = filterView.Document.GetElement(filterView.Id) as View; @@ -744,6 +746,11 @@ public bool ExportAs2x3COBIE24DesignDeliverable } } + /// + /// + /// + public bool? DoorBelongsToRoom { get; set; } + /// /// Cache variable for the export annotations override (if set independently via the UI or API inputs) /// diff --git a/Source/Revit.IFC.Export/Utility/ExporterCacheManager.cs b/Source/Revit.IFC.Export/Utility/ExporterCacheManager.cs index c83dd7b6..96c6440d 100644 --- a/Source/Revit.IFC.Export/Utility/ExporterCacheManager.cs +++ b/Source/Revit.IFC.Export/Utility/ExporterCacheManager.cs @@ -398,6 +398,20 @@ public class ExporterCacheManager /// static IDictionary, string> m_PropertyMapCache; + // --------------------------------------------- + // Jo64 + static HashSet m_DoorBelongsToRoomCache; + public static HashSet DoorBelongsToRoomCache + { + get + { + if (m_DoorBelongsToRoomCache == null) + m_DoorBelongsToRoomCache = new HashSet(); + return m_DoorBelongsToRoomCache; + } + } + // --------------------------------------------- + /// /// The ParameterCache object. /// diff --git a/Source/Revit.IFC.Import/Properties/AssemblyInfo.cs b/Source/Revit.IFC.Import/Properties/AssemblyInfo.cs index 72474b2a..e9b6bee2 100644 --- a/Source/Revit.IFC.Import/Properties/AssemblyInfo.cs +++ b/Source/Revit.IFC.Import/Properties/AssemblyInfo.cs @@ -12,8 +12,9 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("19.1.0.0")] -[assembly: AssemblyFileVersion("19.1.0.0")] +[assembly: AssemblyVersion("18.4.1.0")] +[assembly: AssemblyFileVersion("18.4.1.0")] + #region Using directives