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 28, 2024
1 parent 3aae952 commit c050687
Showing 1 changed file with 24 additions and 71 deletions.
95 changes: 24 additions & 71 deletions docs/Tutorials/08. Explore Pull Data From ACC BIM360 API.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -18,29 +18,20 @@
{
"data": {
"text/html": [
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>APSToolkit, 1.0.5</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"Loading extensions from `C:\\Users\\vho2\\.nuget\\packages\\microsoft.data.analysis\\0.21.1\\interactive-extensions\\dotnet\\Microsoft.Data.Analysis.Interactive.dll`"
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>APSToolkit, 1.0.8-beta</span></li></ul></div></div>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#r \"nuget: APSToolkit\""
"#r \"nuget:APSToolkit , 1.0.8-beta\""
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand Down Expand Up @@ -75,7 +66,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -96,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -110,9 +101,10 @@
},
"outputs": [],
"source": [
"using Autodesk.Forge;\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;"
"var token3Leg = Authentication.Refresh3LeggedToken(scope).Result;"
]
},
{
Expand All @@ -135,7 +127,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 17,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -149,8 +141,8 @@
},
"outputs": [],
"source": [
"string projectId = \"ec0f8261-aeca-4ab9-a1a5-5845f952b17d\";\n",
"string versionId = \"urn:adsk.wipprod:fs.file:vf.Od8txDbKSSelToVg1oc1VA?version=26\";"
"string projectId = \"b.ca790fb5-141d-4ad5-b411-0461af2e9748\";\n",
"string versionId = \"urn:adsk.wipprod:fs.file:vf.Od8txDbKSSelToVg1oc1VA?version=28\";"
]
},
{
Expand All @@ -162,7 +154,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -178,15 +170,15 @@
"source": [
"using APSToolkit.BIM360;\n",
"using Autodesk.Forge;\n",
"BIM360 bim360 = new BIM360();\n",
"BIM360 bim360 = new BIM360(token3Leg);\n",
"\n",
"BIMData[] bimDatas = bim360.GetAllDataByVersionId(token3Leg,projectId,versionId);\n",
"BIMData[] bimDatas = bim360.GetAllDataByVersionId(projectId,versionId);\n",
"BIMData bimData = bimDatas.FirstOrDefault(x => x.externalId == \"5bb069ca-e4fe-4e63-be31-f8ac44e80d30-000471ee\");"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 9,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
Expand All @@ -200,55 +192,16 @@
},
"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"
"ename": "Error",
"evalue": "(1,39): error CS0103: The name 'bimData' does not exist in the current context\r\n(2,45): error CS0103: The name 'bimData' does not exist in the current context\r\n(3,42): error CS0103: The name 'bimData' does not exist in the current context\r\n(4,42): error CS0103: The name 'bimData' does not exist in the current context\r\n(7,1): error CS0103: The name 'bimData' does not exist in the current context",
"output_type": "error",
"traceback": [
"(1,39): error CS0103: The name 'bimData' does not exist in the current context\r\n",
"(2,45): error CS0103: The name 'bimData' does not exist in the current context\r\n",
"(3,42): error CS0103: The name 'bimData' does not exist in the current context\r\n",
"(4,42): error CS0103: The name 'bimData' does not exist in the current context\r\n",
"(7,1): error CS0103: The name 'bimData' does not exist in the current context"
]
},
{
"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": [
Expand Down

0 comments on commit c050687

Please sign in to comment.