Title: AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' · Issue #5458 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' · Issue #5458 · IfcOpenShell/IfcOpenShell
X Title: AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' · Issue #5458 · IfcOpenShell/IfcOpenShell
Description: I am getting the error builder = ifcopenshell.util.shape_builder.ShapeBuilder(model) AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' while creating custom representations. I am using it as import ifcopenshell ...
Open Graph Description: I am getting the error builder = ifcopenshell.util.shape_builder.ShapeBuilder(model) AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' while creating custom representation...
X Description: I am getting the error builder = ifcopenshell.util.shape_builder.ShapeBuilder(model) AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' while creating custo...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/5458
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder'","articleBody":"I am getting the error \r\n```\r\nbuilder = ifcopenshell.util.shape_builder.ShapeBuilder(model)\r\nAttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder'\r\n```\r\nwhile creating [custom representations](https://docs.ifcopenshell.org/ifcopenshell-python/geometry_creation.html#custom-representations). I am using it as \r\n\r\n```\r\nimport ifcopenshell\r\nfrom ifcopenshell.api import run\r\n\r\nmodel = ifcopenshell.file()\r\nproject = run(\"root.create_entity\", model, ifc_class=\"IfcProject\", name='project_name')\r\nlength_unit = run(\"unit.add_conversion_based_unit\", model, name=\"FOOT\")\r\nrun(\"unit.assign_unit\", model, units=[length_unit])\r\ncontext = run(\"context.add_context\", model, context_type=\"Model\")\r\nbody = run(\"context.add_context\", model, context_type=\"Model\",\r\n context_identifier=\"Body\", target_view=\"MODEL_VIEW\", parent=context)\r\nsite = run(\"root.create_entity\", model, ifc_class=\"IfcSite\", name='site_name')\r\nbuilding = run(\"root.create_entity\", model, ifc_class=\"IfcBuilding\", name='building_name')\r\nstorey = run(\"root.create_entity\", model, ifc_class=\"IfcBuildingStorey\", name='storey_name')\r\nrun(\"aggregate.assign_object\", model, relating_object=project, products=[site])\r\nrun(\"aggregate.assign_object\", model, relating_object=site, products=[building])\r\nrun(\"aggregate.assign_object\", model, relating_object=building, products=[storey])\r\nelement = run(\"root.create_entity\", model, ifc_class='IfcPipeSegment')\r\n\r\nbuilder = ifcopenshell.util.shape_builder.ShapeBuilder(model)\r\n\r\n# Sweep a 10mm radius disk along a polyline with a couple of straight segments and an arc.\r\ncurve = builder.polyline(\r\n [(0., 0., 0.), (100., 0., 0.), (171., 29., 0.), (200., 100., 0.), (200., 200., 0.)],\r\n arc_points=[2])\r\nswept_curve = builder.create_swept_disk_solid(curve, 10)\r\n\r\n# Create a body representation\r\nbody = ifcopenshell.util.representation.get_context(model, \"Model\", \"Body\", \"MODEL_VIEW\")\r\nrepresentation = builder.get_representation(body, swept_curve)\r\nrun(\"geometry.assign_representation\", model, product=element, representation=representation)\r\nrun(\"spatial.assign_container\", model, relating_structure=storey, products=[element])\r\noutput_file = \"ifcopenshell_trial.ifc\"\r\nmodel.write(output_file)\r\nprint(f\"IFC file saved as {output_file}\")\r\n```\r\n\r\n\r\nThe ifcopenshell version I am using is `'0.8.0'` and python version is `Python 3.9.0`","author":{"url":"https://github.com/yashkcv","@type":"Person","name":"yashkcv"},"datePublished":"2024-09-23T12:55:08Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/5458"}
| 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:cbf06a4b-0af5-cf89-d41d-d02380cc56c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 872E:13E066:3585C7:47702D:6B04B95D |
| html-safe-nonce | 59e948bd5a45cbb31e0c07deb3891f4cc2e42a754538af711ec05f4bcf983a10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzJFOjEzRTA2NjozNTg1Qzc6NDc3MDJEOjZCMDRCOTVEIiwidmlzaXRvcl9pZCI6IjM0MTEyMDU1NzM5NDgyNTg2NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 344e473d0e03a30af926840964da40beee25277400629bea77b0b65d16de0eea |
| hovercard-subject-tag | issue:2542552618 |
| 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/5458/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a1f1b472466aa83f0dbb8c3e56433c44eedd59f08d53be0a4a69bf30db795d0/IfcOpenShell/IfcOpenShell/issues/5458 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a1f1b472466aa83f0dbb8c3e56433c44eedd59f08d53be0a4a69bf30db795d0/IfcOpenShell/IfcOpenShell/issues/5458 |
| og:image:alt | I am getting the error builder = ifcopenshell.util.shape_builder.ShapeBuilder(model) AttributeError: module 'ifcopenshell.util' has no attribute 'shape_builder' while creating custom representation... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yashkcv |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| 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 | b032e77f1ea437ede6c115446a0a467709b468e7 |
| 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