powered by CADENAS

Manual

Manual

2.2.1.3. Variable values - functions

Variable values: All keys which are built with the schema „Name=?“ are interpreted during runtime. The command is given in VB syntax.

The following example shows that the value of the "FileName" key is assembled via a VB command.

FileName=?GetObject("iface.calcnameservice").start(0).Format("<GENNAME>").Value()

In the following some important functions are explained by which you can adjust the commands as desired.

  • Function Format("..."): returns the calculated name

    Hereby for example the file name can be built in various ways.

    • <NAME>: delivers the direct name, meaning this what in PARTdataManager is configured as name (mostly the NB [standard name] or the ERP number).

    • <GENNAME>: The generic name. Similar to "NAME". But GENNAME automatically returns an automatically generated name, when an empty name would occur. So in any case a valid name is created. The NB [Standard Name] is used.

    • <GENNAME(maxlen)>: "maxlen" is for any number:: The value is restricted to the given length.

      Example 1: Generic name (NB) is restricted to a certain number of signs.

      Format("<GENNAME(25)>")

      Example 2: The following form is also possible:

      Format("<ATTR(NT)>").maxlen(10)
      Format("<NAME>").maxlen(10)

    • <GENSHORTNAME>: SHORTNB is used.

    • <SHORTNAME>:

    • <ATTR(Name)>: Any attribute which is stated with its name.

      Format("<ATTR(NN)>")

    • <ATTR(language,name)>: Optionally the language can be declared.

      Format("<ATTR(english,NB)>")
      Format("<ATTR(NT)>")
      Format("<ATTR(LINA)>")
      Format("<ATTR(ERP_PDM_NUMBER)>")
      Format("<ATTR(NENN)>")

    • <MATERIAL(_)>: Returns the material from the classification CNS/CNSPHYPROP/CNSMAT.

      Format("<GENNAME><MATERIAL(_)>")

      Generic name (NB) and material concatenated with underscore.

    • <PREFIXLIST(_)>: Available prefixes are prefixed to the generic name separated by an underscore. With projects that have several prefixes, these are inserted in the file name with underscore as separator (e.g. Norm9, cored hole)

      Example 1:

      Format("<PREFIXLIST(_)><GENNAME><MATERIAL(_)>")

      Example 2:

      Format("$CADENAS_DATA/pool/cadname/<PREFIXLIST(/)>")

      "PREFIXLIST" is used for the poolpath for example with the "/" separator.

    • <CATALOG>_..................>: The catalog name is prefixed.

      Example:

      Format("<CATALOG>_<GENNAME><MATERIAL(_)>")

    • <DATE(-)>_<TIME(-): Date and time are included in the file name.

      FORMAT("<GENNAME><MATERIAL(_)>_<DATE(-)>_<TIME(-)>")

  • Function RepSeq(a1,b1): "RepSeq" means "Replace Sequence. String 1 is replaced by String 2.

  • Function add(anytext): adds something; the file extension for example

    Examples:

    Inventor (Part): .ipt; Inventor (Assembly): .iam

    SolidWorks (Part): .sldprt; SolidWorks (Assembly): .sldasm

    Insert the file extension according to your CAD system.

  • Function toFileName("_"): replaces invalid characters by the character given in the brackets.

    Invalid characters are:

    / \ ? % * : | " < > .

  • Function alnum("_"): Replaces all non alphanumerical characters by the character given in the brackets; empty spaces as well.

  • Function ToLower(): All characters are changed to lower-case characters.

  • Function ToUpper(): All characters are changed to upper-case characters.

  • Function MaxLen(len): "len" stands for any number: The whole expression is restricted to the given length.

  • Function Value(): Returns the current value as string; is used as the last call.

"Assembling" functions:

These are assembled separated by a point (.).

Example:

The function RepSeq(a1,b1) shall be inserted in an existing key:

Before:

poolpath(isCreaOptNotSet)=?GetObject("iface.calcnameservice").start(0).
Format("$CADENAS_DATA/pool/cadname").value()

After:

poolpath(isCreaOptNotSet)=?GetObject("iface.calcnameservice").start(0).
Format("$CADENAS_DATA/pool/cadname").RepSeq("NORM9,NORM8").value()