powered by CADENAS

Manual

Manual

2.2.2.2. File name: set generation options ("FileName" key)

[Note] Note

You are a new customer or have decided to no longer use the old V 8.1 pool data in the CAD for new assemblies, then leave the default settings.

Of course you can optionally change the default setting (standard name plus material in the file name).

Based on a few examples the most important options to set the file name will be shown below.

  • Example 1:

    This example shows the default setting.

    Declaration for a part (is3dpart)

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

    Declaration for an assembly (is3dasm).

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

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

    <GENNAME><MATERIAL(_)>: The file name contains the Standard Name (NB) and the material (if existing).

    [Note] Note

    The material is only then inserted automatically when under PARTdataManager -> Extras -> Settings... -> Table the option Show material selection is activated. [a]

    Detailed information regarding material column and inserting material can be found under Section 3.3.2, “ "Table" tabbed page ” in PARTsolutions / PARTcommunity4Enterprise - User manual. Information regarding material mapping can be found under ???.

    [a] Under V8.1 there was also this setting. But the material was inserted via dialog box and not displayed in the table. Furthermore it was necessary to enable the inserting via VB file. Now the setting can be performed here in the interface configuration file.

    toFileName("_"): Not allowed characters[42] are automatically replaced by an underscore.

    <.FileExtension>: By default the correct file extension is already inserted.

  • Example 2:

    Take over prefixes in file name.

    "<PREFIXLIST(_)>" is inserted.

    For projects that contain more than one prefix, these are automatically inserted into the file name with underscore as separator (e.g. Norm9, core hole)

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

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

  • Example 3:

    Take over catalog names in the file name.

    "<CATALOG>_" is prefixed to the file name.

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

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

  • Example 4:

    • <GenNAME(25)>: Restrict length of file name

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

    • ToLower(): Convert all characters into lower-case characters

    • MaxLen(28): The entire length of the file name is restricted to 28 characters

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

  • Example 5:

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

    [Important] Important

    In PARTsolutions V8.1 the determination of the file name occurred in PARTadmin or PARTlinkManager on the Standard name and/or Standard name (short).

    This option is not to be used in V9!

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

      FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).
      Format("<GENNAME><MATERIAL(_)>").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()

      Using <ATTR(any_ERP_column)> you can refer to any ERP column.

      FileName(isCreaOptNotSet,is3dasm)=?GetObject("iface.calcnameservice").start(0).
      Format("<ATTR(beliebige_ERP_Spalte)>").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 6:

    In this complex example an ERP integration is used.

    The file name shall be overtaken from an ERP column.

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

    • for assemblies

    • for part

    • for subparts

    The file name definition for assembly and part is standard syntax, such as known from the preceding examples.

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

    • ...prefix from the ERP column,

    • followed by the generic name (NB).

    ;Baugruppe
    FileName(isCreaOptNotSet,is3dAsm)=?GetObject("iface.calcnameservice").start(0).
    Format("<ATTR(xy)>").alnum("_").ToLower().MaxLen(28).add(".asm").value()
    
    ;Einzelteil
    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(".prt").value()

    Result:

    AAAA is the value from the ERP column "xy"

    AAAA is the value from the ERP column "xy"

    Explanations:

    isSubPart: For SubParts a category set. That's why this special key is only valid for SubParts.

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

    The expression behind the plus sign creates the file name such as in the preceding examples.

    [Note] Note

    Example 6 may show how differentiated the file name can be build. However we recommend to approve such complex adjustments by a consultant to avoid any side effects.



[42] Further details on this are found under Section 2.2.1.3, “Variable values - functions ”.