Title: Correct way to remove complete Psets · Issue #1424 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Correct way to remove complete Psets · Issue #1424 · IfcOpenShell/IfcOpenShell
X Title: Correct way to remove complete Psets · Issue #1424 · IfcOpenShell/IfcOpenShell
Description: I'm trying to delete some Property Sets from multiple objects, but I have yet to find a way to do this properly. Currently I'm trying the following, but this leaves me with a corrupted ifc file. ifc = ifcopenshell.open(filepath) all_elem...
Open Graph Description: I'm trying to delete some Property Sets from multiple objects, but I have yet to find a way to do this properly. Currently I'm trying the following, but this leaves me with a corrupted ifc file. if...
X Description: I'm trying to delete some Property Sets from multiple objects, but I have yet to find a way to do this properly. Currently I'm trying the following, but this leaves me with a corrupted ifc ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/1424
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Correct way to remove complete Psets","articleBody":"I'm trying to delete some Property Sets from multiple objects, but I have yet to find a way to do this properly.\r\n\r\nCurrently I'm trying the following, but this leaves me with a corrupted ifc file.\r\n\r\n\r\n```\r\nifc = ifcopenshell.open(filepath)\r\n all_elements = ifc.by_type(element_type)\r\n for element in all_elements:\r\n if element.is_a('IfcTypeObject'):\r\n if element.HasPropertySets:\r\n for definition in element.HasPropertySets:\r\n if SOME CONDITION:\r\n ifc.remove(definition)\r\n else:\r\n for relationship in element.IsDefinedBy:\r\n if relationship.is_a('IfcRelDefinesByProperties'):\r\n definition = relationship.RelatingPropertyDefinition\r\n if SOME CONDITION:\r\n ifc.remove(ifc.by_guid(definition.GlobalId))\r\n```\r\n \r\nIf I save this ifc file and try to get the psets of elements with ifcopenshell.util.element.get_psets(element), I get multiple empty definitions back ( Like remains of the Psets that I wanted to delete).\r\nIn my final Code I want to only delete some Psets (f.e. based on name)\r\n\r\nHow would I go about cleanly removing complete Psets.\r\n\r\nThank you!","author":{"url":"https://github.com/AlexanderNitsch","@type":"Person","name":"AlexanderNitsch"},"datePublished":"2021-04-08T09:27:33Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/1424"}
| 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:785e29ff-0aa5-a26c-5be2-587807c5088f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC44:3A4306:51D2E:6FB99:6B04A347 |
| html-safe-nonce | d9e716b29100769750247889cd29ccb1f99e3a81dc45439f308b2e287fca94d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzQ0OjNBNDMwNjo1MUQyRTo2RkI5OTo2QjA0QTM0NyIsInZpc2l0b3JfaWQiOiIyODczMTY2NTU1Mzk3NzkyNTgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f485ab71b08d96b8149d08f19a8e8f51cafe0fe62aaa615ebfd18854b18d9b14 |
| hovercard-subject-tag | issue:853267925 |
| 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/IfcOpenShell/IfcOpenShell/1424/issue_layout |
| twitter:image | https://opengraph.githubassets.com/288ef5b6421b7bad83e454b4b8912d2927d64cec5bcc4128696b11fa286ba90e/IfcOpenShell/IfcOpenShell/issues/1424 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/288ef5b6421b7bad83e454b4b8912d2927d64cec5bcc4128696b11fa286ba90e/IfcOpenShell/IfcOpenShell/issues/1424 |
| og:image:alt | I'm trying to delete some Property Sets from multiple objects, but I have yet to find a way to do this properly. Currently I'm trying the following, but this leaves me with a corrupted ifc file. if... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexanderNitsch |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| turbo-cache-control | no-preview |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| 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