VALIDATION_CONTROL - Intergraph Smart 3D - Reference Data

Intergraph Smart 3D Structural Manufacturing Reference Data

Language
English
Product
Intergraph Smart 3D
Subproduct
Structural Manufacturing
Search by Category
Reference Data
Smart 3D Version
12 (2018)

VALIDATION_CONTROL determines what types of validation are run on a part when you attempt to persist the edited part to the database. It also determines what validation options are available for manual validation. Each <VALIDATION_TYPE> node represents an option for manual validation and also represents a validation type that is run when you attempt to persist the edited part.

The <VALIDATION_CONTROL> node has the parameter HALT_LEVEL, which controls the master error level that prevents persistence. If this value is set to 1 then all information, warning, and error messages halts validation. If the value is set to 2 then only warnings and errors halt validation. If the value is set to 3 then only errors halt validation. If the value is set to 4 or higher, nothing halts validation. HALT_LEVEL represents the global minimum for the Part Editor. This means that individual validation types can be more restrictive on what error level halts persistence, but not less restrictive. For example, if HALT_LEVEL is set to 1 and the Contour Geometry validation LEVEL is set to 3, then the Contour Geometry level is more restrictive and controls. Therefore, only Contour Geometry errors halt persistence. On the other hand, if HALT_LEVEL is set to 3 and the Contour Geometry validation LEVEL is set to 1, the global HALT_LEVEL is more restrictive and controls. Therefore, only errors halt persistence.

Validation Types

The list of validation types controls both the validation options run automatically at the start of the edited part persistence process and also controls the types of validation available for manual validation. A typical node has the following appearance:

<VALIDATION_TYPE NAME="Persistence Validation" KEY="ValidateForPersist"

VALUE="1" LEVEL="3" PROGID=""/>

Only those attribute types that are listed in this section and have a VALUE="1" are enabled.

There are at least three ways to disable a given type of validation:

  • Remove the type for the list completely

  • Comment out the XML node containing the validation type

  • Set VALUE to 0 for a given validation type

Five default validation types are provided:

  • Contour Geometry

  • Contour Attributes

  • Marking Geometry (Disabled)

  • Marking Attributes

  • General Attributes

The default validation types can be disabled by any of the three methods listed above.

Custom validation types can also be defined. ProgID is left blank for the default types of validation and is used only for custom validation.

Attribute Validation

Most of the attribute validation is controlled within the definition of the attribute itself in the Part Editor settings file (PartEditorDefaultAttributes.xml). Under CHECK_ATTRIBUTE_TYPES, the file defines multiple basic checks that can be performed on a given attribute. The check types have the following format:

<CHECK_ATTRIBUTE_TYPE NAME="CHECK_MISSING" ERROR_KEY="1" SOLUTION_KEY="3" ERROR_MSG="attribute was not present and has been added." SOLUTION_MSG="Verify the value in the attribute editor." />

NAME contains a string that indicates to the Part Editor which type of validation is to be run.

ERROR_KEY and SOLUTION_KEY contain numbers that correspond to localization strings and indicate to the Part Editor what type of error message and solution message to display if the validation fails for a given attribute. These values should be left blank if custom messages are used.

ERROR_MSG and SOLUTION_MSG contain the default error message and solution message to display if the attribute fails validation. These values are only used if ERROR_KEY and SOLUTION_KEY are missing or cannot be located. ERROR_MSG and SOLUTION_MSG are most useful for defining messages to display for custom validation types.

A check attribute type can be tied to a given attribute by defining a check type option within the attribute tag. In the following attribute definition, CHECK_MISSING is used:

<PROPERTY NAME="SMS_PROD_INFO||ASSEMBLY_NAME" VALUE="null" READONLY ="0"

CHECK_ATTRIBUTE_TYPE="CHECK_MISSING" ERROR_LEVEL="1"/>

Multiple check types can be used by separating the names by the “|” (pipe) symbol as in:

CHECK_ATTRIBUTE_TYPE="CHECK_MISSING|CHECK_ALLOWABLES"

The level of error raised if the attribute fails validation is indicated by the ERROR_LEVEL value where 1=information, 2=warning, and 3=error. Different error levels can be specified for each check attribute type by using the “|” (pipe) symbol as in:

ERROR_LEVEL="2|2"

The first value corresponds to the first check-attribute-type, the second value to the second type, and so forth.

There are six default check-attribute-types:

  1. CHECK_VALUE_RANGE - Checks whether the current value of the attribute falls within the range specified by the attribute definition. The range is specified by using LBOUND (lower boundary) and UBOUND (upper boundary) in the attribute definition, as in the following example:

    <PROPERTY NAME="PAREN_NODE||SAMPLE" VALUE="0.0 kg" UNIT="92"

    UNIT_TYPE="MASS" CHECK_ATTRIBUTE_TYPE="CHECK_VALUE_RANGE"

    LBOUND="1" UBOUND="50" ERROR_LEVEL="1"/>

    LBOUND and UBOUND can also be used individually to indicate only an upper or lower boundary, as in this example:

    <PROPERTY NAME="SMS_PART_INFO||WEIGHT" VALUE="0.0 kg" READONLY="0" UNIT="92"

    UNIT_TYPE="MASS" CHECK_ATTRIBUTE_TYPE="CHECK_MISSING|CHECK_VALUE_RANGE"

    LBOUND="1" ERROR_LEVEL="2|2"/>

  2. CHECK_VALUE_ZERO - Returns an error if the current value of the attribute is zero.

  3. CHECK_ALLOWABLES - Checks whether the current value of the attribute falls within the allowable values specified in the attribute definition. The attribute definition must contain ALLOWABLE with different entries separated by commas, as in this example:

    ALLOWABLE="centered,fore,aft,port,starboard,upper,lower,in,out"

  4. CHECK_MISSING - If the attribute is missing from the current attribute set, CHECK_MISSING adds the attribute to the current attribute set with the default value, and returns an error indicating that the value was missing, has been added, and should be verified by the user.

  5. CHECK_NO_VALUE - Returns an error if the current attribute has no value.

  6. CHECK_DEFAULT - Returns an error if the current attribute does not match the default value.

