Title: exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214&AP242 exp files · Issue #427 · stepcode/stepcode · GitHub
Open Graph Title: exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214&AP242 exp files · Issue #427 · stepcode/stepcode
X Title: exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214&AP242 exp files · Issue #427 · stepcode/stepcode
Description: Hi, I need to reorder ap214 or ap242 python code generated exp2python.exe when I use them as python STEP module in windows. exp2python.exe was generated in VS2019 professional by building cpp codes of SC.sln which were generated after cm...
Open Graph Description: Hi, I need to reorder ap214 or ap242 python code generated exp2python.exe when I use them as python STEP module in windows. exp2python.exe was generated in VS2019 professional by building cpp codes...
X Description: Hi, I need to reorder ap214 or ap242 python code generated exp2python.exe when I use them as python STEP module in windows. exp2python.exe was generated in VS2019 professional by building cpp codes...
Opengraph URL: https://github.com/stepcode/stepcode/issues/427
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214\u0026AP242 exp files","articleBody":"Hi,\r\nI need to reorder ap214 or ap242 python code generated exp2python.exe when I use them as python STEP module in windows.\r\nexp2python.exe was generated in VS2019 professional by building cpp codes of SC.sln which were generated after cmake generation.\r\n\r\nI'm checking python code in python 3.9.7, but the issue could be replicated in the other python environment because converted code declares with **_its def function and global variable_** invalid ordering.\r\n\r\nI can reduce the problems by reordering the declaration parts ... but we're not recommended to edited them.\r\n\r\n## 1. AP214\r\n\r\nIn command prompt,\r\n\r\n```\r\n\u003e SET PATH_TEMP=F:\\STEPLibrary\\github\\py_stepcode\\\r\n\u003e %PATH_TEMP%\\cmake-build\\Debug\\bin\\exp2python %PATH_TEMP%\\data\\ap214e3\\AP214E3_2010.exp\r\n```\r\nexp2python.exe generated 'automotive_design.py' and after I imported it:\r\n\r\n```python\r\n\u003e\u003e\u003e from automotive_design import *\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"F:\\STEPLibrary\\github\\py_stepcode\\src\\exp2python\\python\\example\\automotive_design.py\", line 1332, in \u003cmodule\u003e\r\n ypr_rotation = ARRAY(ypr_index(ypr_enumeration.yaw),ypr_index(ypr_enumeration.roll),'REAL', scope = schema_scope)\r\nNameError: name 'ypr_index' is not defined\r\n```\r\n\r\nSo, copy the file renamed as 'automotive_design_reorder.py' and _ def ypr_index_ (40260 line) _ ypr_enumeration _(1799 line) moved after import declaration:\r\n\r\n```python\r\n\u003e\u003e\u003e from automotive_design import *\r\n\u003e\u003e\u003e\r\n```\r\n\r\nThen, I checked import process.\r\n\r\n## 2. AP242\r\n\r\nexp2python.exe generated 'ap242_managed_model_based_3d_engineering_mim_lf.py' and after I imported it:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"F:\\STEPLibrary\\github\\py_stepcode\\src\\exp2python\\python\\example\\ap242_managed_model_based_3d_engineering_mim_lf.py\", line 76001\r\n if id_valid == TRUE:\r\nIndentationError: expected an indented block\r\n```\r\n\r\nI checked an indent was omitted at 76001 line \r\n\r\n```python\r\n####################\r\n # FUNCTION validate_attribute_id #\r\n####################\r\ndef validate_attribute_id(attid,):\r\n\t'''\r\n\t:param attid\r\n\t:type attid:STRING\r\n\t'''\r\n\tif ( not (attid[1] == letters)):\r\n\t\tid_valid = FALSE\r\n\tfor i in range(2,id_length,1):\r\nif id_valid == TRUE:\r\n\t\t\tif ( not (attid[i] == valid_chars)):\r\n\t\t\t\tid_valid = FALSE\r\n\treturn id_valid\r\n```\r\n\r\nand I corrected. Then I interpreted python code again:\r\n\r\n```python\r\n\u003e\u003e\u003e from ap242_managed_model_based_3d_engineering_mim_lf_reorder import *\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"F:\\STEPLibrary\\github\\py_stepcode\\src\\exp2python\\python\\example\\ap242_managed_model_based_3d_engineering_mim_lf_reorder.py\", line 2419, in \u003cmodule\u003e\r\n ypr_rotation = ARRAY(ypr_index(ypr_enumeration.yaw),ypr_index(ypr_enumeration.roll),'REAL', scope = schema_scope)\r\nNameError: name 'ypr_index' is not defined\r\n```\r\n\r\nthe error is similar to automotive_design.py, so reorder after import declaration and interpreted again:\r\n\r\n```python\r\n\u003e\u003e\u003e from ap242_managed_model_based_3d_engineering_mim_lf_reorder import *\r\n\u003e\u003e\u003e\r\n```\r\n\r\n---\r\n\r\nBy the way, How do you think these errors should be originated from *.exp file or exp2python?\r\nI wish these problems happened due to my operation mistakes...\r\n\r\n","author":{"url":"https://github.com/belre","@type":"Person","name":"belre"},"datePublished":"2021-10-13T04:37:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/427/stepcode/issues/427"}
| 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:ebfde433-eb7a-02f8-247c-9cb394a2acc5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A24A:11B87F:7162A63:94B1110:69753874 |
| html-safe-nonce | 5562e5c51087db6be0b2f1923ea4287b29f74c2af9855bbfce4ace009aa2b61c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjRBOjExQjg3Rjo3MTYyQTYzOjk0QjExMTA6Njk3NTM4NzQiLCJ2aXNpdG9yX2lkIjoiODA4NDA2MDA5NTY3MjMwMTY4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1f911415fdc0db8a032af1c2885333944b4641fe0cb0062fded1c598f85664e0 |
| hovercard-subject-tag | issue:1024768855 |
| 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/stepcode/stepcode/427/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15db29a6ad3bfd5dc8e17b341e19dd28e5ddc7e76fdfa9769ce8f0ec3707458e/stepcode/stepcode/issues/427 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15db29a6ad3bfd5dc8e17b341e19dd28e5ddc7e76fdfa9769ce8f0ec3707458e/stepcode/stepcode/issues/427 |
| og:image:alt | Hi, I need to reorder ap214 or ap242 python code generated exp2python.exe when I use them as python STEP module in windows. exp2python.exe was generated in VS2019 professional by building cpp codes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | belre |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/stepcode/stepcode git https://github.com/stepcode/stepcode.git |
| octolytics-dimension-user_id | 1761770 |
| octolytics-dimension-user_login | stepcode |
| octolytics-dimension-repository_id | 1975387 |
| octolytics-dimension-repository_nwo | stepcode/stepcode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1975387 |
| octolytics-dimension-repository_network_root_nwo | stepcode/stepcode |
| 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 | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width