Book Contents | Book Index | Master Index | Previous Chapter | Next Chapter
Search STEP Tools Web Support

18.1 Description

A STEP model can contain entity instances which are redundant or irrelevant to the data set being represented. For example, a file may include several definitions of the same units, or have the same persons referenced by multiple person_and_organization instances. A model could also contain entire geometric definitions which are never connected to the product structure in the model, and thus not in the model. Such occurrences result in bloated data files. The stepclean utility takes such a STEP model and eliminates the superfluous entity instances while keeping the data content of the file intact.


18.2 Factoring

The stepclean utility searches the model for entity instances that have the same attributes values. When it finds two or more instances with the same values, it deletes all but one of the instances, and replaces any references to the deleted instances to the other instance. This process is called factoring. You can specify the types to be included or excluded from the factoring operations. You can also specify attributes which the tool ignores when comparing two instances.


18.3 Garbage Collection

After the stepclean tool factors the model, it then performs an optional garbage collection pass over the model. During this process, it deletes any instance that is not accessible from a set of root objects. An object is accessible if it is referenced by a root or another accessible object, or if it references a root or another accessible object through an attribute that has been declared as inverse for the garbage collector.

You must declare one or more root types for the garbage collector to function. If you run stepclean without specifying at least one root type either in the control file, or on the command line, the garbage collection operation is not performed.


18.4 Command Line (All Platforms)

stepclean <data-file> [options]

If no options are selected, the tool will perform all constraint checks. If options are provided, the tool will only perform the requested checks. The options accepted by stepclean are:

-help
Print this list of options and exit.
-summary
give a summary report indicating the total number of instances that were factored, garbage collected, and left for each entity type.
-verbose
give detailed messages indicating what instances are removed by the garbage collection and factoring processes.
-config <file>
"use the configuration file specified for the options instead of the default configuration.
-overwrite
overwrite the input file, rather than appending a _clean suffix to the filename.
-o <file>
Specify the output filename. By default, the clean file is saved with the original name, but with _clean appended.
-noconfig
do not use any configuration file. This option can be used to disable the default configuration that is normally used, if no configuration is provided on the command line.
-factor type [type ...]
specify one or more entity types which are merged when they have the same attribute values
-nofactor type ...
specify one or more entity types which are not merged.
-ignore type.attribute ...
specify an attribute that is ignored when comparing two instances. Two instances are still considered equal even if the values of this attribute differ.
-factor-all
factor all entity types not overridden by the -nofactor option
-factor-none
factor no entity types except those overridden by the by the -factor option
-gcroot type ...
specify a root type from which garbage collection begin
-gcinverse entity.attribute ...
specify an attribute which is traversed in reverse when determining reachability for garbage collection purposes.


18.5 Configuration File

The -config option specifies a configuration file which can collect a set of options. Using a control file makes it more easier to reuse a complex configuration.

When no configuration file is specified on the command line, the stepclean utility looks for one in lib/stepclean/{schema}.stc under the ST-Developer installation (replace {schema} with the name of the schema). This behavior can be overridden with the -noconfig option. Thus, the configuration file for AP203 can be found under the ST-Developer installataion in lib/stepclean/config_control_design.stc .

The configuration file is a text file. Comments are introduced with a # character, and continue to the end of the line. Each line of the control file consists of a keyword followed by a set of parameters.

The following is an example of a configuration file:

    #  Specify the entity types to factor
    factor date_and_time person_and_organization organization person
     
    # Set up garbage collection
    gcroot product
    gcinverse alternate_product_relationship.alternate alternate_product_relationship.base
    gcinverse PRODUCT_RELATED_PRODUCT_CATEGORY.products
    gcinverse CC_DESIGN_PERSON_AND_ORGANIZATION_ASSIGNMENT.items
    gcinverse PRODUCT_DEFINITION_FORMATION.of_product
    gcinverse CC_DESIGN_APPROVAL.items
    gcinverse CC_DESIGN_SECURITY_CLASSIFICATION.items
    gcinverse CC_DESIGN_DATE_AND_TIME_ASSIGNMENT.items
    gcinverse product_definition.formation
    gcinverse property_definition.definition
    gcinverse property_definition_representation.definition
    gcinverse APPROVAL_PERSON_ORGANIZATION.authorized_approval
    gcinverse application_protocol_definition.application
    gcinverse approval_date_time.dated_approval

The file can contain the following commands:

factor-default
Set the default to factor entity types that are not otherwise specified.
nofactor-default
Set the default to not factor any entities except those specified
factor [-exact] type ...
Specify one or more types to be factored. If the -exact flag is given, the type much match exactly, otherwise, the type specified can be a supertype.
nofactor [-exact] type ...
Specify one or more types not to be factored. If the -exact flag is given, the type much match exactly, otherwise, the type specified can be a supertype.
ignore ent.att ...
Specify one or more attributes to be ignored when comparing instances for factoring.
gcroot type ...
Specify one or more root types for the garbage collector. At least one type must be specified as a root to enable the garbage collector to run.
gcinverse ent.att ...
Specify one or more attributes that are inverted for the purposes for garbage collection. When an instance references a live instance via such an attribute, that instance is also live.

When options conflict, the last option specified in the configaration file takes priority.

| Book Contents | Book Index | Master Index | ST-Developer Home | Previous Chapter | Next Chapter |