Title: Bonsai: make dxf2ifc.py example script skip unsupported DXF entities by petruconduraru · Pull Request #8780 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: make dxf2ifc.py example script skip unsupported DXF entities by petruconduraru · Pull Request #8780 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: make dxf2ifc.py example script skip unsupported DXF entities by petruconduraru · Pull Request #8780 · IfcOpenShell/IfcOpenShell
Description: Summary The dxf2ifc.py example script crashed with AttributeError: 'Line' object has no attribute 'get_mode' on any DXF containing entities other than POLYLINE, because Polyline.get_mode() was called on every modelspace entity. This made the script unusable on typical 2D CAD drawings — the exact failure reported in #2151, where @Moult also noted unsupported geometry "probably shouldn't give errors". This change tests for polyface meshes with dxftype() == "POLYLINE" and is_poly_face_mesh, skips other entities with a message naming their type, only creates the spatial containment relation when there are converted products, and replaces the hardcoded input.dxf/test.ifc with command-line arguments matching the sibling obj2ifc.py — so usage and the AcDbPolyFaceMesh-only limitation are visible from --help, covering the documentation ask in the issue. Fixes #2151 Test plan Tested with ezdxf 1.4.4 / ifcopenshell 0.8.5: A typical 2D drawing (lines, circles, polyline, text) now completes cleanly instead of crashing on the first entity. A polyface-mesh DXF still converts to a valid IfcFacetedBrep (identical geometry before/after, verified via create_shape). A mixed file converts the polyface cube, skips the rest with named messages, and produces one proxy plus one containment relation. black+ruff clean (CI-exact toolchain, repo context). This PR contains AI-generated code, generated with the assistance of an AI coding tool.
Open Graph Description: Summary The dxf2ifc.py example script crashed with AttributeError: 'Line' object has no attribute 'get_mode' on any DXF containing entities other than POLYLINE, because Polyline.get...
X Description: Summary The dxf2ifc.py example script crashed with AttributeError: 'Line' object has no attribute 'get_mode' on any DXF containing entities other than POLYLINE, beca...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8780
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:be8a3542-19f6-e5f9-71a5-58da40d58ec2 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E562:25C00B:2B1DD2:393909:6B04B6A4 |
| html-safe-nonce | 7d37fb981992f8373f6d5430deba9d9c0310fcfb8a2a695a9deb4cc2f0d934f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTYyOjI1QzAwQjoyQjFERDI6MzkzOTA5OjZCMDRCNkE0IiwidmlzaXRvcl9pZCI6IjI5NTc4NjI3NzM2MDQwMDU1NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bd5d53eea8aeeb9a5f7c90e41e18e1e190e141650875c950f84bc6a12446b579 |
| hovercard-subject-tag | pull_request:4087063606 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/IfcOpenShell/IfcOpenShell/pull/8780/files |
| twitter:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| og:image:alt | Summary The dxf2ifc.py example script crashed with AttributeError: 'Line' object has no attribute 'get_mode' on any DXF containing entities other than POLYLINE, because Polyline.get... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| 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 |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width