2.3.10.1.2.  Key "FileName" - Define structure of document name

Name for file in pool directory, file extension "sldprt" for part, "sldasm" for assembly. Also see keys "PoolPath", "Material", "MaterialDBFile" and block "MatMap".

Default:

FileName(isCreaOptNotSet,is3dpart)=?_FORMAT_0("<GENNAME>").toFileName("_")
 .add(".sldprt").value()

FileName(isCreaOptNotSet,is3dasm)=?_FORMAT_0("<GENNAME>").toFileName("_")
 .add(".sldasm").value()

There are two categories: one for parts and one for assemblies.)

<GENNAME>: The file name contains the Standard Name (NB).

toFileName("_"): Non-permitted characters are automatically replaced by an underscore.

Examples:

The following examples may show how differentiated the file name can be. However, we recommend obtaining the approval of a consultant for such complex adaptations in order to avoid undesirable side effects.

Example 1:

Include prefixes in the file name.

"<PREFIXLIST(_)>" is inserted.

For projects that have several prefixes, these are automatically inserted into the file name with an underscore as a separator (e.g. Norm9, Kernloch)

Declaration once for component part (is3dpart) and once for assembly (is3dasm).

FileName(isCreaOptNotSet,is3dpart)=?GetObject("iface.calcnameservice").start(0).Format
 ("<PREFIXLIST(_)><GENNAME>").toFileName("_").add("<.FileExtension>").value()

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<PREFIXLIST(_)><GENNAME>").toFileName("_").add("<.FileExtension>").value()

Example 2:

Take over catalog names in the file name.

The file name is prefixed with "<CATALOG>_ ".

Declaration once for parts (is3dpart) and once for assemblies (is3dasm).

FileName(isCreaOptNotSet,is3dpart)=?GetObject("iface.calcnameservice").start(0).Format
 ("<CATALOG>_<GENNAME>").toFileName("_").add("<.FileExtension>").value()

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<CATALOG>_<GENNAME>").toFileName("_").add("<.FileExtension>").value()

Example 3:

<GenNAME(25)>: Limit the length of the file name

alnum("_"): Only allow alphanumeric characters; others are replaced by an underscore

ToLower(): Convert all letters to lower case

MaxLen(28): Limit the total length of the file name to 28 characters

FileName(isCreaOptNotSet,is3dpart)=?GetObject("iface.calcnameservice").start(0).Format
 ("<GenNAME(25)>").alnum("_").ToLower().MaxLen(28).add(".prt").value()

Example 4:

This example covers the file name creation with existing ERP-connection.

The file name is built from GENNAME (NB) and material by default.

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<GENNAME>").alnum("_").add("<.FileExtension>").value()

However, you can build the file name using the ERP number. The advantage would be to get an absolutely unique file name.

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<ATTR(ERP_PDM_NUMBER)>").alnum("_").add("<.FileExtension>").value()

You can reference any ERP column using <ATTR(any_ERP_column)>.

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<ATTR(any_ERP_column)>").alnum("_").add("<.FileExtension>").value()

The creation via ERP number + standard name (NB) is an option as well in order to have a meaningful section in the name.

FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<ATTR(ERP_PDM_NUMBER)>_<GENNAME>").alnum("_").add("<.FileExtension>").value()

Example 5:

An ERP integration is assumed in this complex example:

The key FileName is defined 3 times with the help of categories:

  • for assemblies

  • for parts

  • for lower parts

The definition of the file name for assemblies and parts is standard syntax as known from the previous examples.

The SubParts of the assembly should combine the file name with ...

  • ...prefix from the ERP column,

  • followed by the generic name (NB).

;Assembly
FileName(isCreaOptNotSet,is3dAsm)=?GetObject("iface.calcnameservice").start(0).Format
 ("<ATTR(xy)>").alnum("_").ToLower().MaxLen(28).add(".asm").value()

;Part
FileName(isCreaOptNotSet,is3dpart)=?GetObject("iface.calcnameservice").start(0).Format
 ("<ATTR(xy)>").alnum("_").ToLower().MaxLen(28).add(".prt").value()

;SubPart
FileName(isCreaOptNotSet,is3dpart,isSubPart)=?GetObject("iface.calcnameservice").start(0)
 .SetObj(GetObject("iface.metaoptionservice").GetRoot()).Format("<ATTR(xy)>_").value()
 +GetObject("iface.calcnameservice").start(0).Format("<GenNAME(25)>").alnum("_")
 .ToLower().MaxLen(28).add(".sldprt").value()

Result:

AAAA is the value from the ERP column "xy"

Explanation:

isSubPart: A category is set for subparts. This special key is therefore only valid for subparts.

The expression before the plus sign reads the content from the ERP column.

The expression after the plus sign creates the file name as in the previous examples.