Title: How to get all the elements given the project oid and the element type oid · Issue #1 · opensourceBIM/BIMserver-JavaScript-API · GitHub
Open Graph Title: How to get all the elements given the project oid and the element type oid · Issue #1 · opensourceBIM/BIMserver-JavaScript-API
X Title: How to get all the elements given the project oid and the element type oid · Issue #1 · opensourceBIM/BIMserver-JavaScript-API
Description: Hi, not really an issue here, but I can't get this piece of code returning correctly the toReturn array, so I'm here to ask for help. Let's say I want to get all the ifcwalls in a project with a particular ifcwalltype via javascript api....
Open Graph Description: Hi, not really an issue here, but I can't get this piece of code returning correctly the toReturn array, so I'm here to ask for help. Let's say I want to get all the ifcwalls in a project with a pa...
X Description: Hi, not really an issue here, but I can't get this piece of code returning correctly the toReturn array, so I'm here to ask for help. Let's say I want to get all the ifcwalls in a proje...
Opengraph URL: https://github.com/opensourceBIM/BIMserver-JavaScript-API/issues/1
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to get all the elements given the project oid and the element type oid","articleBody":"Hi,\nnot really an issue here, but I can't get this piece of code returning correctly the `toReturn` array, so I'm here to ask for help.\n\nLet's say I want to get all the ifcwalls in a project with a particular ifcwalltype via javascript api.\nI would like to know if there is a better way than my solution to archieve this and how can I get the \ntoReturn array back to the calling method, because now, probably due to timing issues, sometimes is empty, no matter how I return back the data.\n\n```\nvar BimServerGetElementsWithType = function(projectid,typeoid) { //project oid, ifcwalltype oid\n var toReturn = new Array();\n\n Global.bimServerApi.call(\"Bimsie1ServiceInterface\", \"getProjectByPoid\", {poid: projectid}, function(project) {\n Global.bimServerApi.call(\"Bimsie1LowLevelInterface\", \"getDataObjectByOid\", {roid: project.lastRevisionId, oid: typeoid},\n function(data) {\n data.values.forEach(function(value){\n if (value.__type == \"SListDataValue\" && value.fieldName ==\"ObjectTypeOf\") {\n value.values.forEach(function(listItem, index) {\n if (listItem.__type == \"SReferenceDataValue\" && listItem.typeName == \"IfcRelDefinesByType\") {\n\n Global.bimServerApi.call(\"Bimsie1LowLevelInterface\", \"getDataObjectByOid\", {roid: project.lastRevisionId, oid: listItem.oid},\n function(data) {\n data.values.forEach(function(value){\n if (value.__type == \"SListDataValue\") {\n value.values.forEach(function(listItem, index){\n if (listItem.__type == \"SReferenceDataValue\") {\n\n Global.bimServerApi.call(\"Bimsie1LowLevelInterface\", \"getDataObjectByOid\", {roid: project.lastRevisionId, oid: listItem.oid},\n function(data){\n toReturn.push(data); // push all the walls with type \"typeoid\" into the array.\n });\n };\n });\n };\n });\n });\n }\n });\n }\n });\n });\n });\n };\n```\n\nTIA for your time.\n","author":{"url":"https://github.com/raindog","@type":"Person","name":"raindog"},"datePublished":"2016-06-07T10:50:29Z","url":"https://github.com/opensourceBIM/BIMserver-JavaScript-API/issues/1"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7fdd6863-4b04-e05e-3c36-f62a14fcf8dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 817A:1173F1:1263F53:17F8FFD:6B04F88C |
| html-safe-nonce | e58071bd3875c69adddd3fdcfafc7da12c7436712ed404a7c74db0527243b265 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTdBOjExNzNGMToxMjYzRjUzOjE3RjhGRkQ6NkIwNEY4OEMiLCJ2aXNpdG9yX2lkIjoiMjYwNDIyMTE4MjY4MDA4NTg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 148f64124ab7c94e2decbb0d02059214189b4957d7106ad8643dd8734f7bf4dc |
| hovercard-subject-tag | issue:158893587 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/opensourceBIM/BIMserver-JavaScript-API/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00ba8f6e4f48c02a1063f113a841b3ae782d3178557699bff31a8ba3db7337c1/opensourceBIM/BIMserver-JavaScript-API/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00ba8f6e4f48c02a1063f113a841b3ae782d3178557699bff31a8ba3db7337c1/opensourceBIM/BIMserver-JavaScript-API/issues/1 |
| og:image:alt | Hi, not really an issue here, but I can't get this piece of code returning correctly the toReturn array, so I'm here to ask for help. Let's say I want to get all the ifcwalls in a project with a pa... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | raindog |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2c3971d6ab4be607cf9a26ac26ef0a7bfce380ec2ba14642e64028ad07a492b9 |
| turbo-cache-control | no-preview |
| go-import | github.com/opensourceBIM/BIMserver-JavaScript-API git https://github.com/opensourceBIM/BIMserver-JavaScript-API.git |
| octolytics-dimension-user_id | 767487 |
| octolytics-dimension-user_login | opensourceBIM |
| octolytics-dimension-repository_id | 49126254 |
| octolytics-dimension-repository_nwo | opensourceBIM/BIMserver-JavaScript-API |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49126254 |
| octolytics-dimension-repository_network_root_nwo | opensourceBIM/BIMserver-JavaScript-API |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b3f1d45dee14b3f87c64e9017a9c08d011561786 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width