{"id":18153849,"url":"https://github.com/chuongmep/ifc-to-excel","last_synced_at":"2025-04-30T16:11:37.636Z","repository":{"id":218931818,"uuid":"747733142","full_name":"chuongmep/Ifc-to-excel","owner":"chuongmep","description":"Convert Metadata From IFC To Excel","archived":false,"fork":false,"pushed_at":"2024-10-22T07:04:54.000Z","size":5721,"stargazers_count":9,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T17:46:09.103Z","etag":null,"topics":["autodesk","big-data","data","ifc","ifc-excel","ifc-viewer"],"latest_commit_sha":null,"homepage":"https://chuongmep.com/posts/2024-02-25-Export-IFC-Excel-CSV.html","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chuongmep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T14:34:46.000Z","updated_at":"2025-03-05T02:53:07.000Z","dependencies_parsed_at":"2024-10-23T02:53:20.462Z","dependency_job_id":null,"html_url":"https://github.com/chuongmep/Ifc-to-excel","commit_stats":null,"previous_names":["chuongmep/ifc-to-excel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FIfc-to-excel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FIfc-to-excel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FIfc-to-excel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuongmep%2FIfc-to-excel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuongmep","download_url":"https://codeload.github.com/chuongmep/Ifc-to-excel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739653,"owners_count":21635892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodesk","big-data","data","ifc","ifc-excel","ifc-viewer"],"created_at":"2024-11-02T03:08:15.905Z","updated_at":"2025-04-30T16:11:37.568Z","avatar_url":"https://github.com/chuongmep.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nDemo Easy Convert Data From IFC To Excel\n\n![](docs/model.png)\n\n## Installation\n\n```bash\n%pip install -U\n%pip install ifcopenshell -U\n%pip install openpyxl -U\n%pip install pandas -U\n%pip install lark -U\n%pip install wordcloud -U\n```\n\n## Usage\n\n```python\n# copyring by chuongmep\nimport ifcopenshell\nimport pandas as pd\nimport warnings\nwarnings.filterwarnings('ignore')\n\nfile_path = r\"2022020320211122Wellness center Sama.ifc\"\nifc_file = ifcopenshell.open(file_path)\nclasses = ifc_file.by_type(\"IfcProduct\")\n\nclass_names = [class_name.is_a() for class_name in classes]\nclass_names = list(set(class_names))\nfile_name = \"result.xlsx\"\nwith pd.ExcelWriter(file_name, engine='openpyxl') as writer:\n    for class_name in class_names:\n        objects = ifc_file.by_type(class_name)\n        result_df = pd.DataFrame()\n        for object in objects:\n            class_data = {}\n            psets  = ifcopenshell.util.element.get_psets(object)\n            for name, value in psets.items():\n                if isinstance(value, dict):\n                    for key, val in value.items():\n                        class_data[key] = val\n                else:\n                    pass\n            class_df =  pd.DataFrame(class_data, index=[0])\n            result_df = pd.concat([result_df, class_df], ignore_index=True)\n        if(result_df.empty):\n            continue\n        result_df.to_excel(writer, sheet_name=class_name, index=False)\n        # set auto fit column width\n        worksheet = writer.sheets[class_name]\n        for idx, col in enumerate(worksheet.columns):\n            worksheet.column_dimensions[col[0].column_letter].width = 20\n```\n\nVisualize data use seaborn and matplotlib\n\n```py\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_theme(style=\"darkgrid\")\n# visualize data df dictionary, y is class name, x is number of objects\nsns.barplot(y=list(df.keys()), x=[len(df[key]) for key in df.keys()])\nplt.xticks(rotation=90)\nplt.ylabel(\"Class name\")\nplt.xlabel(\"Number of objects\")\nplt.title(\"Visualization by Class\")\nplt.show()\n```\n![](docs/output.png)\n\n## Sample Files \n\n- [IFC_To_Excel.ipynb](./IFC_To_Excel.ipynb) - Demo convert data from IFC to Excel\n- [Result.xlsx](./Result.xlsx) - Result file after convert\n\n\n## CopyRight\n\n- Model by [https://openifcmodel.cs.auckland.ac.nz/](https://openifcmodel.cs.auckland.ac.nz/)\n\n- [IfcOpenShell 0.7.0 documentation](https://blenderbim.org/docs-python/autoapi/ifcopenshell/util/element/index.html#ifcopenshell.util.element.get_properties)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuongmep%2Fifc-to-excel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuongmep%2Fifc-to-excel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuongmep%2Fifc-to-excel/lists"}