Semi-automatic parametrization

The qsketchmetric.semiautomatic.SemiAutomaticParameterization module is used to semi-automatic parameterize a DXF file. By semi-automatic, it means that the user has to manually customize the parameters of each entity after the automatic parameterization process. Process includes:

  • Adding MTEXT entity.

  • Adding VIRTUAL_LAYER layer.

  • Adding default expression to each entity.

  • Joining entities with virtual lines in to the one coherent graph.

  1. Make sure entities that are not explicitly supported are packed in to an INSERT entity (block). If not, pack them using QCAD Professional software. Otherwise, the entities will be deleted during the semi-automatic parametrization process.

  2. If don’t have already fire up a terminal and run python console:

    $ python
    
  3. Define the path to the DXF file to parametrize:

    input_dxf_file = 'path/to/dxf/file.dxf'
    
  4. (Optional) Define the path to the output parametrized DXF file.

    Default is input_dxf_file with _param appended to the file name contained in the parametric directory:

    output_dxf = 'path/to/output/parametrized_dxf/file.dxf'
    
  5. (Optional) Define the expression that will be used to parametrize each entity. Default is c which

    stand for current length. See allowed expressions on the manual parametrization page.:

    expression = '?'
    
  6. Parametrize the DXF file:

    from qsketchmetric.semiautomatic import SemiAutomaticParameterization
    
    input_dxf_file = 'path/to/dxf/file.dxf'
    
    # Optional
    output_dxf = 'path/to/output/parametrized_dxf/file.dxf'
    expression = '?'
    
    sap = SemiAutomaticParameterization(input_dxf_file, default_value=expression, output_dxf_path=output_dxf)
    sap.parametrize()
    

7. Open the parametrized file in QCAD Professional, and customize the parameters. Same as in the manual parametrization process.

8. Validate the file. This can be done by using the QSketchMetric Validator. See Validating a parameterized DXF file for more information.