Adjust filenames according to field content

<< Click to Display Table of Contents >>

Navigation:  Drawing Manager > Features and functions > Special commands >

Adjust filenames according to field content

Previous pageReturn to chapter overviewNext page

The Adjust filenames according to field content feature is primarily aimed at report generation, but can also be used separately. This feature can be used for much broader purposes than the ones it was first developed for, but the explanation below, focuses on a standard use case. Please however, bare in mind, that the feature is far from limited to that.

 

In many cases, the file name composition includes document codes that are closely linked to information in the title field, like function, location, product, or Document kind Classification Code.

 

Let us for instance consider the example that is described in the topic named Example of user defined document codes.

 

In that example, we have filenames that are composed as shown in the figure below.

 

Figure 674:  This figure illustrates the file name composition used in the example of user defined document codes.

Figure 674:  This figure illustrates the file name composition used in the example of user defined document codes.

 

The function designation is indirectly defined in the filename, which means that the sheet numbers will be individually counted for each function (plant).

 

If you create a report covering multiple functions, like for instance the entire project, the Report Generator will not directly take that into account. The Report Generator will number all sheets of the report in one single sequence.

 

As an example, we can take a device list that should comply with these settings and which is therefore sorted on function (plant) with page shift. This means that all devices with the same function designation will be listed after one another, and when we come to the next function, we will start on a new sheet. Therefore, the function can and will be part of the title field/drawing frame, and also reflected in the Drawing Manager.

 

Area, class, subclass, and counting number according to the file name composition presented in the figure above, will be fixed for this report and can be part of the report definition, like this.

 

EPB002 = Device list summarised by item designation

 

EPB002_____________.DXF

 

Figure 675:  Settings for file names of generated reports

Figure 675:  Settings for file names of generated reports

 

The result of this will be file names in one sequence, as shown below, without taking differences in function into consideration.

 

EPB002__________001.DXF

EPB002__________002.DXF

EPB002__________003.DXF

...

 

The goal of the Adjust filenames according to field content feature is to add proper function information to the filenames, so that the sheet numbering in a following step can be adjusted accordingly.

 

For this to work, all involved document codes and related function codes must exist and be defined beforehand.

 

Let us assume that the involved document codes and function designations are the ones from the example discussed in the Example of user defined document codes.

 

Let us further assume that the generated report for simplicity only contains 7 sheets, with 3 different function designations in the title fields:

 

Filename directly from the Report Generator

Function (plant)

EPB002__________001.DXF

=G1=C1

EPB002__________002.DXF

EPB002__________003.DXF

EPB002__________004.DXF

=G1=G1

EPB002__________005.DXF

EPB002__________006.DXF

=G1=G1=G1

EPB002__________007.DXF

 

When the Adjust filenames according to field content feature is executed, it will adjust the filenames according to the content of any fields in the Drawing Manager that are related to the filenames according to the mask file in use.

 

The result will be as shown in the table below.

 

Adjusted filename, step 1

Function (plant)

EPB002_G1C1_____001.DXF

=G1=C1

EPB002_G1C1_____002.DXF

EPB002_G1C1_____003.DXF

EPB002_G1G1_____004.DXF

=G1=G1

EPB002_G1G1_____005.DXF

EPB002_G1G1G1___006.DXF

=G1=G1=G1

EPB002_G1G1G1___007.DXF

 

If a renumbering is performed thereafter, sheet number sequences individual for each function designation will have been achieved, as shown below.

 

Adjusted filename, step 2

Function (plant)

EPB002_G1C1_____001.DXF

=G1=C1

EPB002_G1C1_____002.DXF

EPB002_G1C1_____003.DXF

EPB002_G1G1_____001.DXF

=G1=G1

EPB002_G1G1_____002.DXF

EPB002_G1G1G1___001.DXF

=G1=G1=G1

EPB002_G1G1G1___002.DXF

 

The Report Generator has a feature that makes it possible to define in a Report Definition, that either or both of the Adjust filenames according to field content and Renumber drawing sheets... should be automatically executed when the report has been created. In that way, the result when the report generation process is finished, can be exactly the one that is presented in the final table above.

 

 

Technical details

There are of course a number of prerequisites that must be met for everything described above to work.

 

Each involved document code must have a corresponding field in the title field.

The field in question must have a content.

The content must match an existing document code.

 

The standard report definition 0X_E_EPB002 [DXF: Device list summarised by item designation (English)] does not meet all those requirements. Therefore it must first be extended to meet those requirements, and thereby give the result that is discussed above. The shortcoming is that the standard report does not contain the function designation with separated levels in the way that is defined in the example. Therefore, a new compatible report definition must be created for the purpose. That report definition must include a modified DXF form, where the levels of the function designation are separated and placed in the fields that are defined in the example.

 

The !ANLAGE(1) report variable gives the first level, !ANLAGE(2) gives the second, and so on. Those variables must be used in the DC block for attributes ZDC6 (level 1), ZDC7 (level 2), and so on. That is however specifics for this particular example only. The bottom line here, is that everything must match for this feature to work properly. That involves the title field, the mask, the project parameters, the report definition, and the DXF form.