2.2.8.4. Common hints for Attribute Mapping sections

CadDocumentAttributes

Under "CadDocumentAttributes" you can find information that is transferred to the respective CAD program when exporting from PARTsolutions. Some of these values are transferred directly, others are dynamically queried via function calls, such as the catalog manufacturer (SUPPLIER) [first line in the following figure].

Example from ifsolidworks.cfg

Example from ifsolidworks.cfg

[CadDocumentAttributes]

Valid syntax for attributes is:

  • Map a table variable into the given attribute

    CadAttrName=?_ATTR("NB")

  • Map a VB expression into the given attribute, valid are also ?"3.1415926" ORELSE ?"This is a text"

    CadAttrName=?AnyVBExpr 

  • Attribute is mapped as value ORELSE as string

    in this way, the type of attribute is set

    CadAttrName.Type=val|str  

  • The following is partly CAD-dependent information

    CadAttrName.Custom=Any Custom Data

    Examples:

    • For all CADs

      • Assignment of a type

        Possible attribute types: String (default), Number, Integer, Double, Datetime, Boolean

        Example:

        DN=42
        DN.CUSTOM=type.number

        Meaning: 42 is a number and not a string

    • NX-specific

      • Assignment of a category

        Example:

        DN=42
        DN.CUSTOM=category.partsolutions

        Multiple values can be entered separated by commas.

        DN=42
        DN.CUSTOM=type.number,category.partsolutions

      • Marking an attribute as a mandatory attribute

        Adding this parameter to mapped attributes will cause them to be mapped during the initial model creation process (before geometry), as required by NX 2312 (or later).

        Not setting this flag has no effect in earlier NX versions, but starting with NX2312 the model export will fail with error message "The attribute not found" if not all mandatory attributes in the configuration file ifugnx.cfg are marked as such.

        Example:

        DN=42
        DN.CUSTOM=flag.mandatory

CopyFrom

The Section "CopyFrom" also accepts complete statements .. the %ATTRNAME% is reduced by the current var

CopyFrom..=_FORMAT_0("MYPREFIX_HERE<ATTR-(%ATTRNAME%)>-MYPOST_HERE").value()

In addition, the "CopyFrom" may contain the following filter/flags:

  • VAR_VISIBLE=0/1

  • VAR_TYPE= any valid type (see ps3 for details)

  • VAR_SOURCETYPE=any valid source (see ps3 for details)

  • VAR_EXCLUDE=Name1;name2;name3

  • LANG=language1;language2;...

  • Sample:

    CopyFrom..=italian,VAR_VISIBLE=1,lang=english;default

    Use Italian as base language, only take visible vars and then use all English names and if there are more in the default language use them in addition

Sequence and priority

Sometimes one and the same variable can have different values, depending on the context of the part. This means that multiple entries are also possible.

What happens if several assignments apply?

The first applicable entry (we think of the return value of functions) is taken. So if you enter a default value first without any checks, it will always be taken. See the last line in the following illustration. The following assignments of these variables are never executed by the program.

[Note]Note

Always list from the specific assignment of the attribute to the more general one up to the assignment of the default value!