Skip to content

Commit

Permalink
Update 00.Explore Revit Data With APSToolkit.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Feb 26, 2024
1 parent b7c291d commit bed070c
Showing 1 changed file with 190 additions and 0 deletions.
190 changes: 190 additions & 0 deletions docs/Turorials/00.Explore Revit Data With APSToolkit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,196 @@
"source": [
"RevitPropDbReader.ExportAllDataToExcelByCategory(\"resut.xlsx\", \"Walls\",\"Walls\");"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to export data to big data format like parquet ? "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"string dir = \"./parquet\";\n",
"if (!System.IO.Directory.Exists(dir))\n",
"{\n",
" System.IO.Directory.CreateDirectory(dir);\n",
"}\n",
"RevitPropDbReader.ExportAllDataToParquet(dir);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to get all data from Revit Model filter by parameters ? "
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [],
"source": [
"using System.Data;\n",
"List<string> parameters = new List<string>()\n",
"{\n",
" \"Category\",\n",
" \"ElementId\",\n",
" \"name\",\n",
" \"Level\",\n",
"};\n",
"DataTable dataTable = RevitPropDbReader.GetAllDataByParameter(parameters);\n",
"dataTable.ExportDataToExcel(\"result.xlsx\");"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to get all families from Revit Model ?"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [
{
"data": {
"text/html": [
"<table><thead><tr><th><i>key</i></th><th>value</th></tr></thead><tbody><tr><td><div class=\"dni-plaintext\"><pre>355</pre></div></td><td><div class=\"dni-plaintext\"><pre>Floor Plan</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>361</pre></div></td><td><div class=\"dni-plaintext\"><pre>Ceiling Plan</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>795</pre></div></td><td><div class=\"dni-plaintext\"><pre>Sheet</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3481</pre></div></td><td><div class=\"dni-plaintext\"><pre>Schedule</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>729</pre></div></td><td><div class=\"dni-plaintext\"><pre>Elevation</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>736</pre></div></td><td><div class=\"dni-plaintext\"><pre>Elevation</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>801</pre></div></td><td><div class=\"dni-plaintext\"><pre>Viewport</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>834</pre></div></td><td><div class=\"dni-plaintext\"><pre>Default Site</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>2098</pre></div></td><td><div class=\"dni-plaintext\"><pre>Project</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>1036</pre></div></td><td><div class=\"dni-plaintext\"><pre>E1 30 x 42 Horizontal</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>1264</pre></div></td><td><div class=\"dni-plaintext\"><pre>Text</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>2311</pre></div></td><td><div class=\"dni-plaintext\"><pre>3D View</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3477</pre></div></td><td><div class=\"dni-plaintext\"><pre>Schedule</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3501</pre></div></td><td><div class=\"dni-plaintext\"><pre>Point Cloud</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3525</pre></div></td><td><div class=\"dni-plaintext\"><pre>Seating-LAMMHULTS-PENNE-Chair</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3555</pre></div></td><td><div class=\"dni-plaintext\"><pre>Krevet-002-2</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3859</pre></div></td><td><div class=\"dni-plaintext\"><pre>Table</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3560</pre></div></td><td><div class=\"dni-plaintext\"><pre>Basic Wall</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3570</pre></div></td><td><div class=\"dni-plaintext\"><pre>Single-Flush</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3692</pre></div></td><td><div class=\"dni-plaintext\"><pre>F0560 - Wardrobe, Television</pre></div></td></tr><tr><td colspan=\"2\"><i>(12 more)</i></td></tr></tbody></table><style>\r\n",
".dni-code-hint {\r\n",
" font-style: italic;\r\n",
" overflow: hidden;\r\n",
" white-space: nowrap;\r\n",
"}\r\n",
".dni-treeview {\r\n",
" white-space: nowrap;\r\n",
"}\r\n",
".dni-treeview td {\r\n",
" vertical-align: top;\r\n",
" text-align: start;\r\n",
"}\r\n",
"details.dni-treeview {\r\n",
" padding-left: 1em;\r\n",
"}\r\n",
"table td {\r\n",
" text-align: start;\r\n",
"}\r\n",
"table tr { \r\n",
" vertical-align: top; \r\n",
" margin: 0em 0px;\r\n",
"}\r\n",
"table tr td pre \r\n",
"{ \r\n",
" vertical-align: top !important; \r\n",
" margin: 0em 0px !important;\r\n",
"} \r\n",
"table th {\r\n",
" text-align: start;\r\n",
"}\r\n",
"</style>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var families = RevitPropDbReader.GetAllFamilies();\n",
"display(families);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How to get all family type from Revit Model ?"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
}
},
"outputs": [
{
"data": {
"text/html": [
"<table><thead><tr><th><i>key</i></th><th>value</th></tr></thead><tbody><tr><td><div class=\"dni-plaintext\"><pre>357</pre></div></td><td><div class=\"dni-plaintext\"><pre>Floor Plan</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>363</pre></div></td><td><div class=\"dni-plaintext\"><pre>Ceiling Plan</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>797</pre></div></td><td><div class=\"dni-plaintext\"><pre>Sheet</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>731</pre></div></td><td><div class=\"dni-plaintext\"><pre>Building Elevation</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>803</pre></div></td><td><div class=\"dni-plaintext\"><pre>Title w Line</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>834</pre></div></td><td><div class=\"dni-plaintext\"><pre>Location Data</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>2098</pre></div></td><td><div class=\"dni-plaintext\"><pre>Location Data</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>1038</pre></div></td><td><div class=\"dni-plaintext\"><pre>E1 30x42 Horizontal</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>1266</pre></div></td><td><div class=\"dni-plaintext\"><pre>Temporary Notes</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>2313</pre></div></td><td><div class=\"dni-plaintext\"><pre>3D View</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3479</pre></div></td><td><div class=\"dni-plaintext\"><pre>Schedule</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3503</pre></div></td><td><div class=\"dni-plaintext\"><pre>HouseComparee57.rcp</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3527</pre></div></td><td><div class=\"dni-plaintext\"><pre>Plastic-Seat</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3557</pre></div></td><td><div class=\"dni-plaintext\"><pre>190x140 (202,5x150)</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3861</pre></div></td><td><div class=\"dni-plaintext\"><pre>Table</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3562</pre></div></td><td><div class=\"dni-plaintext\"><pre>Generic - 6&quot;</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3572</pre></div></td><td><div class=\"dni-plaintext\"><pre>36&quot; x 84&quot;</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3694</pre></div></td><td><div class=\"dni-plaintext\"><pre>F0560 - Wardrobe, Television</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3839</pre></div></td><td><div class=\"dni-plaintext\"><pre>ASYG18LFCA</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>3847</pre></div></td><td><div class=\"dni-plaintext\"><pre>Concrete Slab - 6&quot;</pre></div></td></tr><tr><td colspan=\"2\"><i>(10 more)</i></td></tr></tbody></table><style>\r\n",
".dni-code-hint {\r\n",
" font-style: italic;\r\n",
" overflow: hidden;\r\n",
" white-space: nowrap;\r\n",
"}\r\n",
".dni-treeview {\r\n",
" white-space: nowrap;\r\n",
"}\r\n",
".dni-treeview td {\r\n",
" vertical-align: top;\r\n",
" text-align: start;\r\n",
"}\r\n",
"details.dni-treeview {\r\n",
" padding-left: 1em;\r\n",
"}\r\n",
"table td {\r\n",
" text-align: start;\r\n",
"}\r\n",
"table tr { \r\n",
" vertical-align: top; \r\n",
" margin: 0em 0px;\r\n",
"}\r\n",
"table tr td pre \r\n",
"{ \r\n",
" vertical-align: top !important; \r\n",
" margin: 0em 0px !important;\r\n",
"} \r\n",
"table th {\r\n",
" text-align: start;\r\n",
"}\r\n",
"</style>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"var familiesTypes = RevitPropDbReader.GetAllFamilyTypes();\n",
"display(familiesTypes)"
]
}
],
"metadata": {
Expand Down

0 comments on commit bed070c

Please sign in to comment.