string m_SettingFile = "IFCExportSettings_v7.txt"; // update the file when resize window bounds. /// <summary> /// Construction of the main export dialog. /// </summary> /// <param name="configurationsMap">The configurations to show in the dialog.</param> /// <param name="selectedConfigName">The current selected configuration name.</param> public IFCExport(Document doc, IFCExportConfigurationsMap configurationsMap, String selectedConfigName) { m_configMap = configurationsMap; InitializeComponent(); RestorePreviousWindow(); UpdateCurrentSelectedSetupCombo(selectedConfigName); Title = "IFC Export (" + IFCUISettings.GetAssemblyVersion() + ")"; }
/// <summary> /// Updates the IFCExportOptions with the settings in this configuration. /// </summary> /// <param name="options">The IFCExportOptions to update.</param> /// <param name="filterViewId">The id of the view that will be used to select which elements to export.</param> public void UpdateOptions(IFCExportOptions options, ElementId filterViewId) { options.FileVersion = IFCVersion; options.SpaceBoundaryLevel = SpaceBoundaries; options.ExportBaseQuantities = ExportBaseQuantities; options.WallAndColumnSplitting = SplitWallsAndColumns; options.FilterViewId = VisibleElementsOfCurrentView ? filterViewId : ElementId.InvalidElementId; options.AddOption("ExportInternalRevitPropertySets", ExportInternalRevitPropertySets.ToString()); options.AddOption("ExportIFCCommonPropertySets", ExportIFCCommonPropertySets.ToString()); options.AddOption("ExportAnnotations", Export2DElements.ToString()); options.AddOption("Use2DRoomBoundaryForVolume", Use2DRoomBoundaryForVolume.ToString()); options.AddOption("UseFamilyAndTypeNameForReference", UseFamilyAndTypeNameForReference.ToString()); options.AddOption("ExportVisibleElementsInView", VisibleElementsOfCurrentView.ToString()); options.AddOption("ExportPartsAsBuildingElements", ExportPartsAsBuildingElements.ToString()); options.AddOption("UseActiveViewGeometry", UseActiveViewGeometry.ToString()); options.AddOption("ExportSpecificSchedules", ExportSpecificSchedules.ToString()); options.AddOption("ExportBoundingBox", ExportBoundingBox.ToString()); options.AddOption("ExportSolidModelRep", ExportSolidModelRep.ToString()); options.AddOption("ExportSchedulesAsPsets", ExportSchedulesAsPsets.ToString()); options.AddOption("ExportUserDefinedPsets", ExportUserDefinedPsets.ToString()); options.AddOption("ExportUserDefinedParameterMapping", ExportUserDefinedParameterMapping.ToString()); options.AddOption("ExportLinkedFiles", ExportLinkedFiles.ToString()); options.AddOption("IncludeSiteElevation", IncludeSiteElevation.ToString()); options.AddOption("SitePlacement", SitePlacement.ToString()); options.AddOption("TessellationLevelOfDetail", TessellationLevelOfDetail.ToString()); options.AddOption("UseOnlyTriangulation", UseOnlyTriangulation.ToString()); options.AddOption("ActiveViewId", ActiveViewId.ToString()); options.AddOption("StoreIFCGUID", StoreIFCGUID.ToString()); // The active phase may not be valid if we are exporting multiple projects. However, if projects share a template that defines the phases, // then the ActivePhaseId would likely be valid for all. There is some small chance that the ActivePhaseId would be a valid, but different, phase // in different projects, but that is unlikely enough that it seems worth warning against it but allowing the better functionality in general. if (IFCPhaseAttributes.Validate(ActivePhaseId)) { options.AddOption("ActivePhase", ActivePhaseId.ToString()); } options.AddOption("FileType", IFCFileType.ToString()); string uiVersion = IFCUISettings.GetAssemblyVersion(); options.AddOption("AlternateUIVersion", uiVersion); options.AddOption("ConfigName", Name); // Add config name into the option for use in the exporter options.AddOption("ExportUserDefinedPsetsFileName", ExportUserDefinedPsetsFileName); options.AddOption("ExportUserDefinedParameterMappingFileName", ExportUserDefinedParameterMappingFileName); options.AddOption("ExportRoomsInView", ExportRoomsInView.ToString()); options.AddOption("ExcludeFilter", ExcludeFilter.ToString()); options.AddOption("COBieCompanyInfo", COBieCompanyInfo); options.AddOption("COBieProjectInfo", COBieProjectInfo); options.AddOption("IncludeSteelElements", IncludeSteelElements.ToString()); options.AddOption("UseTypeNameOnlyForIfcType", UseTypeNameOnlyForIfcType.ToString()); options.AddOption("UseVisibleRevitNameAsEntityName", UseVisibleRevitNameAsEntityName.ToString()); }
/// <summary> /// Construction of the main export dialog. /// </summary> /// <param name="app">The UIApplication that contains a list of all documents.</param> /// <param name="configurationsMap">The configurations to show in the dialog.</param> /// <param name="selectedConfigName">The current selected configuration name.</param> public IFCExport(Autodesk.Revit.UI.UIApplication app, IFCExportConfigurationsMap configurationsMap, String selectedConfigName) { m_configMap = configurationsMap; InitializeComponent(); RestorePreviousWindow(); UpdateCurrentSelectedSetupCombo(selectedConfigName); UpdateOpenedProjectsListView(app); Title = "IFC Export (" + IFCUISettings.GetAssemblyVersion() + ")"; }
/// <summary> /// Updates the IFCExportOptions with the settings in this configuration. /// </summary> /// <param name="options">The IFCExportOptions to update.</param> /// <param name="filterViewId">The filter view.</param> public void UpdateOptions(IFCExportOptions options, ElementId filterViewId) { options.FileVersion = IFCVersion; options.SpaceBoundaryLevel = SpaceBoundaries; options.ExportBaseQuantities = ExportBaseQuantities; options.WallAndColumnSplitting = SplitWallsAndColumns; if (VisibleElementsOfCurrentView) { options.FilterViewId = filterViewId; } else { options.FilterViewId = ElementId.InvalidElementId; } options.AddOption("ExportInternalRevitPropertySets", ExportInternalRevitPropertySets.ToString()); options.AddOption("ExportIFCCommonPropertySets", ExportIFCCommonPropertySets.ToString()); options.AddOption("ExportAnnotations", Export2DElements.ToString()); options.AddOption("Use2DRoomBoundaryForVolume", Use2DRoomBoundaryForVolume.ToString()); options.AddOption("UseFamilyAndTypeNameForReference", UseFamilyAndTypeNameForReference.ToString()); options.AddOption("ExportVisibleElementsInView", VisibleElementsOfCurrentView.ToString()); options.AddOption("ExportPartsAsBuildingElements", ExportPartsAsBuildingElements.ToString()); options.AddOption("ExportBoundingBox", ExportBoundingBox.ToString()); options.AddOption("ExportSolidModelRep", ExportSolidModelRep.ToString()); options.AddOption("ExportSchedulesAsPsets", ExportSchedulesAsPsets.ToString()); options.AddOption("ExportUserDefinedPsets", ExportUserDefinedPsets.ToString()); options.AddOption("ExportLinkedFiles", ExportLinkedFiles.ToString()); options.AddOption("IncludeSiteElevation", IncludeSiteElevation.ToString()); options.AddOption("UseCoarseTessellation", UseCoarseTessellation.ToString()); options.AddOption("TessellationLevelOfDetail", TessellationLevelOfDetail.ToString()); options.AddOption("StoreIFCGUID", StoreIFCGUID.ToString()); options.AddOption("ActivePhase", ActivePhaseId.ToString()); options.AddOption("FileType", IFCFileType.ToString()); string uiVersion = IFCUISettings.GetAssemblyVersion(); options.AddOption("AlternateUIVersion", uiVersion); options.AddOption("ConfigName", Name); // Add config name into the option for use in the exporter options.AddOption("ExportUserDefinedPsetsFileName", ExportUserDefinedPsetsFileName); options.AddOption("ExportRoomsInView", ExportRoomsInView.ToString()); }
/// <summary> /// Updates the IFCExportOptions with the settings in this configuration. /// </summary> /// <param name="options">The IFCExportOptions to update.</param> /// <param name="filterViewId">The id of the view that will be used to select which elements to export.</param> public void UpdateOptions(IFCExportOptions options, ElementId filterViewId) { JavaScriptSerializer ser = new JavaScriptSerializer(); foreach (var prop in GetType().GetProperties()) { switch (prop.Name) { case "Name": options.AddOption("ConfigName", Name); // Add config name into the option for use in the exporter break; case "IFCVersion": options.FileVersion = IFCVersion; break; case "ActivePhaseId": if (IFCPhaseAttributes.Validate(ActivePhaseId)) { options.AddOption(prop.Name, ActivePhaseId.ToString()); } break; case "SpaceBoundaries": options.SpaceBoundaryLevel = SpaceBoundaries; break; case "SplitWallsAndColumns": options.WallAndColumnSplitting = SplitWallsAndColumns; break; case "ExportBaseQuantities": options.ExportBaseQuantities = ExportBaseQuantities; break; case "ProjectAddress": string projectAddrJsonString = ser.Serialize(ProjectAddress); options.AddOption(prop.Name, projectAddrJsonString); break; case "ClassificationSettings": string classificationJsonStr = ser.Serialize(ClassificationSettings); options.AddOption(prop.Name, classificationJsonStr); break; default: var propVal = prop.GetValue(this, null); if (propVal != null) { options.AddOption(prop.Name, propVal.ToString()); } break; } } options.FilterViewId = VisibleElementsOfCurrentView ? filterViewId : ElementId.InvalidElementId; string uiVersion = IFCUISettings.GetAssemblyVersion(); options.AddOption("AlternateUIVersion", uiVersion); }