Example of Custom Quality Control Action

Предыдущая страницаВ началоСледующая страница

The example of a custom quality control action is supplied with T-FLEX CAD. It contains the Layer Names action, which checks names of all layers in a document for compliance with the following criteria

name may contain only basic Latin letters, digits, underscores and spaces;

name should not be longer than 30 symbols.

The example also defines actions for automatic elimination of detected errors: upon calling the Fix command from the contextual menu of check result, all layers non-compliant with aforementioned criteria will be automatically renamed to Layer_1, Layer_2 and so on.

The example files are located in the T-FLEX CAD installation folder (the default path is: C:\Program Files\T-FLEX Parametric CAD 17\API\QualityManagementSample). The logic of the example action is defined in the SampleLogic.cs C# source file.  

In order to use the example, build the QualityManagementSample.sln solution using Microsoft Visual Studio.

It is recommended to install the .NET desktop development workload for Microsoft Visual Studio, when working with projects of custom quality control actions.

The QualityManagementSample.dll library file will be created. Its location within the QualityManagementSample folder depends on the selected project configuration (default location is QualityManagementSample\bin\Debug). Copy it into the ...T-FLEX Parametric CAD 17\Program folder. Then add the corresponding action and the module of this library into a custom or standard quality control script.

The action and the module of this example are already added into the standard quality control script as comments. So in order to enable them quickly, just uncomment corresponding elements in the ...T-FLEX Parametric CAD 17\Program\QualityManagement\DefaultScript.tfqms file, as shown below. Editing this file requires administrator right.

It is recommended to save the script file under a different name or into a different folder, because the initial file gets replaced on T-FLEX CAD update.

<?xml version="1.0" encoding="UTF-8"?>

<Script>

<!--Example Module   

<Modules>

<Module Name="QualityManagementSample" Path="QualityManagementSample.dll"/>

</Modules>

-->

<Parameters>

..............

</Parameters>

<Actions>

<!--Example Module Actions   

<Action Name="Layer Names" Uid="96d2999d-2f59-492d-b71e-64185753c0de" LogicUid="07bc3705-0bc8-4833-b515-2cc8fb1eaa06" Tags="2D/3D" IsSkipped="true"/>

-->

 arrow down

<?xml version="1.0" encoding="UTF-8"?>

<Script>

<!--Example Module-->

<Modules>

<Module Name="QualityManagementSample" Path="QualityManagementSample.dll"/>

</Modules>

<Parameters>

..............

</Parameters>

<Actions>

<!--Example Module Actions-->

<Action Name="Layer Names" Uid="96d2999d-2f59-492d-b71e-64185753c0de" LogicUid="07bc3705-0bc8-4833-b515-2cc8fb1eaa06" Tags="2D/3D" IsSkipped="true"/>

 

The 2D/3D tag in the example above can be used for grouping actions in the quality control window. The IsSkipped="true" attribute means, that the action is disabled by default, so in order enable it you will have to enable its checkbox in the quality control window.