GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — exp2python.exe built in VS2019 converts into unparsable code for python3 from AP214&AP242 exp files · Issue #427 · stepcode/stepcode Open DescriptionHi, I'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. I can reduce the problems by reordering the declaration parts ... but we're not recommended to edited them. 1. AP214In command prompt, exp2python.exe generated 'automotive_design.py' and after I imported it: >>> from automotive_design import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "F:\STEPLibrary\github\py_stepcode\src\exp2python\python\example\automotive_design.py", line 1332, in <module> ypr_rotation = ARRAY(ypr_index(ypr_enumeration.yaw),ypr_index(ypr_enumeration.roll),'REAL', scope = schema_scope) NameError: name 'ypr_index' is not defined So, copy the file renamed as 'automotive_design_reorder.py' and _ def ypr_index_ (40260 line) _ ypr_enumeration _(1799 line) moved after import declaration: >>> from automotive_design import * >>> Then, I checked import process. 2. AP242exp2python.exe generated 'ap242_managed_model_based_3d_engineering_mim_lf.py' and after I imported it: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "F:\STEPLibrary\github\py_stepcode\src\exp2python\python\example\ap242_managed_model_based_3d_engineering_mim_lf.py", line 76001 if id_valid == TRUE: IndentationError: expected an indented block I checked an indent was omitted at 76001 line #################### # FUNCTION validate_attribute_id # #################### def validate_attribute_id(attid,): ''' :param attid :type attid:STRING ''' if ( not (attid[1] == letters)): id_valid = FALSE for i in range(2,id_length,1): if id_valid == TRUE: if ( not (attid[i] == valid_chars)): id_valid = FALSE return id_valid and I corrected. Then I interpreted python code again: >>> from ap242_managed_model_based_3d_engineering_mim_lf_reorder import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "F:\STEPLibrary\github\py_stepcode\src\exp2python\python\example\ap242_managed_model_based_3d_engineering_mim_lf_reorder.py", line 2419, in <module> ypr_rotation = ARRAY(ypr_index(ypr_enumeration.yaw),ypr_index(ypr_enumeration.roll),'REAL', scope = schema_scope) NameError: name 'ypr_index' is not defined the error is similar to automotive_design.py, so reorder after import declaration and interpreted again: >>> from ap242_managed_model_based_3d_engineering_mim_lf_reorder import * >>> By the way, How do you think these errors should be originated from *.exp file or exp2python? Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |