Skip to content

Commit

Permalink
Update 08. Explore Pull Data From ACC BIM360 API.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
chuongmep committed Feb 27, 2024
1 parent 302d622 commit 1e916d1
Showing 1 changed file with 149 additions and 1 deletion.
150 changes: 149 additions & 1 deletion docs/Tutorials/08. Explore Pull Data From ACC BIM360 API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -84,6 +84,154 @@
"// please visit tutorial : 01.Setup And Authentication.ipynb for more details\n",
"var token = Authentication.Get2LeggedToken().Result;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## ACC - BIM360"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Please check tutorial and code in the following notebook:\n",
"\n",
"[02. Explore Hubs - Projects - Items - URN](./02.%20Explore%20Hubs%20-%20Projects%20-%20Items%20-%20URN.ipynb)\n",
"\n",
"[03. Explore Versions Item and Derivative Urn](./03.%20Explore%20Versions%20Item%20and%20Derivative%20Urn.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
"source": [
"string projectId = \"ec0f8261-aeca-4ab9-a1a5-5845f952b17d\";\n",
"string versionId = \"urn:adsk.wipprod:fs.file:vf.Od8txDbKSSelToVg1oc1VA?version=26\";"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Get All Data By Version Id"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [],
"source": [
"using APSToolkit.BIM360;\n",
"using Autodesk.Forge;\n",
"BIM360 bim360 = new BIM360();\n",
"Scope[] scope = new Scope[]\n",
" { Scope.DataRead, Scope.DataWrite, Scope.DataCreate, Scope.BucketRead, Scope.BucketCreate, Scope.CodeAll };\n",
"string token3Leg = Authentication.Refresh3LeggedToken(scope).Result;\n",
"BIMData[] bimDatas = bim360.GetAllDataByVersionId(token3Leg,projectId,versionId);\n",
"BIMData bimData = bimDatas.FirstOrDefault(x => x.externalId == \"5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee\");"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
},
"polyglot_notebook": {
"kernelName": "csharp"
},
"vscode": {
"languageId": "polyglot-notebook"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"BIMData DbId : 3551\n",
"BIMData ExternalId : 5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee\n",
"BIMData bboxMin : <7.0552554, 0.6997561, 0>\n",
"BIMData bboxMax : <8.122055, 0.90295607, 2.2098>\n",
"BIMData Properties : \n"
]
},
{
"data": {
"text/html": [
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>APSToolkit.BIM360.BIMProperty</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre>_RC</pre></div></td></tr><tr><td>Type</td><td><div class=\"dni-plaintext\"><pre>String</pre></div></td></tr><tr><td>Category</td><td><div class=\"dni-plaintext\"><pre>__category__</pre></div></td></tr><tr><td>Value</td><td><div class=\"dni-plaintext\"><pre>Doors</pre></div></td></tr><tr><td>Unit</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr></tbody></table></div></details><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": [
"Console.WriteLine(\"BIMData DbId : \" + bimData.DbId);\n",
"Console.WriteLine(\"BIMData ExternalId : \" + bimData.externalId);\n",
"Console.WriteLine(\"BIMData bboxMin : \" + bimData.bboxMin);\n",
"Console.WriteLine(\"BIMData bboxMax : \" + bimData.bboxMax);\n",
"// properties\n",
"Console.WriteLine(\"BIMData Properties : \");\n",
"bimData.properties[0]"
]
}
],
"metadata": {
Expand Down

0 comments on commit 1e916d1

Please sign in to comment.