Geometric Data Extraction from text file of STEP 3D model

  • Thread starter Thread starter M Saad Hassan
  • Start date Start date
M

M Saad Hassan

Guest
I have text file containing multiple text lines i want to extract specific entities and corresponding values enclosed in entity brackets. after getting all then want to create object oriented flow according to them.

I dont how how to start it, like first i will read text file then i will store all lines in a list or array? then how will get all line to perform split operation to get the final parameters value enclosed in (braces).

Working flow for extracting data here:
For feature extraction you first need to scan your STEP file and extract geometrical data. For this, you need to understand STEP entities first. The flow of entites from line numbers contained in the STEP file of the part. Start with closed_shell (it contains list of faces contained in the part
in the form of line numbers), goto these line numbers you ll reach faces of the part. you can count manually the faces and compare it with line numbers in closed shell. build a flow chart for data line by line untill you reach cartesian point and vector direction.
Print out your STEP file for the selected part and develop you flow from advanced_Face to cartesian point manually.

If someone help it will be great effort.
thanks.

ISO-10303-21;
HEADER;
FILE_DESCRIPTION (( 'STEP AP203' ),
'1' );
FILE_NAME ('cylinder.STEP',
'2018-08-09T04:08:29',
( '' ),
( '' ),
'SwSTEP 2.0',
'SolidWorks 2013',
'' );
FILE_SCHEMA (( 'CONFIG_CONTROL_DESIGN' ));
ENDSEC;

