├── .gitattributes ├── .github └── workflows │ ├── automatic_build_in_release_config.yml │ └── manual_build.yaml ├── .gitignore ├── .gitlab ├── .gitkeep └── issue_templates │ ├── .gitkeep │ └── issue_template.md ├── BIMGISInteropLibs ├── ALKIS │ ├── AX_Object.cs │ ├── AlkisReader.cs │ ├── Alkis_Sem_Reader.cs │ └── Alkis_Semantic.cs ├── BIMGISInteropLibs.csproj ├── City2BIM_prop.cs ├── CityGML │ ├── CityGMLReader.cs │ ├── CityGMLReaderTerrain.cs │ ├── CityGml_Bldg.cs │ ├── CityGml_BldgPart.cs │ ├── CityGml_Codelist.cs │ └── CityGml_Surface.cs ├── DD_BIM_ICON.ico ├── DD_BIM_LOGO.ico ├── DXF │ └── ReaderTerrain.cs ├── EPSG │ ├── Datum.cs │ ├── GeodeticCRS.cs │ └── ProjCRS.cs ├── ElevationGrid │ └── ReaderTerrain.cs ├── GEOgraf │ └── ReaderTerrain.cs ├── GdalConfiguration.cs ├── GeoJSON │ └── ReaderTerrain.cs ├── Geometry │ ├── C2BEdge.cs │ ├── C2BPlane.cs │ ├── C2BPoint.cs │ ├── C2BSegment.cs │ ├── C2BSolid.cs │ ├── C2BVertex.cs │ └── terrain.cs ├── IFC │ ├── Ifc2x3 │ │ ├── GeometricCurveSet.cs │ │ ├── InitModel.cs │ │ ├── LoGeoRef │ │ │ ├── Level30.cs │ │ │ └── Level40.cs │ │ ├── PropertySet.cs │ │ ├── ShapeRepresentation.cs │ │ ├── ShellBasedSurfaceModel.cs │ │ ├── Site.cs │ │ └── Store.cs │ ├── Ifc4 │ │ ├── Breakline.cs │ │ ├── GeometricCurveSet.cs │ │ ├── InitModel.cs │ │ ├── LoGeoRef │ │ │ ├── Level30.cs │ │ │ ├── Level40.cs │ │ │ └── Level50.cs │ │ ├── PropertySet.cs │ │ ├── ShapeRepresentation.cs │ │ ├── ShellBasedSurfaceModel.cs │ │ ├── Site.cs │ │ ├── Store.cs │ │ ├── Terrain.cs │ │ ├── TriangulatedFaceSet.cs │ │ └── TriangulatedIrregularNetwork.cs │ ├── Ifc4dot3 │ │ └── Dummy.cs │ ├── WriteInput.cs │ └── utils.cs ├── IFCTerrain │ ├── Common.cs │ ├── Config.cs │ ├── ConnectionInterface.cs │ ├── Result.cs │ ├── configDin18740.cs │ └── configDin91391.cs ├── LandXML │ └── ReaderTerrain.cs ├── Logging │ ├── LogPair.cs │ ├── LogWriter.cs │ └── LogWriterIfcTerrain.cs ├── NTS │ └── IfcTerrainTriangulator.cs ├── OGR │ ├── GeoObject.cs │ ├── OGRALKISReader.cs │ ├── OGRGMLReader.cs │ ├── OGRReader.cs │ └── OGRUtils.cs ├── PostGIS │ └── ReaderTerrain.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── README.md ├── REB │ └── ReaderTerrain.cs ├── Resources │ ├── LandingPage │ │ ├── BMWi_4C_Gef_en.jpg │ │ ├── logo_htwdd.jpg │ │ └── vcs.png │ ├── XPlan_32px.png │ ├── ZukunftBauAsJSON.json │ ├── aaa.json │ ├── aaaNeu.json │ └── xplan.json ├── RvtTerrain │ └── ConnectionInterface.cs ├── Semantic │ ├── City_Semantic.cs │ ├── ReadSemValues.cs │ ├── Read_GmlDictionary.cs │ └── Xml_AttrRep.cs ├── Triangulator │ └── DelaunayTriangulation.cs ├── WFS │ └── WFSClient.cs ├── XPlanung │ ├── XPlanungReader.cs │ └── XPlanung_Object.cs ├── app.config └── packages.config ├── BimGisCad ├── Attribute.cs ├── BimGisCad.csproj ├── Collections │ ├── Mesh.cs │ ├── MeshHe2.cs │ ├── PriorityQueue.cs │ ├── UniqueCollection.cs │ ├── UniqueList.cs │ └── UniquePointList.cs ├── Object.cs ├── Project.cs ├── Properties │ └── PublishProfiles │ │ └── FolderProfile.pubxml ├── RelationShip.cs ├── Representation │ ├── Context.cs │ ├── Geometry │ │ ├── Axis.cs │ │ ├── Axis1Placement.cs │ │ ├── Axis2Placement2D.cs │ │ ├── Axis2Placement3D.cs │ │ ├── Composed │ │ │ ├── LinearRing2.cs │ │ │ ├── MultiPoint2.cs │ │ │ ├── PolyLine2.cs │ │ │ ├── PolyLine3.cs │ │ │ ├── Segment2.cs │ │ │ └── Tin.cs │ │ ├── Elementary │ │ │ ├── Common.cs │ │ │ ├── Direction2.cs │ │ │ ├── Direction3.cs │ │ │ ├── Line2.cs │ │ │ ├── Line3.cs │ │ │ ├── Plane.cs │ │ │ ├── Point1.cs │ │ │ ├── Point2.cs │ │ │ ├── Point3.cs │ │ │ ├── Quaternion.cs │ │ │ ├── Vector1.cs │ │ │ ├── Vector2.cs │ │ │ └── Vector3.cs │ │ ├── Linear │ │ │ ├── ILinear.cs │ │ │ ├── Solve2.cs │ │ │ ├── Solve3.cs │ │ │ └── Solve4.cs │ │ └── Side.cs │ ├── IRepresentation.cs │ └── Topology │ │ ├── Edge.cs │ │ ├── Face.cs │ │ ├── Shell.cs │ │ └── Vertex.cs ├── Root.cs └── Unique.cs ├── CityBIM ├── Builder │ ├── CityBuilder.cs │ ├── GeoObjectBuilder.cs │ ├── RevitBuilder.cs │ ├── RevitTopoSurfaceBuilder.cs │ └── Revit_Semantic.cs ├── Calc │ ├── ConvexHull.cs │ └── UTMcalc.cs ├── CityBIM.addin ├── CityBIM.csproj ├── DD_BIM_ICON.ico ├── GUI │ ├── City2BIM │ │ ├── CityGML_ImportUI.xaml │ │ ├── CityGML_ImportUI.xaml.cs │ │ ├── Cmd_ImportCityGML.cs │ │ └── Prop_CityGML_settings.cs │ ├── Cmd_Documentation.cs │ ├── Cmd_LogFile.cs │ ├── DTM2BIM │ │ ├── Cmd_ReadTerrain.cs │ │ ├── Terrain_ImportUI.xaml │ │ └── Terrain_ImportUI.xaml.cs │ ├── Georeferencing │ │ ├── Cmd_GeoRefUI.cs │ │ ├── GeoRefViewModel.cs │ │ ├── NewGeoRefWindow.xaml │ │ ├── NewGeoRefWindow.xaml.cs │ │ ├── Prop_GeoRefSettings.cs │ │ └── img │ │ │ ├── Georef_96dpi.png │ │ │ ├── icon_georef10.png │ │ │ ├── icon_georef20.png │ │ │ └── icon_georef50.png │ ├── IFCExport │ │ ├── Cmd_ExportIFC.cs │ │ ├── IfcExportDialog.xaml │ │ └── IfcExportDialog.xaml.cs │ ├── Modify │ │ ├── Cmd_HideLayers.cs │ │ ├── LayerSelector.xaml │ │ └── LayerSelector.xaml.cs │ ├── NAS2BIM │ │ ├── Cmd_ReadALKIS.cs │ │ ├── ImportDialogAlkis.xaml │ │ ├── ImportDialogAlkis.xaml.cs │ │ └── Prop_NAS_settings.cs │ ├── Properties │ │ ├── Cmd_properties.cs │ │ ├── PropertyWindow.xaml │ │ └── PropertyWindow.xaml.cs │ ├── UI_PlugIn.cs │ └── XPlan2BIM │ │ ├── Cmd_ImportXPlan.cs │ │ ├── ImportXPlanDialog.xaml │ │ └── ImportXPlanDialog.xaml.cs ├── IFCExport │ ├── IfcUtils.cs │ └── RevitGeoIfcExporter.cs ├── Prop_Revit.cs ├── Properties │ └── launchSettings.json ├── Reader │ └── ReadCityGML.cs ├── ResourcePictures.Designer.cs ├── ResourcePictures.resx ├── img │ ├── ALKIS_32px_96dpi.png │ ├── ALKISset_32px.png │ ├── Attribute32.png │ ├── DD_BIM_ICON.ico │ ├── DD_BIM_LOGO.ico │ ├── DD_BIM_LOGO.png │ ├── DTM_32px_96dpi.png │ ├── Georef_32px_96dpi.png │ ├── HelpIcon_32px.png │ ├── HideLayerIcon_32px_96dpi.ico │ ├── HideLayerIcon_32px_96dpi.png │ ├── IFC_32px_96dpi.ico │ ├── IFC_32px_96dpi.png │ ├── LogIcon.png │ ├── Vermesser32.png │ ├── XPlan_32px.ico │ ├── XPlan_32px.png │ ├── citygml_32px_96dpi.png │ ├── citygml_set_32px.png │ ├── loginIcon32.png │ ├── overViewIcon.png │ └── queryDataCat.png └── utils.cs ├── CityBIM_InstallerWix4 ├── CityBIMLicense.rtf ├── CityBIM_InstallerWix4.wixproj └── Package.wxs ├── CommonRevit ├── BaseViewModel.cs ├── CommonRevit.projitems ├── CommonRevit.shproj ├── DelegateCommand.cs ├── IFC │ ├── IfcUtils.cs │ └── RevitIfcExporter.cs └── Semantics │ ├── AttributeContainer.cs │ └── SchemaUtils.cs ├── DataCatPlugin ├── DataCatPlugin.addin ├── DataCatPlugin.csproj ├── ExternalDataCatalog │ ├── DataGridEntry.cs │ ├── ExternalDataClient.cs │ ├── ExternalDataEditorContainer.cs │ ├── ExternalDataSchemaObject.cs │ ├── ExternalDataUtils.cs │ ├── IfcClassification.cs │ └── IfcClassificationReference.cs ├── GUI │ ├── Cmd_DataCatLogin.cs │ ├── Cmd_DataCatOverview.cs │ ├── Cmd_DataCatSubjQuery.cs │ ├── Cmd_ExportIFC.cs │ ├── Cmd_LogFile.cs │ ├── DataCatOverview.xaml │ ├── DataCatOverview.xaml.cs │ ├── DataCatPropertySetterWindow.xaml │ ├── DataCatPropertySetterWindow.xaml.cs │ ├── DataCatalogEditorWindow.xaml │ ├── DataCatalogEditorWindow.xaml.cs │ ├── IfcExportDialog.xaml │ ├── IfcExportDialog.xaml.cs │ ├── LoginScreen.xaml │ ├── LoginScreen.xaml.cs │ ├── findSubjectResultForm.xaml │ └── findSubjectResultForm.xaml.cs ├── IFCExport │ └── ExternalDataIfcExporter.cs ├── ResourceImages.Designer.cs ├── ResourceImages.resx ├── Settings │ └── Connection.cs ├── UI_Plugin.cs └── img │ ├── IFC_32px_96dpi.png │ ├── LogIcon.png │ ├── loginIcon32.png │ ├── overViewIcon.png │ └── queryDataCat.png ├── DataCatPlugin_Installer ├── DataCatPluginLicense.rtf ├── DataCatPlugin_Installer.wixproj └── Package.wxs ├── DataCatPlugin_Installer__new ├── DataCatPluginLicense.rtf ├── DataCat_Rvt2023_Installer.msi ├── DataCat_Rvt2023_Installer.wixpdb └── Package.wxs ├── GeospatialEngineeringBIM.sln ├── GuiHandler ├── GuiHandler.csproj ├── GuiSupport.cs ├── Properties │ └── AssemblyInfo.cs ├── app.config ├── packages.config └── userControler │ ├── CityGML │ ├── Read.xaml │ └── Read.xaml.cs │ ├── Dxf │ ├── Read.xaml │ └── Read.xaml.cs │ ├── GeoJSON │ ├── Read.xaml │ └── Read.xaml.cs │ ├── Grafbat │ ├── Read.xaml │ └── Read.xaml.cs │ ├── Grid │ ├── Read.xaml │ └── Read.xaml.cs │ ├── InformationPanel.xaml │ ├── InformationPanel.xaml.cs │ ├── PostGIS │ ├── Read.xaml │ └── Read.xaml.cs │ ├── Reb │ ├── Read.xaml │ └── Read.xaml.cs │ ├── UILog.xaml │ ├── UILog.xaml.cs │ ├── XML │ ├── Read.xaml │ └── Read.xaml.cs │ ├── ucCRS.xaml │ ├── ucCRS.xaml.cs │ ├── ucFacesPoints.xaml │ └── ucFacesPoints.xaml.cs ├── IFCGeoRefCheckerCommand ├── CommandLineOptions.cs ├── IFCGeoRefCheckerCommand.csproj └── Program.cs ├── IFCGeoRefCheckerGUI ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── DelegateCommand.cs ├── IFCGeoRefCheckerGUI.csproj ├── IfcCheckerService.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Messaging │ ├── EventAggregator.cs │ ├── IEventAggregator.cs │ ├── SelectedPathMessageObject.cs │ ├── SelectedWorkingDirMessageObject.cs │ └── Subscription.cs ├── Properties │ ├── Resources.Designer.cs │ ├── Resources.de.Designer.cs │ ├── Resources.de.resx │ ├── Resources.es.Designer.cs │ ├── Resources.es.resx │ ├── Resources.fr.Designer.cs │ ├── Resources.fr.resx │ ├── Resources.it.Designer.cs │ ├── Resources.it.resx │ ├── Resources.pt.Designer.cs │ ├── Resources.pt.resx │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Readme.txt ├── ResxConverter.cs ├── UpdateGeoRefWindow.xaml ├── UpdateGeoRefWindow.xaml.cs ├── UserController │ ├── FilePanel.xaml │ ├── FilePanel.xaml.cs │ ├── SetWorkingDirectory.xaml │ └── SetWorkingDirectory.xaml.cs ├── ValueConverters │ ├── AddressConverter.cs │ ├── InputValidations.cs │ ├── Level10UI.cs │ ├── Level20UI.cs │ ├── Level50UI.cs │ ├── LevelsConverter.cs │ ├── RefEntityGUIDConverter.cs │ └── RefEntityTypeConverter.cs ├── ViewModels │ ├── BaseViewModel.cs │ ├── CheckViewModel.cs │ ├── FilePanelViewModel.cs │ ├── MainWindowViewModel.cs │ ├── UpdateViewModel.cs │ └── WorkingDirViewModel.cs └── images │ ├── DD-BIM-ICON.ico │ ├── DD-BIM-LOGO.png │ ├── LBDB_Logo.jpg │ └── LBDB_Logo.png ├── IFCGeorefShared ├── GeoRefChecker.cs ├── IFCGeorefShared.projitems ├── IFCGeorefShared.shproj ├── Levels │ ├── Level00.cs │ ├── Level10.cs │ ├── Level20.cs │ ├── Level30.cs │ ├── Level40.cs │ └── Level50.cs ├── Settings.cs ├── Shapefiles │ └── Regions │ │ ├── ne_10m_admin_1_states_provinces.README.html │ │ ├── ne_10m_admin_1_states_provinces.VERSION.txt │ │ ├── ne_10m_admin_1_states_provinces.cpg │ │ ├── ne_10m_admin_1_states_provinces.dbf │ │ ├── ne_10m_admin_1_states_provinces.prj │ │ ├── ne_10m_admin_1_states_provinces.shp │ │ └── ne_10m_admin_1_states_provinces.shx └── TranslationService.cs ├── IFCTerrainCommand ├── App.config ├── DD_BIM_ICON.ico ├── IFCTerrainCommand.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs └── packages.config ├── IFCTerrainGUI ├── App.config ├── App.xaml ├── App.xaml.cs ├── GUI │ └── ExportSettings │ │ ├── LoGeoRef │ │ ├── LoGeoRef50_CRS_Metadata.xaml │ │ ├── LoGeoRef50_CRS_Metadata.xaml.cs │ │ ├── ucLoGeoRef.xaml │ │ └── ucLoGeoRef.xaml.cs │ │ ├── Metadata │ │ ├── metadata_din_18740_6.xaml │ │ ├── metadata_din_18740_6.xaml.cs │ │ ├── metadata_din_spec_91391_2.xaml │ │ ├── metadata_din_spec_91391_2.xaml.cs │ │ ├── ucMetaIfcJson.xaml │ │ ├── ucMetaIfcJson.xaml.cs │ │ ├── ucMetaIfcProject.xaml │ │ ├── ucMetaIfcProject.xaml.cs │ │ ├── ucMetaIfcPropertySets.xaml │ │ ├── ucMetaIfcPropertySets.xaml.cs │ │ ├── ucMetaJson.xaml │ │ └── ucMetaJson.xaml.cs │ │ ├── ucIfcVersionShape.xaml │ │ └── ucIfcVersionShape.xaml.cs ├── IFCTerrainGUI.csproj ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── DDBIM_Logo.ico │ ├── DDBIM_Logo.png │ ├── DD_BIM_ICON.ico │ └── DD_BIM_LOGO.png └── packages.config ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/workflows/automatic_build_in_release_config.yml: -------------------------------------------------------------------------------- 1 | name: automatic_build_in_release_config 2 | 3 | on: 4 | push 5 | 6 | jobs: 7 | build: 8 | 9 | runs-on: windows-latest 10 | 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v3 14 | 15 | - name: Setup MSBuild 16 | uses: microsoft/setup-msbuild@v1.1 17 | 18 | - name: Navigate to Workspace 19 | run: cd $GITHUB_WORKSPACE 20 | 21 | - name: Restore Packages 22 | run: nuget restore GeospatialEngineeringBIM.sln 23 | 24 | - name: Build Solution 25 | run: msbuild.exe -restore GeospatialEngineeringBIM.sln /p:Configuration=Release 26 | 27 | - name: Upload DataCatInstaller 28 | uses: actions/upload-artifact@v3 29 | with: 30 | name: DataCatPluginInstaller 31 | path: ./DataCatPlugin_Installer/bin/x64/Release/DataCatPlugin_Installer.msi 32 | 33 | - name: Upload CityBIMInstaller 34 | uses: actions/upload-artifact@v3 35 | with: 36 | name: CityBIMInstaller 37 | path: ./CityBIM_InstallerWix4/bin/x64/Release/CityBIM_InstallerWix4.msi 38 | 39 | - name: Upload IfcGeoRefChecker 40 | uses: actions/upload-artifact@v3 41 | with: 42 | name: IfcGeoRefCheckerGUI 43 | path: ./IFCGeoRefCheckerGUI/bin/Release/net6.0-windows/ 44 | 45 | - name: CreateZipDestination 46 | run: mkdir CheckerZipped 47 | 48 | - name: ZipOutput 49 | run: Compress-Archive -Path ./IFCGeoRefCheckerGUI/bin/Release/net6.0-windows -DestinationPath ./CheckerZipped/IFCGeoRefChecker.zip 50 | 51 | - name: Create GitHub release 52 | uses: softprops/action-gh-release@v1 53 | with: 54 | files: | 55 | ./DataCatPlugin_Installer/bin/x64/Release/DataCatPlugin_Installer.msi 56 | ./CityBIM_InstallerWix4/bin/x64/Release/CityBIM_InstallerWix4.msi 57 | ./CheckerZipped/IFCGeoRefChecker.zip 58 | 59 | name: Automatic release from action run ${{ github.run_number }} 60 | tag_name: ${{github.run_number}} 61 | -------------------------------------------------------------------------------- /.github/workflows/manual_build.yaml: -------------------------------------------------------------------------------- 1 | name: manual_build 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: Housekeeping 7 | 8 | jobs: 9 | build: 10 | 11 | runs-on: windows-latest 12 | 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v3 16 | with: 17 | ref: 'Housekeeping' 18 | 19 | - name: Setup MSBuild 20 | uses: microsoft/setup-msbuild@v1.1 21 | 22 | - name: Navigate to Workspace 23 | run: cd $GITHUB_WORKSPACE 24 | 25 | - name: Restore Packages 26 | run: nuget restore GeospatialEngineeringBIM.sln 27 | 28 | - name: Build Solution 29 | run: msbuild.exe -restore GeospatialEngineeringBIM.sln /p:Configuration=Release 30 | 31 | - name: Upload DataCatInstaller 32 | uses: actions/upload-artifact@v3 33 | with: 34 | name: DataCatPluginInstaller 35 | path: ./DataCatPlugin_Installer/bin/x64/Release/DataCatPlugin_Installer.msi 36 | 37 | - name: Upload CityBIMInstaller 38 | uses: actions/upload-artifact@v3 39 | with: 40 | name: CityBIMInstaller 41 | path: ./CityBIM_InstallerWix4/bin/x64/Release/CityBIM_InstallerWix4.msi 42 | -------------------------------------------------------------------------------- /.gitlab/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/.gitlab/.gitkeep -------------------------------------------------------------------------------- /.gitlab/issue_templates/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/.gitlab/issue_templates/.gitkeep -------------------------------------------------------------------------------- /.gitlab/issue_templates/issue_template.md: -------------------------------------------------------------------------------- 1 | ## Erwartetes Verhalten 2 | 3 | Kurze Erklärung, was die erwartete Reaktion der Software sein sollte 4 | 5 | 6 | 7 | ## Momentanes Verhalten 8 | 9 | Kurze Erklärung, was stattdessen passiert 10 | 11 | 12 | 13 | ## Mögliche Lösung 14 | 15 | Nicht zwingend erforderlich, aber falls eine mögliche Lösung vorliegt, bitte hier kurz erklären 16 | 17 | 18 | 19 | ## Schritte zum Reproduzieren des Problems 20 | 21 | Bitte eine detaillierte Auflistung der durchgeführten Schritte bis zum Auftreten des Problems aufstellen, falls notwendig auch mit Nennung des Datensatzes 22 | 23 | 1. 24 | 25 | 2. 26 | 27 | 3. 28 | 29 | 4. 30 | 31 | 32 | 33 | ## Sonstiges 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/City2BIM_prop.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace BIMGISInteropLibs 3 | { 4 | public static class City2BIM_prop 5 | { 6 | //user-defined geometry quality values 7 | private static double equalPtSq = 0.000001; //1mm^2! 8 | private static double equalPlSq = 0.0025; //5cm^2! 9 | private static double maxDevPlaneCutSq = 0.0025; //5cm^2! //will try to fulfill requirements but in some cases failed, see Solid calculation 10 | 11 | public static double MaxDevPlaneCutSq { get => maxDevPlaneCutSq; set => maxDevPlaneCutSq = value; } 12 | public static double EqualPtSq { get => equalPtSq; set => equalPtSq = value; } 13 | public static double EqualPlSq { get => equalPlSq; set => equalPlSq = value; } 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/CityGML/CityGml_Bldg.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using BIMGISInteropLibs.Geometry; 3 | using BIMGISInteropLibs.Semantic; 4 | 5 | namespace BIMGISInteropLibs.CityGML 6 | { 7 | public class CityGml_Bldg 8 | { 9 | private string bldgId; 10 | private Dictionary bldgAttributes; 11 | private List parts; 12 | private List bldgSurfaces; 13 | private C2BSolid bldgSolid; 14 | private string lod; 15 | private List logEntries; 16 | 17 | public string BldgId 18 | { 19 | get 20 | { 21 | return bldgId; 22 | } 23 | 24 | set 25 | { 26 | bldgId = value; 27 | } 28 | } 29 | 30 | public Dictionary BldgAttributes 31 | { 32 | get 33 | { 34 | return bldgAttributes; 35 | } 36 | 37 | set 38 | { 39 | bldgAttributes = value; 40 | } 41 | } 42 | 43 | public List Parts 44 | { 45 | get 46 | { 47 | return parts; 48 | } 49 | 50 | set 51 | { 52 | parts = value; 53 | } 54 | } 55 | 56 | public C2BSolid BldgSolid 57 | { 58 | get 59 | { 60 | return bldgSolid; 61 | } 62 | 63 | set 64 | { 65 | bldgSolid = value; 66 | } 67 | } 68 | 69 | public List BldgSurfaces 70 | { 71 | get 72 | { 73 | return bldgSurfaces; 74 | } 75 | 76 | set 77 | { 78 | bldgSurfaces = value; 79 | } 80 | } 81 | 82 | public string Lod { get => lod; set => lod = value; } 83 | public List LogEntries { get => logEntries; set => logEntries = value; } 84 | public enum LodRep { LOD1, LOD2, LOD1_Fallback, LOD2_Fallback, unknown } 85 | } 86 | 87 | 88 | 89 | } -------------------------------------------------------------------------------- /BIMGISInteropLibs/CityGML/CityGml_BldgPart.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using BIMGISInteropLibs.Geometry; 3 | using BIMGISInteropLibs.Semantic; 4 | 5 | namespace BIMGISInteropLibs.CityGML 6 | { 7 | public class CityGml_BldgPart 8 | { 9 | private string bldgPartId; 10 | private Dictionary bldgPartAttributes; 11 | private List partSurfaces; 12 | private C2BSolid partSolid; 13 | private string lod; 14 | 15 | public string BldgPartId 16 | { 17 | get 18 | { 19 | return bldgPartId; 20 | } 21 | 22 | set 23 | { 24 | bldgPartId = value; 25 | } 26 | } 27 | 28 | public C2BSolid PartSolid 29 | { 30 | get 31 | { 32 | return partSolid; 33 | } 34 | 35 | set 36 | { 37 | partSolid = value; 38 | } 39 | } 40 | 41 | public Dictionary BldgPartAttributes 42 | { 43 | get 44 | { 45 | return bldgPartAttributes; 46 | } 47 | 48 | set 49 | { 50 | bldgPartAttributes = value; 51 | } 52 | } 53 | 54 | public string Lod { get => lod; set => lod = value; } 55 | 56 | public List PartSurfaces 57 | { 58 | get 59 | { 60 | return partSurfaces; 61 | } 62 | 63 | set 64 | { 65 | partSurfaces = value; 66 | } 67 | } 68 | 69 | //public GmlBldgPart(XElement gmlBldgPart) { } 70 | 71 | //public void CreateSolid() 72 | } 73 | } -------------------------------------------------------------------------------- /BIMGISInteropLibs/CityGML/CityGml_Surface.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using BIMGISInteropLibs.Geometry; 7 | using BIMGISInteropLibs.Semantic; 8 | 9 | namespace BIMGISInteropLibs.CityGML 10 | { 11 | public class CityGml_Surface 12 | { 13 | private Guid internalID; 14 | private string surfaceId; 15 | private FaceType facetype; 16 | private Dictionary surfaceAttributes; 17 | private List exteriorPts; 18 | private List> interiorPts; 19 | 20 | public Guid InternalID { get => internalID; } 21 | 22 | public CityGml_Surface() 23 | { 24 | internalID = Guid.NewGuid(); 25 | } 26 | 27 | public string SurfaceId 28 | { 29 | get 30 | { 31 | return surfaceId; 32 | } 33 | 34 | set 35 | { 36 | surfaceId = value; 37 | } 38 | } 39 | 40 | public Dictionary SurfaceAttributes 41 | { 42 | get 43 | { 44 | return surfaceAttributes; 45 | } 46 | 47 | set 48 | { 49 | surfaceAttributes = value; 50 | } 51 | } 52 | 53 | public FaceType Facetype 54 | { 55 | get 56 | { 57 | return facetype; 58 | } 59 | 60 | set 61 | { 62 | facetype = value; 63 | } 64 | } 65 | 66 | public List> InteriorPts { get => interiorPts; set => interiorPts = value; } 67 | //public List> InteriorPts { get => interiorPts; set => interiorPts = null; } 68 | 69 | public List ExteriorPts { get => exteriorPts; set => exteriorPts = value; } 70 | 71 | public enum FaceType { roof, wall, ground, closure, outerCeiling, outerFloor, unknown } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/DD_BIM_ICON.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/DD_BIM_ICON.ico -------------------------------------------------------------------------------- /BIMGISInteropLibs/DD_BIM_LOGO.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/DD_BIM_LOGO.ico -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/C2BEdge.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace BIMGISInteropLibs.Geometry 8 | { 9 | public class C2BEdge 10 | { 11 | private int start; 12 | private int end; 13 | private C2BPoint planeNormal; 14 | private string planeId; 15 | 16 | public int Start { get => start; set => start = value; } 17 | public int End { get => end; set => end = value; } 18 | public C2BPoint PlaneNormal { get => planeNormal; set => planeNormal = value; } 19 | public string PlaneId { get => planeId; set => planeId = value; } 20 | 21 | public C2BEdge(int start, int end, string id, C2BPoint normal) 22 | { 23 | this.End = end; 24 | this.Start = start; 25 | this.PlaneId = id; 26 | this.PlaneNormal = normal; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/C2BPlane.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace BIMGISInteropLibs.Geometry 4 | 5 | { 6 | public class C2BPlane 7 | { 8 | private string id; 9 | private int[] vertices; 10 | private List innerVertices; 11 | private C2BPoint normal; 12 | private C2BPoint centroid; 13 | private List edges; 14 | 15 | public C2BPlane(string id, List vertices, List> innerVertices, C2BPoint normal, C2BPoint centroid, List edges) 16 | { 17 | this.id = id; 18 | this.vertices = vertices.ToArray(); 19 | 20 | List innerV = new List(); 21 | 22 | foreach (var innerPoly in innerVertices) 23 | { 24 | int[] innerPolyA = innerPoly.ToArray(); 25 | innerV.Add(innerPolyA); 26 | } 27 | this.innerVertices = innerV; 28 | 29 | this.normal = normal; 30 | this.centroid = centroid; 31 | this.edges = edges; 32 | } 33 | 34 | public C2BPlane(string _id, List _vertices, List _innerVertices, C2BPoint _normal, C2BPoint _centroid, List _edges) 35 | { 36 | this.id = _id; 37 | this.vertices = _vertices.ToArray(); 38 | this.innerVertices = _innerVertices; 39 | this.normal = _normal; 40 | this.centroid = _centroid; 41 | this.edges = _edges; 42 | } 43 | 44 | public int[] Vertices 45 | { 46 | get { return vertices; } 47 | set 48 | { 49 | this.vertices = value; 50 | } 51 | } 52 | 53 | public List InnerVertices 54 | { 55 | get { return innerVertices; } 56 | set 57 | { 58 | this.innerVertices = value; 59 | } 60 | } 61 | 62 | public string ID 63 | { 64 | get { return id; } 65 | set 66 | { 67 | this.id = value; 68 | } 69 | } 70 | 71 | public C2BPoint Normal 72 | { 73 | get { return normal; } 74 | set 75 | { 76 | this.normal = value; 77 | } 78 | } 79 | 80 | public C2BPoint Centroid 81 | { 82 | get { return centroid; } 83 | set 84 | { 85 | this.centroid = value; 86 | } 87 | } 88 | 89 | public List Edges { get => edges; set => edges = value; } 90 | } 91 | } -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/C2BPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BIMGISInteropLibs.Geometry 4 | { 5 | public class C2BPoint 6 | { 7 | public double X, Y, Z; 8 | 9 | public C2BPoint(double x, double y, double z) 10 | { 11 | X = x; 12 | Y = y; 13 | Z = z; 14 | } 15 | 16 | public static C2BPoint operator +(C2BPoint a, C2BPoint b) 17 | { 18 | return new C2BPoint(a.X + b.X, a.Y + b.Y, a.Z + b.Z); 19 | } 20 | 21 | public static C2BPoint operator -(C2BPoint a, C2BPoint b) 22 | { 23 | return new C2BPoint(a.X - b.X, a.Y - b.Y, a.Z - b.Z); 24 | } 25 | 26 | public static C2BPoint operator /(C2BPoint a, double b) 27 | { 28 | return new C2BPoint(a.X / b, a.Y / b, a.Z / b); 29 | } 30 | 31 | public static C2BPoint operator *(C2BPoint a, double b) 32 | { 33 | return new C2BPoint(a.X * b, a.Y * b, a.Z * b); 34 | } 35 | 36 | public static double MagnitudeSq(C2BPoint a) 37 | { 38 | return a.X * a.X + a.Y * a.Y + a.Z * a.Z; 39 | } 40 | 41 | public static C2BPoint CrossProduct(C2BPoint a, C2BPoint b) 42 | { 43 | return new C2BPoint(a.Y * b.Z - a.Z * b.Y, 44 | a.Z * b.X - a.X * b.Z, 45 | a.X * b.Y - a.Y * b.X); 46 | } 47 | 48 | public static C2BPoint Normalized(C2BPoint a) 49 | { 50 | double sum = Math.Sqrt(MagnitudeSq(a)); 51 | return a / sum; 52 | } 53 | 54 | public static double ScalarProduct(C2BPoint a, C2BPoint b) 55 | { 56 | return a.X * b.X + a.Y * b.Y + a.Z * b.Z; 57 | } 58 | 59 | public static bool CCW(C2BPoint p1, C2BPoint p2, C2BPoint p3, C2BPoint vecNormal) 60 | { 61 | var normal = new C2BPoint(0, 0, 0); 62 | normal += C2BPoint.CrossProduct(p1, p2); 63 | normal += C2BPoint.CrossProduct(p2, p3); 64 | normal += C2BPoint.CrossProduct(p3, p1); 65 | 66 | C2BPoint vecTri = C2BPoint.Normalized(normal); 67 | 68 | C2BPoint diffVec = vecTri - vecNormal; 69 | 70 | if (diffVec.X < 0.2 && diffVec.Y < 0.2 && diffVec.Z < 0.2) 71 | { 72 | return true; 73 | } 74 | return false; 75 | } 76 | 77 | public static double DistanceSq(C2BPoint a, C2BPoint b) 78 | { 79 | return MagnitudeSq(a - b); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/C2BSegment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace BIMGISInteropLibs.Geometry 8 | { 9 | public class C2BSegment 10 | { 11 | public bool isCurve; 12 | public C2BPoint startPoint; 13 | public C2BPoint endPoint; 14 | public C2BPoint midPoint; 15 | 16 | public C2BSegment(C2BPoint start, C2BPoint end, C2BPoint mid = null) 17 | { 18 | startPoint = start; 19 | endPoint = end; 20 | midPoint = mid; 21 | 22 | if (midPoint != null) 23 | { 24 | isCurve = true; 25 | } 26 | 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/C2BVertex.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace BIMGISInteropLibs.Geometry 4 | { 5 | /// 6 | /// Vertex or Node (Topological Point) 7 | /// 8 | public class C2BVertex 9 | { 10 | private C2BPoint position; 11 | HashSet planes; 12 | 13 | /// 14 | /// Create Vertex (Topological Point) 15 | /// 16 | /// /// Coordinate in XYZ 17 | /// /// Plane to add 18 | public C2BVertex(C2BPoint position) 19 | { 20 | this.position = position; 21 | this.planes = new HashSet(); 22 | } 23 | 24 | /// 25 | /// Add plane to vertex 26 | /// 27 | /// Plane to add 28 | public void AddPlane(string plane) 29 | { 30 | planes.Add(plane); 31 | } 32 | 33 | public C2BPoint Position 34 | { 35 | get { return position; } 36 | set { position = value; } 37 | } 38 | 39 | public HashSet Planes 40 | { 41 | get { return planes; } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Geometry/terrain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | //Logging 8 | using BIMGISInteropLibs.Logging; 9 | using LogWriter = BIMGISInteropLibs.Logging.LogWriterIfcTerrain; //to set log messages 10 | using NetTopologySuite.Geometries; 11 | 12 | namespace BIMGISInteropLibs.Geometry 13 | { 14 | public class terrain { 15 | 16 | /// 17 | /// add point to create a unique coord list 18 | /// 19 | public static int addPoint(HashSet points, Point p) 20 | { 21 | if (!points.Contains(p)) 22 | { 23 | points.Add(p); 24 | p.UserData = points.Count-1; 25 | LogWriter.Add(LogType.verbose, "[READER] Unique point (" + p.UserData + ") added."); 26 | return (int)p.UserData; 27 | } 28 | 29 | points.TryGetValue(p, out var pt); 30 | LogWriter.Add(LogType.verbose, "[READER] Found unique point (" + p.UserData + "). Nothing has been added"); 31 | return (int)pt.UserData; 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/IFC/Ifc2x3/LoGeoRef/Level30.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace BIMGISInteropLibs.IFC.Ifc2x3.LoGeoRef 8 | { 9 | //embed BimGisCad 10 | using BimGisCad.Representation.Geometry; 11 | 12 | //embed Xbim //below selected examples that show why these are included 13 | using Xbim.Ifc; //IfcStore 14 | using Xbim.Ifc2x3.GeometricConstraintResource; //IfcLocalPlacement 15 | using Xbim.Ifc2x3.GeometryResource; //IfcAxis2Placement3D 16 | 17 | class Level30 18 | { 19 | /// 20 | /// Creates the placement that will be used in the Ifc file 21 | /// Using concept level 30 22 | /// 23 | /// Location for all information that will be inserted into the IFC file 24 | /// placement generated by BimGisCad Bib 25 | /// IfcLocalPlacement (references IfcAxis2Placement3D (IfcCartesianPoint and 2x IfcDirection) 26 | public static IfcLocalPlacement Create(IfcStore model, Axis2Placement3D placement) 27 | { 28 | var lp = model.Instances.New(l => l.RelativePlacement = 29 | model.Instances.New(p => 30 | { 31 | p.Location = model.Instances.New(c => c.SetXYZ(placement.Location.X, placement.Location.Y, placement.Location.Z)); 32 | p.RefDirection = model.Instances.New(d => d.SetXYZ(placement.RefDirection.X, placement.RefDirection.Y, placement.RefDirection.Z)); 33 | p.Axis = model.Instances.New(a => a.SetXYZ(placement.Axis.X, placement.Axis.Y, placement.Axis.Z)); 34 | })); 35 | return lp; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/IFC/Ifc4/ShapeRepresentation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | //embed Xbim //below selected examples that show why these are included 8 | using Xbim.Ifc4.GeometryResource; //IfcGeometricRepresentationItem 9 | using Xbim.Ifc4.RepresentationResource; //IfcShapeRepresentation 10 | 11 | //Logging 12 | using BIMGISInteropLibs.Logging; //need for LogPair 13 | using LogWriter = BIMGISInteropLibs.Logging.LogWriterIfcTerrain; //to set log messages 14 | 15 | namespace BIMGISInteropLibs.IFC.Ifc4 16 | { 17 | /// 18 | /// class to create shape representation (IFC4) 19 | /// 20 | public class ShapeRepresentation 21 | { 22 | /// 23 | /// Passes the created shape to model 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | /// 30 | public static IfcShapeRepresentation Create(Xbim.Ifc.IfcStore model, IfcGeometricRepresentationItem item, RepresentationIdentifier identifier, RepresentationType type) 31 | { 32 | //begin a transaction 33 | using (var txn = model.BeginTransaction("Create Shaperepresentation")) 34 | { 35 | //Create a definition shape to hold the geometry 36 | var shape = model.Instances.New(s => 37 | { 38 | //get instance of the shape 39 | s.ContextOfItems = model.Instances.OfType().FirstOrDefault(); 40 | 41 | //write reprs type (REQUIRED) 42 | s.RepresentationType = type.ToString(); 43 | 44 | //write identifier (REQUIRED) 45 | s.RepresentationIdentifier = identifier.ToString(); 46 | 47 | //add repres items (TFS / GCS / SBSM) to shape 48 | s.Items.Add(item); 49 | }); 50 | 51 | //commit transaction 52 | txn.Commit(); 53 | LogWriter.Add(LogType.debug, "IFC shape representation commited."); 54 | //return shape 55 | return shape; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/IFC/Ifc4/Terrain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | //embed BimGisCad 8 | using BimGisCad.Representation.Geometry; 9 | 10 | //embed Xbim //below selected examples that show why these are included 11 | using Xbim.Ifc; //IfcStore 12 | using Xbim.Ifc4.MeasureResource; //Enumeration for Unit 13 | using Xbim.Ifc4.ProductExtension; //IfcSite 14 | using Xbim.Ifc4.Interfaces; //Enum for Units 15 | using Xbim.Ifc4.RepresentationResource; //IfcShapeRepresentation 16 | 17 | namespace BIMGISInteropLibs.IFC.Ifc4 18 | { 19 | /// 20 | /// 21 | /// 22 | public class Terrain 23 | { 24 | /// 25 | /// 26 | /// 27 | /// storage for the whole ifc file 28 | /// 29 | /// 30 | /// 31 | /// 32 | /// 33 | public static IfcGeographicElement Create(IfcStore model, IfcLabel name, IfcIdentifier tag, Axis2Placement3D placement, IfcShapeRepresentation representation) 34 | { 35 | //begin a transaction 36 | using (var txn = model.BeginTransaction("Create Terrain")) 37 | { 38 | // terrain 39 | var terrain = model.Instances.New(s => 40 | { 41 | s.Name = name; 42 | s.PredefinedType = IfcGeographicElementTypeEnum.TERRAIN; 43 | s.Tag = tag; 44 | placement = placement ?? Axis2Placement3D.Standard; 45 | s.ObjectPlacement = LoGeoRef.Level30.Create(model, placement); 46 | s.Representation = model.Instances.New(r => r.Representations.Add(representation)); 47 | }); 48 | 49 | //commit transaction 50 | txn.Commit(); 51 | 52 | return terrain; 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/IFC/Ifc4dot3/Dummy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace BIMGISInteropLibs.IFC 8 | { 9 | /// 10 | /// DUMMY CLASS for further processing with IFC terrain 11 | /// 12 | class Dummy 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/IFCTerrain/Common.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | //Include localization 8 | using System.Globalization; 9 | 10 | namespace BIMGISInteropLibs.IfcTerrain 11 | { 12 | public static class Common 13 | { 14 | public static readonly Dictionary ToMeter = new Dictionary() 15 | { 16 | ["millimeter"] = 0.001, 17 | ["centimeter"] = 0.01, 18 | ["kilometer"] = 1000.0, 19 | ["foot"] = 0.3048, 20 | ["inch"] = 0.0254, 21 | ["mile"] = 1609.34, 22 | ["ussurveyfoot"] = 1200.0 / 3937.0 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Logging/LogPair.cs: -------------------------------------------------------------------------------- 1 | namespace BIMGISInteropLibs.Logging 2 | { 3 | public class LogPair 4 | { 5 | private LogType type; 6 | private string message; 7 | 8 | public LogType Type { get => type; set => type = value; } 9 | public string Message { get => message; set => message = value; } 10 | 11 | public LogPair(LogType type, string message) 12 | { 13 | this.type = type; 14 | this.message = message; 15 | } 16 | } 17 | public enum LogType { verbose, debug, info, warning, error } 18 | } 19 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/OGR/GeoObject.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using OSGeo.OGR; 6 | 7 | using BIMGISInteropLibs.Geometry; 8 | 9 | namespace BIMGISInteropLibs.OGR 10 | { 11 | public class GeoObject 12 | { 13 | public string UsageType { get => usageType; } 14 | private string usageType { get; set; } 15 | 16 | //public enum GeomType { LINE, POLYGON, MULTIPOLYGON, CURVEDLINE } 17 | public OSGeo.OGR.wkbGeometryType GeomType; 18 | 19 | public OSGeo.OGR.Geometry Geom { get => geom; } 20 | private OSGeo.OGR.Geometry geom { get; set; } 21 | 22 | public string GmlID { get => gmlId; } 23 | private string gmlId { get; set; } 24 | 25 | //public List> Segments { get => segments; } 26 | 27 | //private List> segments { get; set; } 28 | 29 | public Dictionary Properties { get => properties; set => properties=value; } 30 | private Dictionary properties { get; set; } 31 | 32 | public GeoObject(string usageType, string gmlID, OSGeo.OGR.wkbGeometryType geomType, OSGeo.OGR.Geometry geom ,Dictionary properties) 33 | { 34 | this.usageType = usageType; 35 | this.gmlId = gmlID; 36 | this.GeomType = geomType; 37 | this.geom = geom; 38 | this.properties = properties; 39 | } 40 | 41 | /* 42 | public GeoObject(string usageType, string gmlID, OSGeo.OGR.wkbGeometryType GeomTyp, List> segments, Dictionary properties) 43 | { 44 | this.usageType = usageType; 45 | this.gmlId = gmlID; 46 | this.segments = segments; 47 | this.properties = properties; 48 | this.GeomType = GeomTyp; 49 | } 50 | */ 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/OGR/OGRGMLReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using OSGeo.OGR; 7 | 8 | namespace BIMGISInteropLibs.OGR 9 | { 10 | public class OGRGMLReader : OGRReader 11 | { 12 | //private DataSource ds; 13 | 14 | public OGRGMLReader(string filePath) 15 | { 16 | var nasDriver = Ogr.GetDriverByName("GML"); 17 | ds = nasDriver.Open(filePath, 0); 18 | } 19 | 20 | public override List getLayerList() 21 | { 22 | List layerList = new List(); 23 | 24 | for (int i = 0; i < ds.GetLayerCount(); i++) 25 | { 26 | if (ds.GetLayerByIndex(i).GetGeomType() != wkbGeometryType.wkbUnknown || ds.GetLayerByIndex(i).GetGeomType() != wkbGeometryType.wkbNone) 27 | { 28 | layerList.Add(ds.GetLayerByIndex(i).GetName()); 29 | } 30 | 31 | } 32 | 33 | //layerList = layerList.Where(item => LayerToProcess.Contains(item)).ToList(); 34 | 35 | return layerList; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("City2BIM")] 9 | [assembly: AssemblyDescription("Library for importing CityGML and Alkis data for the use for BIM plugins for Revit or for IFC")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Dresden, Faculty of Applied Sciences")] 12 | [assembly: AssemblyProduct("City2BIM")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1af486e9-ed18-492c-8400-3b446bc9390d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /BIMGISInteropLibs/README.md: -------------------------------------------------------------------------------- 1 | In this class library you can find the control classes for the processing. A distinction is made between: File formats or program structures used. Use this for orientation. For more information please use our wiki pages: [Link](https://github.com/dd-bim/City2BIM/wiki) -------------------------------------------------------------------------------- /BIMGISInteropLibs/Resources/LandingPage/BMWi_4C_Gef_en.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/Resources/LandingPage/BMWi_4C_Gef_en.jpg -------------------------------------------------------------------------------- /BIMGISInteropLibs/Resources/LandingPage/logo_htwdd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/Resources/LandingPage/logo_htwdd.jpg -------------------------------------------------------------------------------- /BIMGISInteropLibs/Resources/LandingPage/vcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/Resources/LandingPage/vcs.png -------------------------------------------------------------------------------- /BIMGISInteropLibs/Resources/XPlan_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/BIMGISInteropLibs/Resources/XPlan_32px.png -------------------------------------------------------------------------------- /BIMGISInteropLibs/Semantic/Read_GmlDictionary.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Class for reading of GmlDictionaries 3 | * 4 | * - not used in current implementation 5 | * - could be useful, if "hard-coded" CityGml-Codelist should not be used in future but reading of dictionaries in file system should be supported 6 | */ 7 | 8 | 9 | //using System; 10 | //using System.Collections.Generic; 11 | //using System.Linq; 12 | //using System.Xml.Linq; 13 | 14 | //namespace City2BIM.Semantic 15 | //{ 16 | // internal class Read_GmlDictionary 17 | // { 18 | // public Dictionary ReadCodes(string codeListPath) 19 | // { 20 | // XDocument xmlCodes = XDocument.Load(codeListPath); 21 | 22 | // var allns = xmlCodes.Root.Attributes(). 23 | // Where(a => a.IsNamespaceDeclaration). 24 | // GroupBy(a => a.Name.Namespace == XNamespace.None ? String.Empty : a.Name.LocalName, 25 | // a => XNamespace.Get(a.Value)). 26 | // ToDictionary(g => g.Key, 27 | // g => g.First()); 28 | 29 | // allns.TryGetValue("", out var namesp); 30 | 31 | // //Namespace teilweise in AdV-Codelisten für manche Tags nicht gesetzt 32 | // //Workaround: wenn namesp ohne name (""), dann verwende gml-namespace 33 | // if(namesp == null) 34 | // namesp = allns["gml"]; 35 | 36 | // var entries = xmlCodes.Descendants(namesp + "dictionaryEntry"); 37 | 38 | // Dictionary kvpCodes = new Dictionary(); 39 | 40 | // foreach(var en in entries) 41 | // { 42 | // var gmlNames = en.Descendants(allns["gml"] + "name"); 43 | // var gmlDescs = en.Descendants(allns["gml"] + "description");; 44 | 45 | // string code = "", desc = ""; 46 | 47 | // if(gmlNames.Count() > 1) //spezielle Implementierung für AdV-Codeliste 48 | // { 49 | // code = gmlNames.Where(c => c.HasAttributes).Select(c => c.Value).SingleOrDefault(); //Tag mit Attributen = Code 50 | // desc = gmlNames.Where(c => !c.HasAttributes).Select(c => c.Value).SingleOrDefault(); //Tag ohne Attribute = Description 51 | // } 52 | // else if(gmlDescs.Count() == 1 && gmlNames.Count() == 1) //Standard-Dictionary, zB SIG3D 53 | // { 54 | // code = gmlNames.SingleOrDefault().Value; 55 | // desc = gmlDescs.SingleOrDefault().Value; 56 | // } 57 | 58 | // kvpCodes.Add(code, desc); 59 | // } 60 | // return kvpCodes; 61 | // } 62 | // } 63 | //} -------------------------------------------------------------------------------- /BimGisCad/Attribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BimGisCad 6 | { 7 | /// 8 | /// Klasse für Attribute 9 | /// 10 | public class Attribute : Unique 11 | { 12 | /// 13 | /// Konstruktor 14 | /// 15 | /// 16 | /// 17 | public Attribute(string key, object value):base(key) 18 | { 19 | this.Value = value; 20 | } 21 | 22 | /// 23 | /// Schlüssel 24 | /// 25 | public string Key => this.Id; 26 | 27 | /// 28 | /// Wert 29 | /// 30 | public object Value { get; set; } 31 | 32 | /// 33 | /// Builder 34 | /// 35 | /// 36 | /// 37 | /// 38 | public static Attribute Create(string key, object value) => new Attribute(key, value); 39 | 40 | /// 41 | /// Builder 42 | /// 43 | /// 44 | /// 45 | public static Attribute Create(Attribute attribute) => new Attribute(attribute.Key, attribute.Value); 46 | 47 | /// 48 | /// Builder 49 | /// 50 | /// 51 | /// 52 | /// 53 | public static Attribute CreateWithValue(Attribute attribute, object value) => new Attribute(attribute.Key, value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /BimGisCad/BimGisCad.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | latest 6 | Bibliothek zum Konvertieren von Daten verschiedener Konzepte (BIM - GIS -CAD) 7 | Struktur, Namen und Funktionalität sind an die ISO 10303 angelehnt. 8 | HTW 9 | Enrico Romanschek 10 | AnyCPU;x64 11 | 1.0.6 12 | 13 | 14 | 15 | 16 | x64 17 | 18 | 19 | 20 | 21 | DEBUG;TRACE 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /BimGisCad/Object.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using BimGisCad.Collections; 5 | using BimGisCad.Representation; 6 | 7 | namespace BimGisCad 8 | { 9 | /// 10 | /// Eigenständiges Objekt 11 | /// 12 | public class Object : Root 13 | { 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | public Object(string id, string name, UniqueCollection attributes = null) : base(id, name, attributes) 21 | { 22 | this.Representations = new Dictionary(); 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | public Dictionary Representations { get; } 29 | 30 | /// 31 | /// 32 | /// 33 | /// 34 | /// 35 | /// 36 | /// 37 | public static Object Create(string id, string name, UniqueCollection attributes = null) => new Object(id, name, attributes); 38 | 39 | /// 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | public static Object Create(string name, UniqueCollection attributes = null) => new Object(null, name, attributes); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /BimGisCad/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | FileSystem 8 | Release 9 | Any CPU 10 | netstandard2.0 11 | D:\Nuget 12 | 13 | -------------------------------------------------------------------------------- /BimGisCad/RelationShip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using BimGisCad.Collections; 5 | 6 | namespace BimGisCad 7 | { 8 | /// 9 | /// Beziehung zwischen Objekten 10 | /// 11 | public class RelationShip:Root 12 | { 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | public RelationShip(string id, string name, UniqueCollection attributes, Object relating, UniqueCollection related = null) :base(id, name, attributes) 22 | { 23 | this.Relating = relating; 24 | this.Related = related ?? UniqueCollection.Create(); 25 | } 26 | 27 | /// 28 | /// 29 | /// 30 | public Object Relating { get; set; } 31 | 32 | /// 33 | /// 34 | /// 35 | public UniqueCollection Related { get; } 36 | 37 | /// 38 | /// 39 | /// 40 | /// 41 | /// 42 | /// 43 | /// 44 | /// 45 | /// 46 | public static RelationShip Create(string id, string name, UniqueCollection attributes, Object relating, UniqueCollection related = null) => new RelationShip(id, name, attributes, relating, related); 47 | 48 | /// 49 | /// 50 | /// 51 | /// 52 | /// 53 | /// 54 | /// 55 | public static RelationShip Create(string name, Object relating, UniqueCollection related = null) => new RelationShip(null, name, null, relating, related); 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /BimGisCad/Representation/Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using BimGisCad.Representation.Geometry; 5 | 6 | namespace BimGisCad.Representation 7 | { 8 | /// 9 | /// Übergeordneter Rahmen 10 | /// 11 | public class Context 12 | { 13 | private double precision; 14 | 15 | 16 | /// 17 | /// 18 | /// 19 | /// 20 | /// 21 | public Context(Axis2Placement3D placement, double precision = 1.0e-6) 22 | { 23 | this.Placement = placement; 24 | this.Precision = precision; 25 | this.PrecisionSquared = precision * precision; 26 | } 27 | 28 | 29 | /// 30 | /// Übergeordnetes "Vermessungs"-Koordinatensystem 31 | /// 32 | public Axis2Placement3D Placement { get; set; } 33 | 34 | /// 35 | /// minimaler Streckenunterschied 36 | /// 37 | public double Precision 38 | { 39 | get 40 | { 41 | return this.precision; 42 | } 43 | set 44 | { 45 | this.PrecisionSquared = value * value; 46 | this.precision = value; 47 | } 48 | } 49 | 50 | /// 51 | /// minimaler Streckenunterschied 52 | /// 53 | public double PrecisionSquared { get; private set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /BimGisCad/Representation/Geometry/Axis.cs: -------------------------------------------------------------------------------- 1 | namespace BimGisCad.Representation.Geometry 2 | { 3 | /// 4 | /// Achsen Aufzählung 5 | /// 6 | public enum Axis 7 | { 8 | /// 9 | /// X Achse 10 | /// 11 | X = 0, 12 | 13 | /// 14 | /// Y-Achse 15 | /// 16 | Y, 17 | 18 | /// 19 | /// Z-Achse 20 | /// 21 | Z 22 | } 23 | 24 | /// 25 | /// Aufzählung möglicher Ebenen eines Koordinatensystems 26 | /// 27 | public enum AxisPlane 28 | { 29 | /// 30 | /// Ebene zwischen X und Y Achse 31 | /// 32 | XY, 33 | 34 | /// 35 | /// Ebene zwischen Y und Z Achse 36 | /// 37 | YZ, 38 | 39 | /// 40 | /// Ebene zwischen Z und X Achse 41 | /// 42 | ZX 43 | } 44 | } -------------------------------------------------------------------------------- /BimGisCad/Representation/Geometry/Axis1Placement.cs: -------------------------------------------------------------------------------- 1 | namespace BimGisCad.Representation.Geometry 2 | { 3 | ///// 4 | ///// Lokales Koordinatensystem in 1D Kontext (nicht Implementiert) 5 | ///// 6 | //public class Axis1Placement 7 | //{ 8 | //#region Constructors 9 | 10 | //private Axis1Placement(double tz) 11 | //{ 12 | // this.Translation = Vector1.Create(tz); 13 | //} 14 | 15 | //#endregion Constructors 16 | 17 | //#region Properties 18 | 19 | //public Dimensions Dim => Dimensions._1D; 20 | 21 | //public Vector1 Translation { get; } 22 | 23 | //#endregion Properties 24 | 25 | //#region Methods 26 | 27 | //public static void ToLocal(Axis1Placement system, Point1 global, out Point1 local) => local = global - system.Translation; 28 | 29 | //public static Point1 ToGlobal(Axis1Placement system, Point1 local, Point1 global) => local + system.Translation; 30 | 31 | //public static Axis1Placement Create() => new Axis1Placement(0.0); 32 | 33 | //public static Axis1Placement Create(double tz) => new Axis1Placement(tz); 34 | 35 | //public static Axis1Placement Create(Vector1 translation) => new Axis1Placement(translation.Z); 36 | 37 | ///// 38 | ///// Kombiniert zwei Systeme zu einem, Reihenfolge vom Kleinen ins Große (Ergebnis des kombinierten Systems ToGlobal, entspricht sys2.ToGlobal(sys1.ToGlobal(x))) 39 | ///// 40 | ///// 41 | ///// 42 | ///// 43 | //public static Axis1Placement Combine(Axis1Placement sys1, Axis1Placement sys2) => new Axis1Placement(sys1.Translation.Z + sys2.Translation.Z); 44 | 45 | //#endregion Methods 46 | //} 47 | } -------------------------------------------------------------------------------- /BimGisCad/Representation/Geometry/Composed/MultiPoint2.cs: -------------------------------------------------------------------------------- 1 | using BimGisCad.Representation.Geometry.Elementary; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace BimGisCad.Representation.Geometry.Composed 7 | { 8 | /// 9 | /// Gemittelter 2D Punkt 10 | /// 11 | 12 | public class MultiPoint2 13 | { 14 | private readonly double minDistsq; 15 | private double count; 16 | private double xs; 17 | private double ys; 18 | 19 | /// 20 | /// Konstruktor 21 | /// 22 | /// Mindestabstand unterschiedlicher Punkte 23 | /// Punkt 24 | public MultiPoint2(double minDist, Point2 point) 25 | { 26 | minDistsq = minDist * minDist; 27 | count = 1.0; 28 | xs = point.X; 29 | ys = point.Y; 30 | } 31 | 32 | 33 | /// 34 | /// Fügt neuen Punkt hinzu, wenn innerhalb des Mindestabstandes 35 | /// 36 | /// 37 | /// 38 | public bool Add(Point2 point) 39 | { 40 | double dx = xs / count - point.X; 41 | double dy = ys / count - point.Y; 42 | if ((dx * dx + dy * dy) < minDistsq) 43 | { 44 | xs += point.X; 45 | ys += point.Y; 46 | count += 1.0; 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | /// 53 | /// Gemitteltes X 54 | /// 55 | public double X => xs / count; 56 | 57 | /// 58 | /// Gemitteltes Y 59 | /// 60 | public double Y => ys / count; 61 | 62 | /// 63 | /// Gemittelter Punkt 64 | /// 65 | public Point2 Point => Point2.Create(X, Y); 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /BimGisCad/Representation/Geometry/Linear/ILinear.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BimGisCad.Representation.Geometry.Linear 6 | { 7 | /// 8 | /// Schnittstelle für Solve 9 | /// 10 | public interface ILinear 11 | { 12 | /// 13 | /// Gleichung für Punktberechnung 14 | /// 15 | double[][] PointEqu { get; } 16 | } 17 | 18 | /// 19 | /// 2D 20 | /// 21 | public interface ILinear2 : ILinear 22 | { 23 | 24 | } 25 | 26 | /// 27 | /// 3D 28 | /// 29 | public interface ILinear3 : ILinear 30 | { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /BimGisCad/Representation/Geometry/Side.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BimGisCad.Representation.Geometry 6 | { 7 | /// 8 | /// Aufzählung möglicher Seiten 9 | /// 10 | public enum Side 11 | { 12 | /// 13 | /// Negative Seite 14 | /// 15 | Neg = -1, 16 | 17 | /// 18 | /// Auf Element 19 | /// 20 | On = 0, 21 | 22 | /// 23 | /// Positive Seite 24 | /// 25 | Pos = 1 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /BimGisCad/Representation/IRepresentation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BimGisCad.Representation 6 | { 7 | /// 8 | /// 9 | /// 10 | public interface IRepresentation 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /BimGisCad/Representation/Topology/Vertex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using BimGisCad.Representation.Geometry; 6 | using BimGisCad.Representation.Geometry.Elementary; 7 | 8 | namespace BimGisCad.Representation.Topology 9 | { 10 | ///// 11 | ///// Vertex 12 | ///// 13 | //public struct Vertex:ITopoItem 14 | //{ 15 | // internal Vertex(int idx, IEnumerable incident) 16 | // { 17 | // this.Idx = idx; 18 | // this.Incident = incident?.ToArray() ?? Array.Empty(); 19 | // } 20 | 21 | // /// 22 | // /// Index in Shell 23 | // /// 24 | // public int Idx { get; } 25 | 26 | // /// 27 | // /// Indizes der abgehenden Kanten in Shell 28 | // /// 29 | // public int[] Incident { get; } 30 | 31 | // /// 32 | // /// Erzeugt neuen Vertex 33 | // /// 34 | // /// 35 | // internal static int Create(Shell shell) 36 | // { 37 | // int idx = shell.Vertices.Count; 38 | // shell.Vertices.Add(new Vertex(idx, null)); 39 | // return idx; 40 | // } 41 | 42 | // internal static bool AddIncident(Shell shell, int idx, int edgeIdx) 43 | // { 44 | // var vtx = shell.Vertices[idx]; 45 | // if(!vtx.Incident.Contains(edgeIdx)) 46 | // { 47 | // // ein Vertex darf nur zweimal in einem Face verwendet werden 48 | // if(vtx.Incident.Count(ei => shell.Edges[ei].FaceIdx == shell.Edges[edgeIdx].FaceIdx) > 1) 49 | // { return false; } 50 | // var cis = vtx.Incident.ToList(); 51 | // cis.Add(edgeIdx); 52 | // shell.Vertices[idx] = new Vertex(idx, cis); 53 | // } 54 | // return true; 55 | // } 56 | 57 | // internal static void RemoveIncident(Shell shell, int idx, int edgeIdx) 58 | // { 59 | // var vtx = shell.Vertices[idx]; 60 | // int i = Array.IndexOf(vtx.Incident, edgeIdx); 61 | // if(i >= 0) 62 | // { 63 | // var cis = vtx.Incident.ToList(); 64 | // cis.RemoveAt(i); 65 | // shell.Vertices[idx] = new Vertex(idx, cis); 66 | // } 67 | // } 68 | //} 69 | } -------------------------------------------------------------------------------- /BimGisCad/Root.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using BimGisCad.Collections; 5 | 6 | namespace BimGisCad 7 | { 8 | /// 9 | /// Oberstes Modell Objekt 10 | /// 11 | public abstract class Root:Unique 12 | { 13 | /// 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | public Root(string id, string name, UniqueCollection attributes = null):base(id) 20 | { 21 | this.Name = name; 22 | this.Attributes = attributes ?? UniqueCollection.Create(); 23 | } 24 | 25 | /// 26 | /// 27 | /// 28 | public string Name { get; set; } 29 | 30 | /// 31 | /// Attribute (in der Regel alles was nicht Geometrie und Topologie ist) 32 | /// 33 | public UniqueCollection Attributes { get; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /BimGisCad/Unique.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BimGisCad 6 | { 7 | /// 8 | /// Interface für Objekte mit Identifier 9 | /// 10 | public abstract class Unique: IEquatable 11 | { 12 | /// 13 | /// Erzeugt Id basierend auf Microsoft GUID 14 | /// 15 | /// 16 | public static string GetId() => Guid.NewGuid().ToString(); 17 | 18 | /// 19 | /// 20 | /// 21 | /// 22 | protected Unique(string id) 23 | { 24 | this.Id = id ?? GetId(); 25 | } 26 | 27 | 28 | /// 29 | /// Identifier 30 | /// 31 | public string Id { get; } 32 | 33 | /// 34 | /// Vergleich anhand der Id 35 | /// 36 | /// 37 | /// 38 | public bool Equals(Unique other) => this.Id == other.Id; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CityBIM/Builder/Revit_Semantic.cs: -------------------------------------------------------------------------------- 1 | using Autodesk.Revit.DB; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Xml; 8 | using Xml_AttrRep = BIMGISInteropLibs.Semantic.Xml_AttrRep; 9 | 10 | namespace CityBIM.Builder 11 | { 12 | internal class Revit_Semantic 13 | { 14 | private readonly Document doc; 15 | private readonly string userDefinedParameterFile; 16 | 17 | public Revit_Semantic(Document doc) 18 | { 19 | this.doc = doc; 20 | this.userDefinedParameterFile = doc.Application.SharedParametersFilename; 21 | } 22 | 23 | private Category GetCategory(BuiltInCategory builInCat) 24 | { 25 | return doc.Settings.Categories.get_Item(builInCat); 26 | } 27 | 28 | private CategorySet GetCategorySet(List builtInCats) 29 | { 30 | CategorySet catSet = new CategorySet(); 31 | 32 | foreach (BuiltInCategory builtInCat in builtInCats) 33 | { 34 | catSet.Insert(GetCategory(builtInCat)); 35 | } 36 | 37 | return catSet; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /CityBIM/CityBIM.addin: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | CityBIM 5 | CityBIM\CityBIM.dll 6 | 7 | 2100CA8E-05C6-4A55-A25E-188EFBF59439 8 | 9 | CityBIM.GUI.UI_PlugIn 10 | HTWDresden 11 | Faculty of Spatial Information 12 | AlwaysVisible 13 | 14 | -------------------------------------------------------------------------------- /CityBIM/DD_BIM_ICON.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/DD_BIM_ICON.ico -------------------------------------------------------------------------------- /CityBIM/GUI/City2BIM/Prop_CityGML_settings.cs: -------------------------------------------------------------------------------- 1 | using BIMGISInteropLibs.CityGML; 2 | using System; 3 | using System.IO; 4 | 5 | namespace CityBIM.GUI 6 | { 7 | public class Prop_CityGML_settings 8 | { 9 | //user-defined decision properties 10 | private static bool isServerRequest = true; //default value: true, Server will be called 11 | private static bool isGeodeticSystem = true; //default value: true, YXZ coordinate order in geodata preferred 12 | private static CityGml_Codelist.Codelist codelistName = CityGml_Codelist.Codelist.none; 13 | private static bool saveServerResponse = false; 14 | 15 | //user-defined source properties 16 | private static string fileUrl = ""; 17 | private static string serverUrl = "https://hosting.virtualcitywfs.de/deutschland_viewer/wfs"; 18 | private static string pathResponse = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "City2BIM"); 19 | 20 | //user-defined extent properties 21 | private static double extent = 300.0; 22 | 23 | public static double Extent { get => extent; set => extent = value; } 24 | public static bool IsServerRequest { get => isServerRequest; set => isServerRequest = value; } 25 | public static string ServerUrl { get => serverUrl; set => serverUrl = value; } 26 | public static string FileUrl { get => fileUrl; set => fileUrl = value; } 27 | public static bool IsGeodeticSystem { get => isGeodeticSystem; set => isGeodeticSystem = value; } 28 | public static CityGml_Codelist.Codelist CodelistName { get => codelistName; set => codelistName = value; } 29 | public static bool SaveServerResponse { get => saveServerResponse; set => saveServerResponse = value; } 30 | public static string PathResponse { get => pathResponse; set => pathResponse = value; } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /CityBIM/GUI/Cmd_Documentation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | //include Revit API 4 | using Autodesk.Revit.DB; 5 | using Autodesk.Revit.UI; 6 | 7 | namespace CityBIM.GUI 8 | { 9 | /// 10 | /// The "HelloWorld" external command. The class must be Public. 11 | /// 12 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 13 | public class Cmd_Documentation : IExternalCommand 14 | { 15 | // The main Execute method (inherited from IExternalCommand) must be public 16 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) 17 | { 18 | try 19 | { 20 | //direct Link to GITHUB - Repro so it should be accessable for "all" 21 | string docuPath = "https://github.com/dd-bim/City2BIM/wiki/Revit-Plugin"; 22 | 23 | //opens link 24 | System.Diagnostics.Process.Start(docuPath); 25 | 26 | return Result.Succeeded; 27 | } 28 | catch (Exception ex) 29 | { 30 | Console.WriteLine(ex); 31 | return Result.Failed; 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /CityBIM/GUI/Cmd_LogFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.IO; 4 | 5 | //include Revit API 6 | using Autodesk.Revit.DB; 7 | using Autodesk.Revit.UI; 8 | using System.Linq; 9 | 10 | namespace CityBIM.GUI 11 | { 12 | /// 13 | /// The "HelloWorld" external command. The class must be Public. 14 | /// 15 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 16 | public class Cmd_LogFile : IExternalCommand 17 | { 18 | // The main Execute method (inherited from IExternalCommand) must be public 19 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) 20 | { 21 | try 22 | { 23 | var today = DateTime.Now.ToString("yyyyMMdd"); 24 | var programmDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); 25 | var versionNumber = revit.Application.Application.VersionNumber; 26 | var filePath = "Autodesk\\Revit\\Addins\\" + versionNumber + "\\HTWDDLog" + today + ".log"; 27 | var logPath = Path.Combine(programmDataPath, filePath); 28 | 29 | //opens link 30 | System.Diagnostics.Process.Start(logPath); 31 | 32 | return Result.Succeeded; 33 | } 34 | catch (Exception ex) 35 | { 36 | Console.WriteLine(ex); 37 | return Result.Failed; 38 | } 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/Cmd_GeoRefUI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using Autodesk.Revit.DB; 4 | using Autodesk.Revit.UI; 5 | using CityBIM.GUI.Georeferencing; 6 | 7 | namespace CityBIM.GUI 8 | { 9 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 10 | [Autodesk.Revit.Attributes.Regeneration(Autodesk.Revit.Attributes.RegenerationOption.Manual)] 11 | public class Cmd_GeoRefUI : IExternalCommand 12 | { 13 | // The main Execute method (inherited from IExternalCommand) must be public 14 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) 15 | { 16 | Document doc = revit.Application.ActiveUIDocument.Document; 17 | 18 | var viewModel = new GeoRefViewModel(doc); 19 | var dialog = new NewGeoRefWindow(); 20 | dialog.DataContext = viewModel; 21 | var result = dialog.ShowDialog(); 22 | 23 | return Result.Succeeded; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/NewGeoRefWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | 4 | using Autodesk.Revit.UI; 5 | 6 | 7 | namespace CityBIM.GUI.Georeferencing 8 | { 9 | /// 10 | /// Interaction logic for NewGeoRefWindow.xaml 11 | /// 12 | public partial class NewGeoRefWindow : Window 13 | { 14 | public NewGeoRefWindow() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | private void Save_Click(object sender, RoutedEventArgs e) 20 | { 21 | var vm = (GeoRefViewModel)DataContext; 22 | vm.SaveSettings(); 23 | 24 | TaskDialog.Show("Settings applied!", "Settings have been stored successfully!"); 25 | } 26 | 27 | private void Cancel_Click(object sender, RoutedEventArgs e) 28 | { 29 | this.Close(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/img/Georef_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/GUI/Georeferencing/img/Georef_96dpi.png -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/img/icon_georef10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/GUI/Georeferencing/img/icon_georef10.png -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/img/icon_georef20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/GUI/Georeferencing/img/icon_georef20.png -------------------------------------------------------------------------------- /CityBIM/GUI/Georeferencing/img/icon_georef50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/GUI/Georeferencing/img/icon_georef50.png -------------------------------------------------------------------------------- /CityBIM/GUI/IFCExport/Cmd_ExportIFC.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | 5 | using Autodesk.Revit.DB; 6 | using Autodesk.Revit.UI; 7 | using Xbim.Ifc; 8 | using Xbim.Ifc4.ProductExtension; 9 | using Serilog; 10 | 11 | using CityBIM.IFCExport; 12 | using CityBIM.GUI.IFCExport; 13 | 14 | 15 | namespace CityBIM.GUI 16 | { 17 | /// 18 | /// The "HelloWorld" external command. The class must be Public. 19 | /// 20 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 21 | public class Cmd_ExportIFC : IExternalCommand 22 | { 23 | // The main Execute method (inherited from IExternalCommand) must be public 24 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 25 | { 26 | 27 | UIDocument uiDoc = commandData.Application.ActiveUIDocument; 28 | Document doc = uiDoc.Document; 29 | 30 | var cityGMLBuildingList = utils.getIfc2CityGMLGuidDic(doc); 31 | 32 | var dialog = new IfcExportDialog(); 33 | dialog.ShowDialog(); 34 | 35 | if (dialog.startExport) 36 | { 37 | RevitGeoIfcExporter exporter = new RevitGeoIfcExporter(doc); 38 | 39 | exporter.startRevitIfcExport(dialog.ExportPath, commandData); 40 | 41 | Log.Information("start custom IFC export"); 42 | 43 | using (var model = IfcStore.Open(dialog.ExportPath)) 44 | { 45 | using (var txn = model.BeginTransaction("Edit standard Revit export")) 46 | { 47 | exporter.createLoGeoRef50(model); 48 | exporter.exportDTM(model); 49 | 50 | var site = model.Instances.OfType().FirstOrDefault(); 51 | 52 | exporter.exportSurfaces(model, dialog.ExportType, site); 53 | exporter.exportModelCurves(model); 54 | 55 | if (cityGMLBuildingList.Count > 0) 56 | { 57 | exporter.addCityGMLAttributes(model, doc, cityGMLBuildingList); 58 | } 59 | 60 | txn.Commit(); 61 | } 62 | model.SaveAs(dialog.ExportPath); 63 | } 64 | 65 | Log.Information("finished custom IFC export"); 66 | TaskDialog.Show("Information", "IFC export finished!"); 67 | } 68 | 69 | return Result.Succeeded; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /CityBIM/GUI/IFCExport/IfcExportDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | 7 | using CityBIM.IFCExport; 8 | 9 | namespace CityBIM.GUI.IFCExport 10 | { 11 | /// 12 | /// Interaction logic for IfcExportDialog.xaml 13 | /// 14 | public partial class IfcExportDialog : Window 15 | { 16 | public RevitGeoIfcExporter.ExportType ExportType; 17 | public bool startExport = false; 18 | public string ExportPath 19 | { 20 | get => exportPath; 21 | } 22 | 23 | private string exportPath { get; set; } 24 | 25 | public IfcExportDialog() 26 | { 27 | InitializeComponent(); 28 | } 29 | 30 | private void saveAsButton_Click(object sender, RoutedEventArgs e) 31 | { 32 | Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); 33 | dlg.FileName = "IfcExport"; 34 | dlg.DefaultExt = ".ifc"; 35 | dlg.Filter = "Ifc File (.ifc)|*.ifc"; 36 | 37 | if (dlg.ShowDialog() == true) 38 | { 39 | filePathBox.Text = dlg.FileName; 40 | } 41 | } 42 | 43 | private void exportBtn_click(object sender, RoutedEventArgs e) 44 | { 45 | if (filePathBox.Text != null ) 46 | { 47 | exportPath = filePathBox.Text; 48 | startExport = true; 49 | var checkedRadioBtn = ExportTypePanel.Children.OfType().FirstOrDefault(r => r.IsChecked.HasValue && r.IsChecked.Value); 50 | Enum.TryParse(checkedRadioBtn.Content.ToString(), out this.ExportType); 51 | this.Close(); 52 | } 53 | else 54 | { 55 | MessageBox.Show("Please specify a valid output path", "Warning", MessageBoxButton.OK, MessageBoxImage.Information); 56 | } 57 | } 58 | 59 | private void cancelBtn_click(object sender, RoutedEventArgs e) 60 | { 61 | this.Close(); 62 | } 63 | 64 | /*private void radioButton_Checked(object sender, RoutedEventArgs e) 65 | { 66 | RadioButton checkedButton = sender as RadioButton; 67 | if (checkedButton.IsChecked.Value) 68 | { 69 | ExportType = (RevitIfcExporter.ExportType) checkedButton.Content; 70 | } 71 | }*/ 72 | 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /CityBIM/GUI/Modify/LayerSelector.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /CityBIM/Prop_Revit.cs: -------------------------------------------------------------------------------- 1 | using Autodesk.Revit.DB; 2 | using System; 3 | 4 | namespace CityBIM 5 | { 6 | public static class Prop_Revit 7 | { 8 | private static ElementId terrainId; 9 | private static ElementId pickedId; 10 | private static Element pickedElement; 11 | 12 | public const double radToDeg = 180 / System.Math.PI; 13 | public const double feetToM = 0.3048; 14 | 15 | public static ElementId TerrainId { get => terrainId; set => terrainId = value; } 16 | public static ElementId PickedId { get => pickedId; set => pickedId = value; } 17 | public static Element PickedElement { get => pickedElement; set => pickedElement = value; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CityBIM/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "CityBIM": { 4 | "commandName": "Project", 5 | "nativeDebugging": false 6 | }, 7 | "DebugRevit": { 8 | "commandName": "Executable", 9 | "executablePath": "C:\\Program Files\\Autodesk\\Revit 2022\\Revit.exe" 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /CityBIM/img/ALKIS_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/ALKIS_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/ALKISset_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/ALKISset_32px.png -------------------------------------------------------------------------------- /CityBIM/img/Attribute32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/Attribute32.png -------------------------------------------------------------------------------- /CityBIM/img/DD_BIM_ICON.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/DD_BIM_ICON.ico -------------------------------------------------------------------------------- /CityBIM/img/DD_BIM_LOGO.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/DD_BIM_LOGO.ico -------------------------------------------------------------------------------- /CityBIM/img/DD_BIM_LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/DD_BIM_LOGO.png -------------------------------------------------------------------------------- /CityBIM/img/DTM_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/DTM_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/Georef_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/Georef_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/HelpIcon_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/HelpIcon_32px.png -------------------------------------------------------------------------------- /CityBIM/img/HideLayerIcon_32px_96dpi.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/HideLayerIcon_32px_96dpi.ico -------------------------------------------------------------------------------- /CityBIM/img/HideLayerIcon_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/HideLayerIcon_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/IFC_32px_96dpi.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/IFC_32px_96dpi.ico -------------------------------------------------------------------------------- /CityBIM/img/IFC_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/IFC_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/LogIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/LogIcon.png -------------------------------------------------------------------------------- /CityBIM/img/Vermesser32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/Vermesser32.png -------------------------------------------------------------------------------- /CityBIM/img/XPlan_32px.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/XPlan_32px.ico -------------------------------------------------------------------------------- /CityBIM/img/XPlan_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/XPlan_32px.png -------------------------------------------------------------------------------- /CityBIM/img/citygml_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/citygml_32px_96dpi.png -------------------------------------------------------------------------------- /CityBIM/img/citygml_set_32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/citygml_set_32px.png -------------------------------------------------------------------------------- /CityBIM/img/loginIcon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/loginIcon32.png -------------------------------------------------------------------------------- /CityBIM/img/overViewIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/overViewIcon.png -------------------------------------------------------------------------------- /CityBIM/img/queryDataCat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/CityBIM/img/queryDataCat.png -------------------------------------------------------------------------------- /CityBIM_InstallerWix4/CityBIM_InstallerWix4.wixproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | HarvestPath=..\CityBIM\bin\Debug\net48 4 | HarvestPath=..\CityBIM\bin\Release\net48 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | var.CityBIM.TargetDir 20 | HarvestedComponents 21 | false 22 | true 23 | 24 | 25 | -------------------------------------------------------------------------------- /CityBIM_InstallerWix4/Package.wxs: -------------------------------------------------------------------------------- 1 |  2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CommonRevit/BaseViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace CommonRevit 5 | { 6 | public abstract class BaseViewModel : INotifyPropertyChanged 7 | { 8 | public event PropertyChangedEventHandler PropertyChanged; 9 | 10 | protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = "") 11 | { 12 | if (!string.IsNullOrEmpty(propertyName)) 13 | { 14 | this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CommonRevit/CommonRevit.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | d2709b80-47fd-45fb-a8a3-8a670a303e7d 7 | 8 | 9 | CommonRevit 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /CommonRevit/CommonRevit.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | d2709b80-47fd-45fb-a8a3-8a670a303e7d 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CommonRevit/DelegateCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Input; 3 | 4 | namespace CommonRevit 5 | { 6 | public class DelegateCommand : ICommand 7 | { 8 | readonly Action execute; 9 | readonly Predicate canExecute; 10 | 11 | public DelegateCommand(Action execute, Predicate canExecute) 12 | { 13 | this.execute = execute; 14 | this.canExecute = canExecute; 15 | } 16 | 17 | public DelegateCommand(Action excute) : this(excute, null) { } 18 | 19 | public event EventHandler CanExecuteChanged; 20 | 21 | public void RaiseCanExecuteChanged() => this.CanExecuteChanged.Invoke(this, EventArgs.Empty); 22 | 23 | public bool CanExecute(object parameter) => true; 24 | 25 | public void Execute(object parameter) 26 | { 27 | this.execute?.Invoke(parameter); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CommonRevit/Semantics/AttributeContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.ComponentModel; 4 | 5 | namespace CommonRevit.Semantics 6 | { 7 | public class AttributeContainer : INotifyPropertyChanged 8 | { 9 | public string attrName { get; set; } 10 | private string attrvalue; 11 | public string attrValue 12 | { 13 | get { return this.attrvalue; } 14 | set 15 | { 16 | if (this.attrvalue != value) 17 | { 18 | this.attrvalue = value; 19 | this.NotifyPropertyChanged("attrValue"); 20 | } 21 | } 22 | } 23 | 24 | public event PropertyChangedEventHandler PropertyChanged; 25 | 26 | public void NotifyPropertyChanged(string propName) 27 | { 28 | if (this.PropertyChanged != null) 29 | { 30 | this.PropertyChanged(this, new PropertyChangedEventArgs(propName)); 31 | } 32 | } 33 | 34 | public static ObservableCollection getAttrContainerFromDict(Dictionary attributes) 35 | { 36 | ObservableCollection collection = new ObservableCollection(); 37 | 38 | foreach (KeyValuePair entry in attributes) 39 | { 40 | var attrCont = new AttributeContainer(); 41 | attrCont.attrName = entry.Key; 42 | attrCont.attrValue = entry.Value; 43 | collection.Add(attrCont); 44 | } 45 | 46 | return collection; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /CommonRevit/Semantics/SchemaUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using Autodesk.Revit.DB.ExtensibleStorage; 4 | using Autodesk.Revit.DB; 5 | 6 | namespace CommonRevit.Semantics 7 | { 8 | internal class SchemaUtils 9 | { 10 | public static Schema getSchemaByName(string schemaName) 11 | { 12 | var schemaList = Schema.ListSchemas(); 13 | foreach (var schema in schemaList) 14 | { 15 | if (schema.SchemaName == schemaName) 16 | { 17 | return schema; 18 | } 19 | } 20 | return null; 21 | } 22 | 23 | public static List getHTWSchemas() 24 | { 25 | var schemaList = Schema.ListSchemas(); 26 | List htwSchemas = new List(); 27 | foreach (var s in schemaList) 28 | { 29 | if (s.VendorId == "HTWDRESDEN") 30 | { 31 | htwSchemas.Add(s); 32 | } 33 | } 34 | return htwSchemas; 35 | } 36 | 37 | public static List>> getSchemaAttributesForElement(Element element) 38 | { 39 | List>> schemaAndAttributeList = new List>>(); 40 | 41 | var schemaGUIDList = element.GetEntitySchemaGuids(); 42 | 43 | foreach (var schemaGUID in schemaGUIDList) 44 | { 45 | var schema = Schema.Lookup(schemaGUID); 46 | 47 | Entity ent = element.GetEntity(schema); 48 | 49 | Dictionary attrDict = new Dictionary(); 50 | foreach (var field in schema.ListFields()) 51 | { 52 | var value = ent.Get(field); 53 | if (value != null && value != string.Empty) 54 | { 55 | attrDict.Add(field.FieldName, value); 56 | } 57 | } 58 | 59 | schemaAndAttributeList.Add(new Dictionary>() { { schema.SchemaName, attrDict } }); 60 | } 61 | 62 | return schemaAndAttributeList; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /DataCatPlugin/DataCatPlugin.addin: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | DataCatPlugin 5 | DataCat\DataCatPlugin.dll 6 | 7 | 1920FAE6-634B-4D74-BB78-C078A69E4776 8 | 9 | DataCatPlugin.UI_Plugin 10 | HTWDresden 11 | Faculty of Spatial Information 12 | AlwaysVisible 13 | 14 | -------------------------------------------------------------------------------- /DataCatPlugin/ExternalDataCatalog/DataGridEntry.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace DataCatPlugin.ExternalDataCatalog 3 | { 4 | public class DataGridEntry 5 | { 6 | public string RevitID { get; set; } 7 | public string RevitCategory { get; set; } 8 | public string IfcClassificationReference { get; set; } 9 | public string IfcClassification { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DataCatPlugin/ExternalDataCatalog/ExternalDataEditorContainer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | 4 | using CommonRevit.Semantics; 5 | 6 | namespace DataCatPlugin.ExternalDataCatalog 7 | { 8 | public class ExternalDataEditorContainer 9 | { 10 | public string ObjectType { get; set; } 11 | public ObservableCollection Attributes { get; set; } 12 | public IfcClassification IfcClassification { get; set; } 13 | 14 | public ExternalDataEditorContainer() 15 | { 16 | 17 | } 18 | 19 | public ExternalDataSchemaObject toExternalDataSchemaObject() 20 | { 21 | Dictionary attributes = new Dictionary(); 22 | foreach (var entry in Attributes) 23 | { 24 | attributes.Add(entry.attrName, entry.attrValue); 25 | } 26 | 27 | return new ExternalDataSchemaObject(ObjectType, attributes, IfcClassification); 28 | } 29 | 30 | public static ExternalDataEditorContainer fromExternalDataSchemaObject(ExternalDataSchemaObject edso) 31 | { 32 | ObservableCollection attributes = new ObservableCollection(); 33 | foreach (KeyValuePair entry in edso.Properties) 34 | { 35 | attributes.Add(new AttributeContainer { attrName = entry.Key, attrValue = entry.Value }); 36 | } 37 | return new ExternalDataEditorContainer { Attributes = attributes, IfcClassification = edso.IfcClassification, ObjectType = edso.ObjectType }; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DataCatPlugin/ExternalDataCatalog/ExternalDataSchemaObject.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | using Newtonsoft.Json; 4 | 5 | namespace DataCatPlugin.ExternalDataCatalog 6 | { 7 | public class ExternalDataSchemaObject 8 | { 9 | public string ObjectType { get; set; } 10 | public Dictionary Properties { get; set; } 11 | public IfcClassification IfcClassification { get; set; } 12 | 13 | public ExternalDataSchemaObject(string objectType, Dictionary props, IfcClassification ifcClassification) 14 | { 15 | this.ObjectType = objectType; 16 | this.Properties = props; 17 | this.IfcClassification = ifcClassification; 18 | } 19 | 20 | public Dictionary> prepareForEditorWindow() 21 | { 22 | var result = new Dictionary>(); 23 | result.Add(this.ObjectType, this.Properties); 24 | return result; 25 | } 26 | 27 | public static ExternalDataSchemaObject fromJSONString(string jsonRepresentation) 28 | { 29 | return JsonConvert.DeserializeObject(jsonRepresentation); 30 | } 31 | 32 | public string toJSONString() 33 | { 34 | return JsonConvert.SerializeObject(this); 35 | } 36 | 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DataCatPlugin/ExternalDataCatalog/IfcClassification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | 6 | namespace DataCatPlugin.ExternalDataCatalog 7 | { 8 | public class IfcClassification 9 | { 10 | public string ID { get; set; } 11 | public string Source { get; set; } 12 | public string Edition { get; set; } 13 | public string EditionDate { get; set; } 14 | 15 | public string Name { get; set; } 16 | public string Description { get; set; } 17 | public string Location { get; set; } 18 | public string RefToken { get; set; } 19 | 20 | public List RefList { get; set; } 21 | public IfcClassification() 22 | { 23 | 24 | } 25 | 26 | public IfcClassification(string ID = null, string Source = null, string Edition = null, string EditionDate = null, string Name = null, string Description = null, string Location = null, string RefToken = null, List refList = null) 27 | { 28 | this.ID = ID; 29 | this.Source = Source; 30 | this.Edition = Edition; 31 | this.EditionDate = EditionDate; 32 | this.Name = Name; 33 | this.Description = Description; 34 | this.Location = Location; 35 | this.RefToken = RefToken; 36 | this.RefList = refList; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DataCatPlugin/ExternalDataCatalog/IfcClassificationReference.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DataCatPlugin.ExternalDataCatalog 4 | { 5 | public class IfcClassificationReference 6 | { 7 | public string ID { get; set; } 8 | public string Location { get; set; } 9 | public string Name { get; set; } 10 | public string ReferencedSource { get; set; } 11 | public string Description { get; set; } 12 | public string Sort { get; set; } 13 | public List RefList { get; set; } 14 | 15 | 16 | public IfcClassificationReference() 17 | { 18 | 19 | } 20 | 21 | public IfcClassificationReference(string ID = null, string Location = null, string Name = null, string ReferencedSource = null, string Description = null, string Sort = null, List RefList = null) 22 | { 23 | this.ID = ID; 24 | this.Location = Location; 25 | this.Name = Name; 26 | this.ReferencedSource = ReferencedSource; 27 | this.Description = Description; 28 | this.Sort = Sort; 29 | this.RefList = RefList; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /DataCatPlugin/GUI/Cmd_DataCatLogin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Autodesk.Revit.UI; 4 | using Autodesk.Revit.DB; 5 | 6 | using DataCatPlugin.ExternalDataCatalog; 7 | using DataCatPlugin.Settings; 8 | 9 | namespace DataCatPlugin.GUI 10 | { 11 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 12 | public class Cmd_DataCatLogin : IExternalCommand 13 | { 14 | // The main Execute method (inherited from IExternalCommand) must be public 15 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) 16 | { 17 | Document doc = revit.Application.ActiveUIDocument.Document; 18 | 19 | bool tokenValidity = ExternalDataUtils.testTokenValidity(); 20 | 21 | if (tokenValidity) 22 | { 23 | string output = "You are already successfully logged into: {0} \nCredentials valid until {1}"; 24 | output = string.Format(output, Connection.DataCatToken.Issuer, Connection.DataCatToken.ValidTo); 25 | TaskDialog.Show("Information", output); 26 | } 27 | 28 | else 29 | { 30 | var loginScreen = new LoginScreen(); 31 | var dialogResult = loginScreen.ShowDialog(); 32 | 33 | if (dialogResult == true) 34 | { 35 | var client = new ExternalDataClient(loginScreen.endPointUrl); 36 | var token = client.getLoginTokenForCredentials(loginScreen.UserName, loginScreen.passWord); 37 | 38 | if (token != null) 39 | { 40 | Connection.DataCatToken = token; 41 | Connection.TokenExpirationDate = (Int32)(token.ValidTo.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; 42 | Connection.DataClient = client; 43 | TaskDialog.Show("Message", "Successfully logged in!"); 44 | } 45 | 46 | else 47 | { 48 | TaskDialog.Show("Warning!", "Something went wrong! \n UserName, Password and URL correct?"); 49 | } 50 | } 51 | } 52 | 53 | return Result.Succeeded; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/Cmd_DataCatOverview.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | 5 | using Autodesk.Revit.DB.ExtensibleStorage; 6 | using Autodesk.Revit.DB; 7 | using Autodesk.Revit.Attributes; 8 | using Autodesk.Revit.UI; 9 | 10 | using CommonRevit.Semantics; 11 | using DataCatPlugin.ExternalDataCatalog; 12 | 13 | namespace DataCatPlugin.GUI 14 | { 15 | [Transaction(TransactionMode.Manual)] 16 | public class Cmd_DataCatOverview: IExternalCommand 17 | { 18 | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 19 | { 20 | var schema = SchemaUtils.getSchemaByName("ExternalDataCatalogSchema"); 21 | 22 | if (schema == null) 23 | { 24 | TaskDialog.Show("Error", "No external data information in document!"); 25 | return Result.Failed; 26 | } 27 | 28 | var collector = new FilteredElementCollector(commandData.Application.ActiveUIDocument.Document); 29 | var filter = new ExtensibleStorageFilter(schema.GUID); 30 | var affectedRevitElementIds = collector.WherePasses(filter).ToElementIds(); 31 | 32 | var entryList = new ObservableCollection(); 33 | 34 | foreach (var elementId in affectedRevitElementIds) 35 | { 36 | var category = commandData.Application.ActiveUIDocument.Document.GetElement(elementId).Category.Name; 37 | var entity = commandData.Application.ActiveUIDocument.Document.GetElement(elementId).GetEntity(schema); 38 | 39 | var objectsStringDict = entity.Get>("Objects"); 40 | var externalObjectsList = objectsStringDict.Values.Select(obj => ExternalDataSchemaObject.fromJSONString(obj)).ToList(); 41 | 42 | foreach (var obj in externalObjectsList) 43 | { 44 | entryList.Add(new DataGridEntry { RevitID = elementId.ToString(), RevitCategory = category, IfcClassification = obj.IfcClassification.Name, IfcClassificationReference = obj.IfcClassification.RefList.Last().Name }); 45 | } 46 | } 47 | 48 | var dialog = new DataCatOverview(commandData, entryList); 49 | dialog.ShowDialog(); 50 | 51 | return Result.Succeeded; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/Cmd_DataCatSubjQuery.cs: -------------------------------------------------------------------------------- 1 | using Autodesk.Revit.DB; 2 | using Autodesk.Revit.UI; 3 | 4 | using DataCatPlugin.ExternalDataCatalog; 5 | 6 | namespace DataCatPlugin.GUI 7 | { 8 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 9 | class Cmd_DataCatSubjQuery : IExternalCommand 10 | { 11 | 12 | public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 13 | { 14 | UIDocument uiDoc = commandData.Application.ActiveUIDocument; 15 | 16 | if (ExternalDataUtils.testTokenValidity() == false) 17 | { 18 | TaskDialog.Show("Error!", "You are currently not logged into the external server!"); 19 | return Result.Failed; 20 | } 21 | 22 | findSubjectResultForm resultPopUp = new findSubjectResultForm(uiDoc); 23 | 24 | resultPopUp.ShowDialog(); 25 | 26 | return Result.Succeeded; 27 | } 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/Cmd_ExportIFC.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | 5 | using Autodesk.Revit.DB; 6 | using Autodesk.Revit.UI; 7 | using Xbim.Ifc; 8 | using Xbim.Ifc4.ProductExtension; 9 | using Serilog; 10 | 11 | using CommonRevit.IFC; 12 | using DataCatPlugin.GUI; 13 | using DataCatPlugin.IFCExport; 14 | 15 | namespace DataCatPlugin.GUI 16 | { 17 | /// 18 | /// The "HelloWorld" external command. The class must be Public. 19 | /// 20 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 21 | public class Cmd_ExportIFC : IExternalCommand 22 | { 23 | // The main Execute method (inherited from IExternalCommand) must be public 24 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 25 | { 26 | 27 | UIDocument uiDoc = commandData.Application.ActiveUIDocument; 28 | Document doc = uiDoc.Document; 29 | 30 | var dialog = new IfcExportDialog(); 31 | dialog.ShowDialog(); 32 | 33 | if (dialog.startExport) 34 | { 35 | var exporter = new ExternalDataIfcExporter(doc); 36 | 37 | exporter.startRevitIfcExport(dialog.ExportPath, commandData); 38 | 39 | Log.Information("start IFC export"); 40 | 41 | using (var model = IfcStore.Open(dialog.ExportPath)) 42 | { 43 | using (var txn = model.BeginTransaction("Edit standard Revit export")) 44 | { 45 | 46 | var site = model.Instances.OfType().FirstOrDefault(); 47 | 48 | exporter.addExternalData(model, doc); 49 | 50 | txn.Commit(); 51 | } 52 | model.SaveAs(dialog.ExportPath); 53 | } 54 | 55 | Log.Information("finished custom IFC export"); 56 | TaskDialog.Show("Information", "IFC export finished!"); 57 | } 58 | 59 | return Result.Succeeded; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/Cmd_LogFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | using Autodesk.Revit.DB; 5 | using Autodesk.Revit.UI; 6 | 7 | 8 | namespace DataCatPlugin.GUI 9 | { 10 | 11 | [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)] 12 | public class Cmd_LogFile : IExternalCommand 13 | { 14 | // The main Execute method (inherited from IExternalCommand) must be public 15 | public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit, ref string message, ElementSet elements) 16 | { 17 | try 18 | { 19 | var today = DateTime.Now.ToString("yyyyMMdd"); 20 | var programmDataPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); 21 | var versionNumber = revit.Application.Application.VersionNumber; 22 | var filePath = "Autodesk\\Revit\\Addins\\" + versionNumber + "\\HTWDDLog" + today + ".log"; 23 | var logPath = Path.Combine(programmDataPath, filePath); 24 | 25 | //opens link 26 | System.Diagnostics.Process.Start(logPath); 27 | 28 | return Result.Succeeded; 29 | } 30 | catch (Exception ex) 31 | { 32 | Console.WriteLine(ex); 33 | return Result.Failed; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/DataCatPropertySetterWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/DataCatPropertySetterWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Collections.Generic; 3 | using System.Windows; 4 | 5 | using DataCatPlugin.ExternalDataCatalog; 6 | 7 | 8 | namespace DataCatPlugin.GUI 9 | { 10 | /// 11 | /// Interaction logic for DataCatPropertySetterWindow.xaml 12 | /// 13 | public partial class DataCatPropertySetterWindow : Window 14 | { 15 | public List containerList { get; set; } 16 | public bool saveChanges { get; set; } 17 | 18 | public DataCatPropertySetterWindow(List objectList) 19 | { 20 | this.containerList = objectList.Select(obj => ExternalDataEditorContainer.fromExternalDataSchemaObject(obj)).ToList(); 21 | 22 | InitializeComponent(); 23 | 24 | tabs.ItemsSource = this.containerList; 25 | } 26 | 27 | private void save_Click(object sender, RoutedEventArgs e) 28 | { 29 | saveChanges = true; 30 | this.Close(); 31 | } 32 | 33 | private void cancel_Click(object sender, RoutedEventArgs e) 34 | { 35 | saveChanges = false; 36 | this.Close(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/DataCatalogEditorWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/DataCatalogEditorWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | 6 | using Newtonsoft.Json; 7 | 8 | using CommonRevit.Semantics; 9 | 10 | namespace DataCatPlugin.GUI 11 | { 12 | /// 13 | /// Interaction logic for DataCatalogEditorWindow.xaml 14 | /// 15 | public partial class DataCatalogEditorWindow : Window 16 | { 17 | public bool saveChanges { get; set; } 18 | public Dictionary> data { get; set; } 19 | 20 | public DataCatalogEditorWindow(Dictionary> ObjectTypeAndAttributesDict) 21 | { 22 | this.data = new Dictionary>(); 23 | this.saveChanges = false; 24 | InitializeComponent(); 25 | 26 | foreach (var key in ObjectTypeAndAttributesDict.Keys) 27 | { 28 | var currentTabItem = new TabItem(); 29 | currentTabItem.Header = key; 30 | var attrList = AttributeContainer.getAttrContainerFromDict(ObjectTypeAndAttributesDict[key]); 31 | currentTabItem.Content = attrList; 32 | data.Add(key, attrList); 33 | tabs.Items.Add(currentTabItem); 34 | } 35 | 36 | } 37 | 38 | private void save_Click(object sender, RoutedEventArgs e) 39 | { 40 | saveChanges = true; 41 | this.Close(); 42 | } 43 | 44 | private void cancel_Click(object sender, RoutedEventArgs e) 45 | { 46 | saveChanges = false; 47 | this.Close(); 48 | } 49 | 50 | public string getDataAsJsonString() 51 | { 52 | var dict = new Dictionary(); 53 | 54 | foreach (KeyValuePair> pair in this.data) 55 | { 56 | foreach (var item in pair.Value) 57 | { 58 | dict.Add(item.attrName, item.attrValue); 59 | } 60 | } 61 | 62 | return JsonConvert.SerializeObject(dict, Formatting.None); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/IfcExportDialog.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows; 5 | using System.Windows.Controls; 6 | 7 | using DataCatPlugin.IFCExport; 8 | 9 | namespace DataCatPlugin.GUI 10 | { 11 | /// 12 | /// Interaction logic for IfcExportDialog.xaml 13 | /// 14 | public partial class IfcExportDialog : Window 15 | { 16 | public bool startExport = false; 17 | public string ExportPath 18 | { 19 | get => exportPath; 20 | } 21 | 22 | private string exportPath { get; set; } 23 | 24 | public IfcExportDialog() 25 | { 26 | InitializeComponent(); 27 | } 28 | 29 | private void saveAsButton_Click(object sender, RoutedEventArgs e) 30 | { 31 | Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog(); 32 | dlg.FileName = "IfcExport"; 33 | dlg.DefaultExt = ".ifc"; 34 | dlg.Filter = "Ifc File (.ifc)|*.ifc"; 35 | 36 | if (dlg.ShowDialog() == true) 37 | { 38 | filePathBox.Text = dlg.FileName; 39 | } 40 | } 41 | 42 | private void exportBtn_click(object sender, RoutedEventArgs e) 43 | { 44 | if (filePathBox.Text != null ) 45 | { 46 | exportPath = filePathBox.Text; 47 | startExport = true; 48 | var checkedRadioBtn = ExportTypePanel.Children.OfType().FirstOrDefault(r => r.IsChecked.HasValue && r.IsChecked.Value); 49 | //Enum.TryParse(checkedRadioBtn.Content.ToString(), out this.ExportType); 50 | this.Close(); 51 | } 52 | else 53 | { 54 | MessageBox.Show("Please specify a valid output path", "Warning", MessageBoxButton.OK, MessageBoxImage.Information); 55 | } 56 | } 57 | 58 | private void cancelBtn_click(object sender, RoutedEventArgs e) 59 | { 60 | this.Close(); 61 | } 62 | 63 | /*private void radioButton_Checked(object sender, RoutedEventArgs e) 64 | { 65 | RadioButton checkedButton = sender as RadioButton; 66 | if (checkedButton.IsChecked.Value) 67 | { 68 | ExportType = (RevitIfcExporter.ExportType) checkedButton.Content; 69 | } 70 | }*/ 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/LoginScreen.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DataCatPlugin/GUI/LoginScreen.xaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | namespace DataCatPlugin.GUI 4 | { 5 | /// 6 | /// Interaction logic for LoginScreen.xaml 7 | /// 8 | public partial class LoginScreen : Window 9 | { 10 | public string UserName; 11 | public string passWord; 12 | public string endPointUrl; 13 | 14 | public LoginScreen() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | private void submit_click(object sender, RoutedEventArgs e) 20 | { 21 | UserName = userNameBox.Text; 22 | passWord = PassWordBox.Password; 23 | endPointUrl = ServerBox.Text; 24 | this.DialogResult = true; 25 | this.Close(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DataCatPlugin/Settings/Connection.cs: -------------------------------------------------------------------------------- 1 | using System.IdentityModel.Tokens.Jwt; 2 | 3 | using DataCatPlugin.ExternalDataCatalog; 4 | 5 | namespace DataCatPlugin.Settings 6 | { 7 | public static class Connection 8 | { 9 | private static JwtSecurityToken dataCatToken; 10 | private static int tokenExpirationDate; 11 | private static ExternalDataClient dataClient; 12 | 13 | public static JwtSecurityToken DataCatToken { get => dataCatToken; set => dataCatToken = value; } 14 | public static int TokenExpirationDate { get => tokenExpirationDate; set => tokenExpirationDate = value; } 15 | public static ExternalDataClient DataClient { get => dataClient; set => dataClient = value; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DataCatPlugin/img/IFC_32px_96dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin/img/IFC_32px_96dpi.png -------------------------------------------------------------------------------- /DataCatPlugin/img/LogIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin/img/LogIcon.png -------------------------------------------------------------------------------- /DataCatPlugin/img/loginIcon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin/img/loginIcon32.png -------------------------------------------------------------------------------- /DataCatPlugin/img/overViewIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin/img/overViewIcon.png -------------------------------------------------------------------------------- /DataCatPlugin/img/queryDataCat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin/img/queryDataCat.png -------------------------------------------------------------------------------- /DataCatPlugin_Installer/DataCatPlugin_Installer.wixproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | HarvestPath=..\DataCatPlugin\bin\Debug\net48 4 | HarvestPath=..\DataCatPlugin\bin\Release\net48 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | var.DataCatPlugin.TargetDir 21 | 22 | HarvestedComponents 23 | APPLICATIONFOLDER 24 | true 25 | true 26 | false 27 | true 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /DataCatPlugin_Installer/Package.wxs: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /DataCatPlugin_Installer__new/DataCat_Rvt2023_Installer.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin_Installer__new/DataCat_Rvt2023_Installer.msi -------------------------------------------------------------------------------- /DataCatPlugin_Installer__new/DataCat_Rvt2023_Installer.wixpdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dd-bim/City2BIM/4602a1e8db3fe2f454035e128f086be8249250d2/DataCatPlugin_Installer__new/DataCat_Rvt2023_Installer.wixpdb -------------------------------------------------------------------------------- /DataCatPlugin_Installer__new/Package.wxs: -------------------------------------------------------------------------------- 1 |  2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /GuiHandler/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Allgemeine Informationen über eine Assembly werden über die folgenden 6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, 7 | // die einer Assembly zugeordnet sind. 8 | [assembly: AssemblyTitle("GuiHandler")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GuiHandler")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly 18 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von 19 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. 20 | [assembly: ComVisible(false)] 21 | 22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird 23 | [assembly: Guid("24352448-2cab-4638-b4db-326539381408")] 24 | 25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: 26 | // 27 | // Hauptversion 28 | // Nebenversion 29 | // Buildnummer 30 | // Revision 31 | // 32 | // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, 33 | // indem Sie "*" wie unten gezeigt eingeben: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /GuiHandler/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /GuiHandler/userControler/CityGML/Read.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 |