0% found this document useful (0 votes)
25 views3 pages

Advanced Functions B - NEST Import

The document outlines advanced functions for import rules in the B_NEST configurator, detailing operations such as string manipulation, mathematical conversions, and condition verification. It includes examples of formulas for CSV file imports, string concatenation, and converting text to numbers. Additionally, it explains how to perform unit conversions and apply mathematical operations on program parameters, providing a comprehensive guide for users to manipulate and process data effectively.

Uploaded by

charmedubois
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

Advanced Functions B - NEST Import

The document outlines advanced functions for import rules in the B_NEST configurator, detailing operations such as string manipulation, mathematical conversions, and condition verification. It includes examples of formulas for CSV file imports, string concatenation, and converting text to numbers. Additionally, it explains how to perform unit conversions and apply mathematical operations on program parameters, providing a comprehensive guide for users to manipulate and process data effectively.

Uploaded by

charmedubois
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Advanced functions for import rules

configurator in B_NEST
Index
Csv file to import ............................................................................................................................................... 2
If Then Else .................................................................................................................................................... 2
Strings concatenation .................................................................................................................................... 2
Delete spaces or other characters:................................................................................................................ 2
Obtain pieces of a string ................................................................................................................................ 2
Verify conditions of a string........................................................................................................................... 3
Convert text in number ................................................................................................................................. 3
Use of the File name ...................................................................................................................................... 3
Conversion in mm of program parameters ................................................................................................... 3
Other mathematical operations on the program parameters ...................................................................... 3
Csv file to import
File name: ImportExample_Project.csv
$ Nome Tipo Valore
1 Name Text A01
2 Wood type Text TRU_WHITE
3 Program Name Text RECT_Param.bSolid
4 Description Text RECT_Param
5 Program parameters Text LPX=100 AA=’t’ REP=3
6 Quantity to do Text 9

If Then Else
Formula Value
($7=="true") ? 1 : 0 1
($2=="") ? "empty" : $2 TRU_WHITE
In brackets you have to insert the condition, after the “?” you have to put the value if the condition is TRUE,
while after the “:” you have to put the value if the condition is FALSE. [==→equal; !=→different;
>=→greater or equal; <=→less or equal]

Strings concatenation
Formula Value
$1+$2 Pezzo01TRU_WHITE
$1+”_”+$2 Pezzo01_TRU_WHITE

Delete spaces or other characters:


Formula Value
$4.Replace(" ","") Descrizionedelpezzo
$2.Replace("_","") TRUWHITE
$2.Replace("WHITE","BIANCO") TRU_BIANCO
Inside the first “” you have to insert the character that you want to replace with the ones contained in the
second “”.

Obtain pieces of a string


Formula Valore
$4.Substring(16) pezzo
$4.Substring(16,3) pez
If you insert just one number, that will be the index of the character from which you will leave to obtain the
substring. If you insert also the second number, that will indicate the number of characters to take from the
original string.
Verify conditions of a string
Formula Value
$2.StartsWith("TRU") True
$2.EndsWith("YELLOW") False
This formula can be also used as condition for “if-then-else”

Convert text in number


Formula Value
int.Parse($6) 3
decimal.Parse($6) 3

Use of the File name


Formula Value
ImportFileName ImportExample_Project
The name is used deleting automatically the extension of the imported file.

Conversion in mm of program parameters


Formula Value
Fx.ToMm($5) LPX=(100)*25.4 AA=’t’ REP=(3)*25.4
Fx.ToMm($5,"REP") LPX=(100)*25.4 AA=’t’ REP=3
Fx.ToMm($5,"LPX REP") LPX=100 AA=’t’ REP=3
It is possible to specify only the string of parameters to be converted, in this case all parameters that are
not of the string type will be converted from inches to millimeters. It is also possible to specify one or more
program parameters for which the conversion must not be carried out.

Other mathematical operations on the program parameters


Formula Value
Fx.Sum($5, 10) LPX=(100)+10 AA=’t’ REP=(3)+10
Fx. Sum ($5, -5, "REP") LPX=(100)-5 AA=’t’ REP=3
Fx.Mul($5, 10) LPX=(100)*10 AA=’t’ REP=(3)*10

It is possible to specify only the parameter string to which to apply the mathematical operation, in this case
this operation will be applied to all parameters that are not of the type. It is also possible to specify one or
more program parameters for which the mathematical operation should not be applied.
With Fx.Sum you add or subtract quantities, with Fx.Mul you multiply or divide (multiplier <0) by a quantity

You might also like