Variable values: All keys that are structured according to the scheme "Name=?" are evaluated at runtime. The instruction is stored 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)
<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(_)>") [veraltet]
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)
Format("<PREFIXLIST(_)><GENNAME>")
Format("$CADENAS_DATA/pool/cadname/<PREFIXLIST(/)>")
"PREFIXLIST" is used for the poolpath for example with the "/" separator.
<CATALOG>_..................>: The catalog name is prefixed.
Format("<CATALOG>_<GENNAME>")
<DATE(-)>_<TIME(-): Date and time are included in the file name.
FORMAT("<GENNAME>_<DATE(-)>_<TIME(-)>")
RepSeq(a1,b1) function: "RepSeq" means "Replace Sequence. String 1 is replaced by string 2.
Function add(anyText): adds something; for example the file name extension
Inventor (part): .ipt ; Inventor (assembly): .iam
Function toFileName("_"): replaces invalid characters by the character given in the brackets.
Function alnum("_"): Replaces all non-alphanumeric characters with the character specified in the bracket; also spaces.
Function ToLower(): All characters are changed to lower-case characters.
ToUpper() function: All letters are converted to capital letters.
Function MaxLen(len): "len" stands for any number: The whole expression is restricted to the given length.
Value() function: Returns the current value as a string; is used as the last call.
"Assembly" of individual functions:
These are "assembled" separately with a dot ( . ).
The RepSeq(a1,b1) function is to be inserted into an existing key:
poolpath(isCreaOptNotSet)=?GetObject("iface.calcnameservice").start(0).Format("$CADENAS_DATA/pool/cadname").value()
poolpath(isCreaOptNotSet)=?GetObject("iface.calcnameservice").start(0).Format("$CADENAS_DATA/pool/cadname").RepSeq("NORM9,NORM8").value()