Title: ifcopenshell.util.cost | calculate_applied_value for multiple CostValues · Issue #5912 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: ifcopenshell.util.cost | calculate_applied_value for multiple CostValues · Issue #5912 · IfcOpenShell/IfcOpenShell
X Title: ifcopenshell.util.cost | calculate_applied_value for multiple CostValues · Issue #5912 · IfcOpenShell/IfcOpenShell
Description: I have an IfcCostItem #72=IfcCostItem(GlobalID,$,'item2 composite value from formula',$,$,$,$,(#77,#85),(#76)) highlighted in the image below: to quickly list its CostValues I use list(model.by_id(72).CostValues) ouput: [#77=IfcCostValue...
Open Graph Description: I have an IfcCostItem #72=IfcCostItem(GlobalID,$,'item2 composite value from formula',$,$,$,$,(#77,#85),(#76)) highlighted in the image below: to quickly list its CostValues I use list(model.by_id(...
X Description: I have an IfcCostItem #72=IfcCostItem(GlobalID,$,'item2 composite value from formula',$,$,$,$,(#77,#85),(#76)) highlighted in the image below: to quickly list its CostValues I use list(mode...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/5912
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ifcopenshell.util.cost | calculate_applied_value for multiple CostValues","articleBody":"I have an IfcCostItem\r\n`#72=IfcCostItem(GlobalID,$,'item2 composite value from formula',$,$,$,$,(#77,#85),(#76))`\r\nhighlighted in the image below:\r\n\r\n\r\n\r\nto quickly list its CostValues I use\r\n`list(model.by_id(72).CostValues)`\r\nouput:\r\n```[#77=IfcCostValue($,$,IfcMonetaryMeasure(50.),$,$,$,$,$,.MULTIPLY.,(#78,#79)), #85=IfcCostValue($,$,IfcMonetaryMeasure(0.),$,$,$,$,$,.MULTIPLY.,(#86,#87))]```\r\n\r\n### AppliedValue not accurate\r\nif I check the AppliedValue of the first CostValue `#77` I have\r\n`model.by_id(77).AppliedValue.wrappedValue`\r\noutput: **50** (shouldn't it be **40** since it's 8.0 * 5.0?)\r\nand CostValue `#85` returns 0 instead of 42.00\r\n\r\n### Function to calculate sum of multiple AppliedValue\r\nusing the available function\r\n```ifcopenshell.util.cost.calculate_applied_value(model.by_id(72),model.by_id(77))```\r\nreturns the expected value **40** = 8.0 * 5.0\r\nbut it's limited to one cost value at the time (?) and requires a custom loop to get the total related to the cost item\r\n\r\n### request\r\napart from \"AppliedValue not accurate\" apparent issue, it would be useful to have a new function to sum all CostValues in a cost item without creating a custom function with loop, or if already available I couldn't find it :)\r\n```ifcopenshell.util.cost.get_cost_values(cost_item)``` returns a list of dictionaries I couldn't find suitable for that purpose\r\n\r\nmany thanks for your kind assistance, always appreciated\r\n\r\nping @maxfb87 @myoualid ","author":{"url":"https://github.com/steverugi","@type":"Person","name":"steverugi"},"datePublished":"2024-12-29T09:11:08Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/5912"}
| 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:108f6d54-4b8b-5d96-08a2-d86b9799bd27 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8280:342426:91B67:C8BEC:6B04A700 |
| html-safe-nonce | fd616092a834ef6f7d46496b0bc512ad593846e93b3d8aa680ba009698b4ed97 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjgwOjM0MjQyNjo5MUI2NzpDOEJFQzo2QjA0QTcwMCIsInZpc2l0b3JfaWQiOiIzMDIzMDIzMzAyOTk5NTgyNDY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 22fe56e9bd3c90a6c421a706fd538838be2746d2b092fe882f3fef2b65fac995 |
| hovercard-subject-tag | issue:2762169133 |
| 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/5912/issue_layout |
| twitter:image | https://opengraph.githubassets.com/741ed994e6a02ec7f041bd91a008e49ea19a7f00b9a53d60179dc5352883ded2/IfcOpenShell/IfcOpenShell/issues/5912 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/741ed994e6a02ec7f041bd91a008e49ea19a7f00b9a53d60179dc5352883ded2/IfcOpenShell/IfcOpenShell/issues/5912 |
| og:image:alt | I have an IfcCostItem #72=IfcCostItem(GlobalID,$,'item2 composite value from formula',$,$,$,$,(#77,#85),(#76)) highlighted in the image below: to quickly list its CostValues I use list(model.by_id(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | steverugi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| 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 | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| 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