René's URL Explorer Experiment


Title: Update entity_instance.get_info() to have more control over error handling · Issue #2811 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Update entity_instance.get_info() to have more control over error handling · Issue #2811 · IfcOpenShell/IfcOpenShell

X Title: Update entity_instance.get_info() to have more control over error handling · Issue #2811 · IfcOpenShell/IfcOpenShell

Description: I received a huge ifc with some small errors. A few products where missing the ObjectPlacement entity. The file is huge and I am not the author, thus sharing is difficault but I created a simple ifc and commented the entity to show the p...

Open Graph Description: I received a huge ifc with some small errors. A few products where missing the ObjectPlacement entity. The file is huge and I am not the author, thus sharing is difficault but I created a simple if...

X Description: I received a huge ifc with some small errors. A few products where missing the ObjectPlacement entity. The file is huge and I am not the author, thus sharing is difficault but I created a simple if...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/2811

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update entity_instance.get_info() to have more control over error handling","articleBody":"I received a huge ifc with some small errors. A few products where missing the ObjectPlacement entity. The file is huge and I am not the author, thus sharing is difficault but I created a simple ifc and commented the entity to show the problem. It can be downloaded in this post: https://github.com/yorikvanhavre/FreeCAD-NativeIFC/issues/23#issuecomment-1443364204\r\n\r\nthe following code is handled in IfcOS, if it is put in a try: except everything is fine ... \r\n\r\n```\r\ns = ifcfile[80]\r\ns.ObjectPlacement\r\n\r\ntry:\r\n    s.ObjectPlacement\r\nexcept Exception:\r\n    print(False)\r\n```\r\n\r\n\r\n```\r\n>>> \r\n>>> s = ifcfile[80]\r\n>>> s.ObjectPlacement\r\nTraceback (most recent call last):\r\n  File \"\u003cinput>\", line 1, in \u003cmodule>\r\n  File \"C:\\0_BHA_privat\\progr\\FreeCAD\\FreeCAD_0.21.xxxxx\\bin\\lib\\site-packages\\ifcopenshell\\entity_instance.py\", line 136, in __getattr__\r\n    self.wrapped_data.get_argument(idx), self.wrapped_data.file\r\n  File \"C:\\0_BHA_privat\\progr\\FreeCAD\\FreeCAD_0.21.xxxxx\\bin\\lib\\site-packages\\ifcopenshell\\ifcopenshell_wrapper.py\", line 4833, in get_argument\r\n    return _ifcopenshell_wrapper.entity_instance_get_argument(self, *args)\r\nRuntimeError: Instance #77 not found\r\n>>> \r\n>>> try:\r\n...     s.ObjectPlacement\r\n... except Exception:\r\n...     print(False)\r\n... \r\nFalse\r\n>>> \r\n```\r\n\r\nBUT get.info() raises a unhandled Exception in IfcOpenShell, thus it does not help to put it in a try: except: the unhandled exception is raised anyway ...\r\n\r\n\r\n```\r\ns = ifcfile[80]\r\ns.get_info()\r\n\r\ntry:\r\n    s.get_info()\r\nexcept Exception:\r\n    print(False)\r\n```\r\n\r\n```\r\n>>> s = ifcfile[80]\r\n>>> s.get_info()\r\n{'id': 80, 'type': 'IfcSlab', 'GlobalId': '2JwE5lcKXFKvWOrg3uyxKD', 'OwnerHistory': #5=IfcOwnerHistory(#3,#4,$,.ADDED.,1677231549,#3,#4,1677231549), 'Name': 'Structure', 'Description': '', 'ObjectType': None, 'Representation': #79=IfcProductDefinitionShape($,$,(#78)), 'Tag': None, 'PredefinedType': 'NOTDEFINED'}\r\n>>> \r\n>>> try:\r\n...     s.get_info()\r\n... except Exception:\r\n...     print(False)\r\n... \r\n{'id': 80, 'type': 'IfcSlab', 'GlobalId': '2JwE5lcKXFKvWOrg3uyxKD', 'OwnerHistory': #5=IfcOwnerHistory(#3,#4,$,.ADDED.,1677231549,#3,#4,1677231549), 'Name': 'Structure', 'Description': '', 'ObjectType': None, 'Representation': #79=IfcProductDefinitionShape($,$,(#78)), 'Tag': None, 'PredefinedType': 'NOTDEFINED'}\r\n>>> \r\n```\r\n\r\nas said in both cases the following unhandled exception is raised ... \r\n\r\n```\r\n21:51:26  ERROR:root:unhandled exception occurred setting attribute name for #80=IfcSlab('2JwE5lcKXFKvWOrg3uyxKD',#5,'Structure','',$,#77,#79,$,.NOTDEFINED.)\r\nTraceback (most recent call last):\r\n  File \"C:\\0_BHA_privat\\progr\\FreeCAD\\FreeCAD_0.21.xxxxx\\bin\\lib\\site-packages\\ifcopenshell\\entity_instance.py\", line 477, in _\r\n    attr_value = self[i]\r\n  File \"C:\\0_BHA_privat\\progr\\FreeCAD\\FreeCAD_0.21.xxxxx\\bin\\lib\\site-packages\\ifcopenshell\\entity_instance.py\", line 242, in __getitem__\r\n    self.wrapped_data.get_argument(key), self.wrapped_data.file\r\n  File \"C:\\0_BHA_privat\\progr\\FreeCAD\\FreeCAD_0.21.xxxxx\\bin\\lib\\site-packages\\ifcopenshell\\ifcopenshell_wrapper.py\", line 4833, in get_argument\r\n    return _ifcopenshell_wrapper.entity_instance_get_argument(self, *args)\r\nRuntimeError: Instance #77 not found\r\n```\r\n\r\nIMHO this should not happen, or am I wrong?","author":{"url":"https://github.com/berndhahnebach","@type":"Person","name":"berndhahnebach"},"datePublished":"2023-02-26T20:51:58Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/2811"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e564d489-b2c4-d3ce-7429-91d10e4b6b55
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB22A:20D380:6D63B1:95CEDD:6B047687
html-safe-noncee15db846c874f8f4083861a156936b87242c045febb49fa0f2bc8e6811d67feb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjJBOjIwRDM4MDo2RDYzQjE6OTVDRUREOjZCMDQ3Njg3IiwidmlzaXRvcl9pZCI6IjE3OTczNTA4Njc3ODQyMDE4NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd8d9277a9e7eefdaa32a3d719b0ff5da1c8964c76a76e2b13cd1f4c023303b21
hovercard-subject-tagissue:1600196962
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/2811/issue_layout
twitter:imagehttps://opengraph.githubassets.com/73843981fcfc7b273def96e8926d691f18aebdd5d5eca276003a88d225ea4853/IfcOpenShell/IfcOpenShell/issues/2811
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/73843981fcfc7b273def96e8926d691f18aebdd5d5eca276003a88d225ea4853/IfcOpenShell/IfcOpenShell/issues/2811
og:image:altI received a huge ifc with some small errors. A few products where missing the ObjectPlacement entity. The file is huge and I am not the author, thus sharing is difficault but I created a simple if...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameberndhahnebach
hostnamegithub.com
expected-hostnamegithub.com
None9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecf73f57448d52b3a7b619195e182b33d3b3454ca
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F2811
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F2811
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests937 (937)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/2811
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/2811
Update entity_instance.get_info() to have more control over error handlinghttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811#top
IfcOpenShell-Pythonhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Python%22
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issue-1600196962
yorikvanhavre/FreeCAD-NativeIFC#23 (comment)https://github.com/yorikvanhavre/FreeCAD-NativeIFC/issues/23#issuecomment-1443364204
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445464647
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445478632
Moulthttps://github.com/Moult
IfcOpenShell-Pythonhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Python%22
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#event-8610257225
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445487119
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 26, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445500166
https://github.com/aothms
aothmshttps://github.com/aothms
on Feb 27, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445851912
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 27, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447175365
@berndhahnebachhttps://github.com/berndhahnebach
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447795923
berndhahnebach/FreeCAD-NativeIFC@fc0a84fhttps://github.com/berndhahnebach/FreeCAD-NativeIFC/commit/fc0a84f70d85b1b0ea09415c083685b71290805f
https://github.com/aothms
aothmshttps://github.com/aothms
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447839548
https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/entity_instance.py#L505-L510https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcopenshell-python/ifcopenshell/entity_instance.py#L505-L510
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447851719
@yorikvanhavrehttps://github.com/yorikvanhavre
https://github.com/aothms
aothmshttps://github.com/aothms
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447865056
aothmshttps://github.com/aothms
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#event-8624719257
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1447880783
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448005318
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448019757
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448029671
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448057914
https://github.com/yorikvanhavre
yorikvanhavrehttps://github.com/yorikvanhavre
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448367169
@Moulthttps://github.com/Moult
@aothmshttps://github.com/aothms
yorikvanhavre/FreeCAD-NativeIFC#23https://github.com/yorikvanhavre/FreeCAD-NativeIFC/issues/23
https://github.com/Moult
Moulthttps://github.com/Moult
on Feb 28, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1448964598
@yorikvanhavrehttps://github.com/yorikvanhavre
catches and logs errorshttps://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445500166
@berndhahnebachhttps://github.com/berndhahnebach
https://github.com/yorikvanhavre
yorikvanhavrehttps://github.com/yorikvanhavre
on Mar 2, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1451734215
@yorikvanhavrehttps://github.com/yorikvanhavre
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Mar 2, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1452047173
https://github.com/berndhahnebach
berndhahnebachhttps://github.com/berndhahnebach
on Mar 2, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1452064283
#2811 (comment)https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1445500166
https://user-images.githubusercontent.com/6129869/222474716-b838b9ad-73be-4b5f-9931-58a4101b4ec2.png
https://github.com/Moult
Moulthttps://github.com/Moult
on Mar 2, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1452662630
https://docs.python.org/3/howto/logging.html#when-to-use-logginghttps://docs.python.org/3/howto/logging.html#when-to-use-logging
@aothmshttps://github.com/aothms
https://github.com/Moult
Moulthttps://github.com/Moult
on Mar 2, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1452708922
#88https://github.com/IfcOpenShell/IfcOpenShell/pull/88
#88https://github.com/IfcOpenShell/IfcOpenShell/pull/88
https://github.com/IfcOpenShell/step-file-parserhttps://github.com/IfcOpenShell/step-file-parser
https://github.com/aothms
aothmshttps://github.com/aothms
on Mar 3, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1453112391
https://github.com/IfcOpenShell/step-file-parserhttps://github.com/IfcOpenShell/step-file-parser
https://github.com/Moult
Moulthttps://github.com/Moult
on Mar 5, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1454943139
@berndhahnebachhttps://github.com/berndhahnebach
https://github.com/aothms
aothmshttps://github.com/aothms
on Mar 5, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-1455038655
@berndhahnebachhttps://github.com/berndhahnebach
https://github.com/petruconduraru
petruconduraruhttps://github.com/petruconduraru
on Jul 11, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/2811#issuecomment-4943804766
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/2811
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/2811
IfcOpenShell-Pythonhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Python%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.