DATA;
#1 = CIRCLE ( 'NONE', #68, 0.5336587240032778500 ) ;
#2 = CC_DESIGN_APPROVAL ( #168, ( #9 ) ) ;
#3 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#4 = EDGE_CURVE ( 'NONE', #151, #170, #138, .T. ) ;
#5 = UNCERTAINTY_MEASURE_WITH_UNIT (LENGTH_MEASURE( 1.000000000000000100E-005 ), #43, 'distance_accuracy_value', 'NONE');
#6 = ORIENTED_EDGE ( 'NONE', *, *, #167, .T. ) ;
#7 = COORDINATED_UNIVERSAL_TIME_OFFSET ( 8, 0, .AHEAD. ) ;
#8 = EDGE_LOOP ( 'NONE', ( #50, #77 ) ) ;
#9 = PRODUCT_DEFINITION ( 'UNKNOWN', '', #64, #30 ) ;
#10 = APPROVAL_STATUS ( 'not_yet_approved' ) ;
#11 = APPLICATION_PROTOCOL_DEFINITION ( 'international standard', 'config_control_design', 1994, #175 ) ;
#12 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#13 = VERTEX_POINT ( 'NONE', #120 ) ;
#14 = DIRECTION ( 'NONE', ( -0.0000000000000000000, -0.0000000000000000000, -1.000000000000000000 ) ) ;
#15 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#16 = AXIS2_PLACEMENT_3D ( 'NONE', #54, #132, #44 ) ;
#17 = DATE_AND_TIME ( #55, #89 ) ;
#18 = EDGE_LOOP ( 'NONE', ( #118, #123, #39, #157 ) ) ;
#19 = APPROVAL ( #10, 'UNSPECIFIED' ) ;
#20 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#21 = CC_DESIGN_DATE_AND_TIME_ASSIGNMENT ( #58, #143, ( #71 ) ) ;
#22 = CIRCLE ( 'NONE', #49, 0.5336587240032778500 ) ;
#23 = PERSON_AND_ORGANIZATION_ROLE ( 'creator' ) ;
#24 =( NAMED_UNIT ( * ) SI_UNIT ( $, .STERADIAN. ) SOLID_ANGLE_UNIT ( ) );
#25 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#26 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#27 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#28 = VECTOR ( 'NONE', #133, 39.37007874015748100 ) ;
#29 = CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( #112, #145, ( #60 ) ) ;
#30 = DESIGN_CONTEXT ( 'detailed design', #52, 'design' ) ;
#31 = CALENDAR_DATE ( 2018, 9, 8 ) ;
#32 = EDGE_CURVE ( 'NONE', #13, #153, #1, .T. ) ;
#33 = ADVANCED_FACE ( 'NONE', ( #104 ), #124, .F. ) ;
#34 = FACE_OUTER_BOUND ( 'NONE', #113, .T. ) ;
#35 = CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( #99, #174, ( #64 ) ) ;
#36 = ORIENTED_EDGE ( 'NONE', *, *, #86, .T. ) ;
#37 = PERSON ( 'UNSPECIFIED', 'UNSPECIFIED', 'UNSPECIFIED', ('UNSPECIFIED'), ('UNSPECIFIED'), ('UNSPECIFIED') ) ;
#38 = DATE_AND_TIME ( #72, #106 ) ;
#39 = ORIENTED_EDGE ( 'NONE', *, *, #4, .T. ) ;
#40 = AXIS2_PLACEMENT_3D ( 'NONE', #82, #116, #178 ) ;
#41 = APPROVAL_STATUS ( 'not_yet_approved' ) ;
#42 = APPROVAL_DATE_TIME ( #75, #168 ) ;
#43 =( CONVERSION_BASED_UNIT ( 'INCH', #121 ) LENGTH_UNIT ( ) NAMED_UNIT ( #139 ) );
#44 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#45 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#46 = APPROVAL_PERSON_ORGANIZATION ( #79, #168, #114 ) ;
#47 = ORIENTED_EDGE ( 'NONE', *, *, #103, .T. ) ;
#48 = ADVANCED_FACE ( 'NONE', ( #172 ), #101, .T. ) ;
#49 = AXIS2_PLACEMENT_3D ( 'NONE', #67, #146, #53 ) ;
#50 = ORIENTED_EDGE ( 'NONE', *, *, #103, .F. ) ;
#51 = APPROVAL_STATUS ( 'not_yet_approved' ) ;
#52 = APPLICATION_CONTEXT ( 'configuration controlled 3d designs of mechanical parts and assemblies' ) ;
#53 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#54 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#55 = CALENDAR_DATE ( 2018, 9, 8 ) ;
#56 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#57 = AXIS2_PLACEMENT_3D ( 'NONE', #177, #80, #159 ) ;
#58 = DATE_AND_TIME ( #94, #125 ) ;
#59 = EDGE_CURVE ( 'NONE', #13, #151, #136, .T. ) ;
#60 = PRODUCT ( 'cylinder', 'cylinder', '', ( #65 ) ) ;
#61 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#62 = SHAPE_DEFINITION_REPRESENTATION ( #147, #148 ) ;
#63 = PERSON_AND_ORGANIZATION_ROLE ( 'classification_officer' ) ;
#64 = PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE ( 'ANY', '', #60, .NOT_KNOWN. ) ;
#65 = MECHANICAL_CONTEXT ( 'NONE', #175, 'mechanical' ) ;
#66 = LOCAL_TIME ( 12, 8, 29.00000000000000000, #102 ) ;
#67 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#68 = AXIS2_PLACEMENT_3D ( 'NONE', #56, #45, #15 ) ;
#69 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#70 = LINE ( 'NONE', #162, #28 ) ;
#71 = SECURITY_CLASSIFICATION ( '', '', #158 ) ;
#72 = CALENDAR_DATE ( 2018, 9, 8 ) ;
#73 = CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( #61, #78, ( #64 ) ) ;
#74 =( GEOMETRIC_REPRESENTATION_CONTEXT ( 3 ) GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT ( ( #5 ) ) GLOBAL_UNIT_ASSIGNED_CONTEXT ( ( #43, #115, #24 ) ) REPRESENTATION_CONTEXT ( 'NONE', 'WORKASPACE' ) );
#75 = DATE_AND_TIME ( #110, #144 ) ;
#76 = AXIS2_PLACEMENT_3D ( 'NONE', #27, #135, #85 ) ;
#77 = ORIENTED_EDGE ( 'NONE', *, *, #4, .F. ) ;
#78 = PERSON_AND_ORGANIZATION_ROLE ( 'design_supplier' ) ;
#79 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#80 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#81 = CARTESIAN_POINT ( 'NONE', ( -0.5336587240032778500, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#82 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#83 = DIRECTION ( 'NONE', ( -0.0000000000000000000, -0.0000000000000000000, -1.000000000000000000 ) ) ;
#84 = PRODUCT_RELATED_PRODUCT_CATEGORY ( 'detail', '', ( #60 ) ) ;
#85 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#86 = EDGE_CURVE ( 'NONE', #153, #170, #70, .T. ) ;
#87 = CC_DESIGN_DATE_AND_TIME_ASSIGNMENT ( #38, #105, ( #9 ) ) ;
#88 = EDGE_LOOP ( 'NONE', ( #155, #141, #36, #47 ) ) ;
#89 = LOCAL_TIME ( 12, 8, 29.00000000000000000, #122 ) ;
#90 = CC_DESIGN_APPROVAL ( #19, ( #64 ) ) ;
#91 = CLOSED_SHELL ( 'NONE', ( #152, #48, #100, #33 ) ) ;
#92 = APPROVAL_ROLE ( '' ) ;
#93 =( LENGTH_UNIT ( ) NAMED_UNIT ( * ) SI_UNIT ( $, .METRE. ) );
#94 = CALENDAR_DATE ( 2018, 9, 8 ) ;
#95 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, -0.0000000000000000000 ) ) ;
#96 = DIRECTION ( 'NONE', ( -1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#97 = FACE_OUTER_BOUND ( 'NONE', #18, .T. ) ;
#98 = CC_DESIGN_SECURITY_CLASSIFICATION ( #71, ( #64 ) ) ;
#99 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#100 = ADVANCED_FACE ( 'NONE', ( #34 ), #117, .T. ) ;
#101 = CYLINDRICAL_SURFACE ( 'NONE', #171, 0.5336587240032778500 ) ;
#102 = COORDINATED_UNIVERSAL_TIME_OFFSET ( 8, 0, .AHEAD. ) ;
#103 = EDGE_CURVE ( 'NONE', #170, #151, #127, .T. ) ;
#104 = FACE_OUTER_BOUND ( 'NONE', #8, .T. ) ;
#105 = DATE_TIME_ROLE ( 'creation_date' ) ;
#106 = LOCAL_TIME ( 12, 8, 29.00000000000000000, #140 ) ;
#107 = CARTESIAN_POINT ( 'NONE', ( -0.5336587240032778500, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#108 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, -0.0000000000000000000 ) ) ;
#109 = CARTESIAN_POINT ( 'NONE', ( 0.5336587240032778500, 6.535434481876750100E-017, 1.968503937007874100 ) ) ;
#110 = CALENDAR_DATE ( 2018, 9, 8 ) ;
#111 = CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( #25, #63, ( #71 ) ) ;
#112 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#113 = EDGE_LOOP ( 'NONE', ( #6, #131 ) ) ;
#114 = APPROVAL_ROLE ( '' ) ;
#115 =( NAMED_UNIT ( * ) PLANE_ANGLE_UNIT ( ) SI_UNIT ( $, .RADIAN. ) );
#116 = DIRECTION ( 'NONE', ( -0.0000000000000000000, -0.0000000000000000000, -1.000000000000000000 ) ) ;
#117 = PLANE ( 'NONE', #149 ) ;
#118 = ORIENTED_EDGE ( 'NONE', *, *, #32, .F. ) ;
#119 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#120 = CARTESIAN_POINT ( 'NONE', ( 0.5336587240032778500, 6.535434481876750100E-017, 1.968503937007874100 ) ) ;
#121 = LENGTH_MEASURE_WITH_UNIT ( LENGTH_MEASURE( 0.02539999999999999900 ), #93 );
#122 = COORDINATED_UNIVERSAL_TIME_OFFSET ( 8, 0, .AHEAD. ) ;
#123 = ORIENTED_EDGE ( 'NONE', *, *, #59, .T. ) ;
#124 = PLANE ( 'NONE', #134 ) ;
#125 = LOCAL_TIME ( 12, 8, 29.00000000000000000, #166 ) ;
#126 = MANIFOLD_SOLID_BREP ( 'Boss-Extrude1', #91 ) ;
#127 = CIRCLE ( 'NONE', #16, 0.5336587240032778500 ) ;
#128 = APPROVAL_ROLE ( '' ) ;
#129 = APPLICATION_PROTOCOL_DEFINITION ( 'international standard', 'config_control_design', 1994, #52 ) ;
#130 = APPROVAL_DATE_TIME ( #169, #19 ) ;
#131 = ORIENTED_EDGE ( 'NONE', *, *, #32, .T. ) ;
#132 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#133 = DIRECTION ( 'NONE', ( -0.0000000000000000000, -0.0000000000000000000, -1.000000000000000000 ) ) ;
#134 = AXIS2_PLACEMENT_3D ( 'NONE', #163, #119, #108 ) ;
#135 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#136 = LINE ( 'NONE', #109, #173 ) ;
#137 = APPROVAL_PERSON_ORGANIZATION ( #176, #19, #92 ) ;
#138 = CIRCLE ( 'NONE', #76, 0.5336587240032778500 ) ;
#139 = DIMENSIONAL_EXPONENTS ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ;
#140 = COORDINATED_UNIVERSAL_TIME_OFFSET ( 8, 0, .AHEAD. ) ;
#141 = ORIENTED_EDGE ( 'NONE', *, *, #167, .F. ) ;
#142 = CC_DESIGN_APPROVAL ( #164, ( #71 ) ) ;
#143 = DATE_TIME_ROLE ( 'classification_date' ) ;
#144 = LOCAL_TIME ( 12, 8, 29.00000000000000000, #7 ) ;
#145 = PERSON_AND_ORGANIZATION_ROLE ( 'design_owner' ) ;
#146 = DIRECTION ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 1.000000000000000000 ) ) ;
#147 = PRODUCT_DEFINITION_SHAPE ( 'NONE', 'NONE', #9 ) ;
#148 = ADVANCED_BREP_SHAPE_REPRESENTATION ( 'cylinder', ( #126, #57 ), #74 ) ;
#149 = AXIS2_PLACEMENT_3D ( 'NONE', #26, #12, #95 ) ;
#150 = ORGANIZATION ( 'UNSPECIFIED', 'UNSPECIFIED', '' ) ;
#151 = VERTEX_POINT ( 'NONE', #161 ) ;
#152 = ADVANCED_FACE ( 'NONE', ( #97 ), #165, .T. ) ;
#153 = VERTEX_POINT ( 'NONE', #107 ) ;
#154 = APPROVAL_DATE_TIME ( #17, #164 ) ;
#155 = ORIENTED_EDGE ( 'NONE', *, *, #59, .F. ) ;
#156 = CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT ( #3, #23, ( #9 ) ) ;
#157 = ORIENTED_EDGE ( 'NONE', *, *, #86, .F. ) ;
#158 = SECURITY_CLASSIFICATION_LEVEL ( 'unclassified' ) ;
#159 = DIRECTION ( 'NONE', ( 1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#160 = APPROVAL_PERSON_ORGANIZATION ( #20, #164, #128 ) ;
#161 = CARTESIAN_POINT ( 'NONE', ( 0.5336587240032778500, 6.535434481876750100E-017, 0.0000000000000000000 ) ) ;
#162 = CARTESIAN_POINT ( 'NONE', ( -0.5336587240032778500, 0.0000000000000000000, 1.968503937007874100 ) ) ;
#163 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#164 = APPROVAL ( #51, 'UNSPECIFIED' ) ;
#165 = CYLINDRICAL_SURFACE ( 'NONE', #40, 0.5336587240032778500 ) ;
#166 = COORDINATED_UNIVERSAL_TIME_OFFSET ( 8, 0, .AHEAD. ) ;
#167 = EDGE_CURVE ( 'NONE', #153, #13, #22, .T. ) ;
#168 = APPROVAL ( #41, 'UNSPECIFIED' ) ;
#169 = DATE_AND_TIME ( #31, #66 ) ;
#170 = VERTEX_POINT ( 'NONE', #81 ) ;
#171 = AXIS2_PLACEMENT_3D ( 'NONE', #69, #83, #96 ) ;
#172 = FACE_OUTER_BOUND ( 'NONE', #88, .T. ) ;
#173 = VECTOR ( 'NONE', #14, 39.37007874015748100 ) ;
#174 = PERSON_AND_ORGANIZATION_ROLE ( 'creator' ) ;
#175 = APPLICATION_CONTEXT ( 'configuration controlled 3d designs of mechanical parts and assemblies' ) ;
#176 = PERSON_AND_ORGANIZATION ( #37, #150 ) ;
#177 = CARTESIAN_POINT ( 'NONE', ( 0.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
#178 = DIRECTION ( 'NONE', ( -1.000000000000000000, 0.0000000000000000000, 0.0000000000000000000 ) ) ;
ENDSEC;
END-ISO-10303-21;

Continue reading...
 
Back
Top