Variant Editor - What's New?


Service Pack 2 2022 (V 2702)

Search and replace in variants

A variant is described by various attributes, some of which are identical or almost identical for all sub-types. Examples of this are the file name or the order note.

In practice, it can happen that a series of attributes must be changed in several variants. In this case, it would be very time-consuming to open and adjust each variant individually.

In this case, the Variant Editor offers the possibility of searching several variants for an attribute and replacing the current value with another one.

The Search & Replace is done via the command line call of the Variant Editor with the call parameter searchAndReplace. This is used as follows:

VariantenEditor.exe /searchAndRepalace path\search_parameters.txt path\list_of_variants.txt

 

Two files are required for the call:

This file contains control and search parameters and must be in TXT format iUTF-16 Little Endian with BOM encoding. Here you must work with a suitable text editor, e.g. Notepad ++.

Instead of search_parameters enter the name of the corresponding file. path is the complete path to this file. More about the structure of the file can be found in the section The search_parameters file.

This file contains the list of parts to be changed. It must be in TXT format, also in UCS-2 LE BOM coding. Instead of list_of_variants, enter the name of the corresponding file. path is the complete path to this file. More on the structure of the file can be found in the section The list_of_variants file.

If you start the Variant Editor as indicated above, it first goes through each line of the search_parameters.txt file and reads in the attributes. Then it goes through each line of the file list_of_variants.txt to read in the parts/variants to be changed. It checks whether the opening and reading of the files works and whether they are empty or contain all the necessary attributes.

If all tests are successful, a backup copy is created for each variant file. These backup copies are given the file extension .BAK. Now the editor goes through each variant step by step and searches for the attributes with the specified values. If there is a hit, the function replaces the old value with the new one. After the last variant has been run through, the process is automatically terminated.

To facilitate diagnosis in the event of an error, all steps are logged in a log file. The path and file name of this file are displayed in the console at the end. The log file can be found in the temp folder of the HiCAD installation directory.

If necessary, a manual HELiOS login is required.

 

The search_parameters file

The file is divided into two sections.

 

Part 1

The first part defines the control parameters for the behaviour of the Search & Replace function. The lines have the following structure:

Control attribute name: Value

 

Blank lines and lines beginning with the # character are ignored. In this way, parameters can be (de)activated quickly and easily.

The control attribute name refers to an attribute that controls the variant change process. These are described via attributes that begin with the prefix VAREDIT_.

 

Attribute

Explanation

The value for a HELiOS attribute name can be in the variant in several languages. The language code matching the HiCAD language must be entered after this attribute, e.g. 1031 for German. 1033 for English or 1036 for French. This parameter is mandatory and is set to 1031 by default.

Here you can specify the directory in which the variant files are located. As a rule, this will be the path to the HiCAD PlantParts directory. This parameter is mandatory and is assigned by default with the PlantParts folder in the installation directory.

This attribute can be used to control whether the variant file should actually be changed or not. The truth value 1 pretends to browse and change the variant, but the file remains unchanged at the end. This parameter is optional and is set to 1 by default.

If the truth value of this attribute is set to 1, then regular expressions are included in the search parameters. If not set, then the expressions are ignored. This parameter is optional and is set to 0 by default.

If the truth value of this attribute is set to 1, then a HELiOS query for the revision is performed for the variant. This only happens if the part's Head ID is also changed. This parameter is optional and is set to 1 by default.

 

The block ,for the control parameters could, for example, look as follows:

# Block of control parameters

VAREDIT_LANG_CODE:1033

VAREDIT_BASE_DIR:C:\HiCAD\PlantParts\

VAREDIT_DRY:1

VAREDIT_REGEX:1

VAREDIT_UPD_REVID:1

 

Part 2

The second part defines the search parameters for the actual Search & Replace. The lines have the following structure:

HELiOS attribute name:Search value;Replace value

 

The HELiOS attribute name refers to an attribute that is used in the variants, e.g. BENENNUNG (= Designation). Instead of a HELiOS attribute name, you can also specify a variable name directly, e.g. N instead of NENNWEITE (= Nominal diameter).

You cannot use the language-dependent attribute identifiers displayed in the variant editor, such as sheet thickness etc!

Spaces in the values are not ignored, but read in as written there.

 

The block for the search parameters could, for example, look as follows:

# Block of search parameters

CNT1:20100;10000

PN:40;50.569

D1:90;120.666

HEL_SACHNUMMER:EN 1092-1/01/DN <NENNWEITE>/PN 40;EN 1092-1/01/DN <DRUCK>/PN <DRUCK>

BENENNUNG:(Clean)[^ ]*( for welding);\1break\2

HEL_KOPFID:B00DH4XULBEB5J00003HVV;B00DH4XULBEB5J00003HLP

 

Floating point values (Decimal fractions9 must be separated with a point and not with a comma!

 

The list_of_variants file

As mentioned above, this file lists the variants to be changed with their file name and extension. Each line may only contain one file at a time.

Empty lines and lines beginning with the character # are ignored. Thus, variants can be (de)activated quickly and easily.

 

The content of the list of variants could, for example, look as follows:

# List of variants

EN1092-1-01-PN25.vaa

EN1092-1-01-PN40.vaa

EN1092-1-01-PN63.vaa

 

An example can be found here.


Take over comments from feature variables

For explanatory purposes, comments can be assigned to part or feature variables in HiCAD, which can be very helpful, especially if there are a large number of variables.

If parts with variables and assigned comments are saved as a VAA file, you should in any case note the following:

  1. Comments that you have assigned to part or feature variables are also stored in the archive file (.VAA) when a feature variant is created. The storage takes place in the archive in an internal IPT table.
  2. If parts from a VAA file are incorporated into the drawing, the comments stored in the internal IPT table will be used as a tooltip.
  3. If the VAA file is opened with the Variant Editor, the comments will be read from the internal IPT table of the VAA file and displayed as an editable Description. However, this does not apply to structured variants.
  4. If the description is changed in the Variant Editor, this will be displayed as a tooltip during the installation of the variant.
  5. In the Variant Editor, the descriptions can again be overwritten with the comments of the feature variables. For this purpose, the new button is available. However, this does not apply to structured variants.

 

The following graphic is intended to illustrate the above-mentioned points once again:

 


Major Release 2022 (V 2700)

Saddle connectors - Variable DA

For saddle connectors, the variable name DA is reserved for the outer diameter of the pipe into which the saddle connector is inserted. This value is overwritten when the saddle connector is loaded. Therefore, the name must not appear in the variable table.

For this reason, as of HiCAD 2022, there is an error message when trying to save such a saddle connector with the Variant Editor.

Variant Editor