Foreword
In RCS, it is possible to import a DXF and to rebuild a 2D part.
You might have to adjust some setting regarding DXF layer organization, DXF block naming policy to correctly rebuild the part.
A DXF converter is described with an XML file. In that file, you will find different options, organized in sections
- general option
- part info
- action on entities
Options
| Name | Values | |
| is_aama | boolean | |
| import_scale | float | |
| part | block layer layer_and_color | A part is defined by a block A part is defined by a layer A part is defined by a layer and a color |
| rebuild_accuracy (required) | float | Precision for the entities reconnection |
| external_rebuild | boolean | Reconnect the entities in layer EXT (external contour) |
| external_rebuild_color | color | Color for the reconnected external contours |
| internal_rebuild | boolean | Reconnect the entities in layer INT_TO_CUT and INT_TO_DRAW (internal contour) |
| marker_rebuild | boolean | Reconnect the entities in layer MARKER (marker) |
| notch_rebuild | boolean | Reconnect the entities in layer NOTCH (notch) |
| import_explode_bulged_pline | boolean | |
| notch_geom_rebuild | boolean | Create a notch with informations read in the DXF The informations are the width and the depth If the entity is a point P then width = 0 and depth = P(Z) If the entity is a segment S then width = length (S) and depth = S.P1 (Z) For the actions, use layer_out="NOTCH_TO_BUILD" |
| notch_depth | float | Only with notch_geom_rebuild Overload the depth value read in the DXF |
| notch_width | float | Only with notch_geom_rebuild Overload the width value read in the DXF |
| s_code_n_notch_detection | boolean | Detect notches and size codes Is considered as integrable motifs, all the linear entities with a double contact with the external contour |
| s_code_n_notch_detection_tol | float | Only with s_code_n_notch_detection Precision in mm to consider if an entity is in contact with the external contour |
Part_Info_Converters
Example 1:
<part_info_converters origin="block_name"> <part_info_converter regexp="No_(.+)_([0-9]+)00_([0-9]+)_x([0-9+])"> <copy value="\1" to="PMATERIAL" /> <copy value="\2" to="PSIZE" /> <copy value="\3-\1" to="PNAME"/> <copy value="\4" to="PREFQUANT"/> <copy value="\4" to="PSYMQUANT"/> </part_info_converter> </part_info_converters>
Example 2:
<part_info_converters origin="entities"> <part_info_converter regexp="Piece Name: *(.+) *"> <copy value="\1" to="PNAME" /> </part_info_converter> <part_info_converter regexp="Size: *(.+) *"> <copy value="\1" to="PSIZE" /> </part_info_converter> <part_info_converter regexp="Quantity: *([0-9]+), *([0-9]+) *"> <copy value="\1" to="PREFQUANT" /> <copy value="\2" to="PSYMQUANT" /> </part_info_converter> <part_info_converter regexp="Fabric: *(.+) *"> <copy value="\1" to="PMATERIAL" /> </part_info_converter> </part_info_converters>
Actions
Example
<action layer_out="TEXT" color_out="red" > <filter.By_Entity_Code value="characters" /> </action>
Filter
By_Annot_User | Annotation user in the entity |
By_Entity_Code | Entity code (ex : block, characters, polyline, etc...) |
By_Layer_Group_Name_Regexp | |
By_Layer_Name_Regpat | Layer name with optional regpat (ex : Layer_Material, Layer_N*) |
By_One_Color | Color name or color number (ex : red, dark_green, 50, 32) |
By_One_Layer | Layer number |
By_P_Props | (ex : P_Mat_Categ, P_Name, Prim_Diameter, Prim_Is_Closed, ...) |
Action
| layer_out | Destination layer (ex : EXT, INT_TO_CUT, DRILL, ...) |
| color_out | Destination color (name or number) |
| block_explode | Only for the blocks none one_level : explode the block one time recursive : explode the block and the blocks inside |
| deleted | Delete the filtered entity (TRUE or FALSE) |
| point_to_circle | Only for the points Turn the point into a circle with a diameter of X mm (ex : 6, 1.8) |