General Attributes

In addition to the validation defined on each attribute, the general attributes validation performs the following additional checks:

  • Gives a warning if the part thickness is less than 5 mm.

  • Gives a warning if CONNECTED_LENGTH is greater than TOTAL_MAX_LENGTH.

  • Gives a warning if TOTAL_LENGTH is greater than TOTAL_MAX_LENGTH.

Contour Attributes

In addition to the validation defined on each attribute, the contour attributes validation performs the following additional checks:

  • Gives an error if the total depth for all the bevel sections does not match the total part thickness.

Marking Attributes

In addition to the validation defined on each attribute, the marking attributes validation performs the following additional checks:

  • Gives an error if, for location marks, the direction attributes are not all consistent (FLANGE_DIR, FLANGE_DIR_2D, PART_DIR, and THICKNESS_DIR).

Contour Geometry

The contour geometry validation routine checks both inner and outer contours to determine whether the contours are closed or not. The routine also checks whether every segment of every contour is oriented in the proper direction.

Marking Geometry (Disabled)

The marking geometry validation routine checks whether marking lines are contained within the outer contour. Errors are generated if a marking crosses a contour and if a marking is completely outside the contours. Within the marking geometry <VALIDATION_TYPE> node, the error level for markings that cross a contour can be specified by setting CROSS_LEVEL, and the error level for markings outside the contours can be specified by setting OUTSIDE_LEVEL:

<VALIDATION_TYPE NAME="Marking Geometry" KEY="ValidateMarkingGeom" VALUE="1" LEVEL="3" CROSS_LEVEL="2" OUTSIDE_LEVEL="3" PROGID=""/>

Custom Validation

Custom validation types can be specified by adding another <VALIDATION_TYPE>entry. For custom types, ProgID must be used to specify to the Part Editor the ProgID used for the custom validation. The following example is available for you to use. It is disabled by default.

<!--VALIDATION_TYPE NAME="Small Contour Segments" KEY="ValidateSmallContourSeg" VALUE="1" LEVEL="2" PROGID="CustomValidation.SmallContourSeg"/-->

To use this validation, you must uncomment the line, and then save the file. To uncomment the line, remove the !-- from the beginning of the line and the -- from the end of the line. The line will then look like the following:

<VALIDATION_TYPE NAME="Small Contour Segments" KEY="ValidateSmallContourSeg" VALUE="1" LEVEL="2" PROGID="CustomValidation.SmallContourSeg"/>

Custom validation types can be implemented as a Visual Basic .dll (VB6) project that implements the “IJMfgEditCustomValidation” interface. Here is a small sample custom implementation that returns an information message if the active drawing sheet contains at least one object:

All custom validation types must reference at least the following libraries:

  • [Product Folder]\StructManufacturing\Middle\Bin\StructMfgGlobals.dll

  • [Product Folder]\StructManufacturing\Client\Bin\STRMFGPartEditorErrors.dll

  • [Product Folder]\Common2d\Rad2d\Bin\rad2d.dat

Example: Adding the Default Custom Validation Rule Small Contour Segments Checker

  1. To run this validation as part of the persistence process, you must locate your active SMS_VIEWER.xml file. This is the SMS_VIEWER.xml file that is specified in the Catalog Selector rule for the Part Editor. By default, this file is located in the following location:

    [Shared Content Folder]\StructManufacturing\SMS_SCHEMA\SMS_VIEWER.xml

  2. Open the file in an ASCII editor, such as Notepad++, and look for the following line:

  3. Edit the line to read as follows:

    <!--VALIDATION_TYPE NAME="Small Contour Segments" KEY="ValidateSmallContourSeg" VALUE="1" LEVEL="2" PROGID="CustomValidation.SmallContourSeg"/-->

  4. Uncomment the line, and then save the file.

    SHARED Tip To uncomment the line, remove the !-- from the front of the line and the -- from the end of the line. The line should now read as follows:

    <VALIDATION_TYPE NAME="Small Contour Segments" KEY="ValidateSmallContourSeg" VALUE="1" LEVEL="2" PROGID="CustomValidation.SmallContourSeg"/>

  5. Verify that the .DLL for this rule is delivered to your symbol share binary path:

    [Shared Content Folder]\Bin\StructManufacturing\Rules\Release\CustomValidation.dll

  6. Verify that the Custom Validation rule is listed in the SystemSymbolConfig.xml file, and that it uses the correct ProgID. It should match the following:

    <progid name="CustomValidation.SmallContourSeg" clsid="{330a66da-da83-4a81-a2c0-6fddba1840b3}" dll="%OLE_SERVER%\bin\StructManufacturing\Rules\Release\CustomValidation.dll" />

  7. Start the Structural Manufacturing task, and load the Part Editor.

  8. Select Small Contour Segments from the validation list.

  • You can customize the length threshold for which an error or warning is displayed for a given small contour segment. For example, you can display errors for contours smaller than 2mm even though the default is 3mm. Change the following value in the rule, recompile the rule, and then reload Smart 3D.

  • You can specify that errors display as warnings by changing the SmallContourSeg.cls file of the rule. Specifically, change the FindSmallCntourSegmentErrors subroutine. The ERRORLEVEL_ErrCritical, must be replaced with ERRORLEVEL_ErrInformation as shown below:

    Before:

    After: