Interface AttributeInfoInterface

The AttributeInfoInterface gives information about the attributes of a part instance.

The DMU contains a collection of pieces (3D or not). All these pieces have information located inside them. The Attribute Info interface stores the type of the attribute, its name, the full "path of this attribute" (in case of nested attributes) and some range / min / max values if available.

/** 
* Sample to illustrate the AttributesDictionaryInterface iteration.
*/
import { DataSessionInterface, AttributesDictionaryInterface, AttributeInfoInterface } from 'generated_files/documentation/appinfiniteapi';

// the DataSessionInterface has been created previously and is connected
let lDataSession : DataSessionInterface;
// retrieve the attributes dictionary
const lAttributeDictionary: AttributesDictionaryInterface = lDataSession.getAttributesDictionary();
// get the dictionary to iterate over the attributes
const lAttr: Array<AttributeInfoInterface> = lAttributeDictionary.getDictionary();
let i : number;
for (i = 0; i < lAttr.length; i += 1)
{
const lAttrName: string = lAttr[i].getAttributeName();
// output attribute name
console.log(lAttrName);
}

There may be cases when the results from an id-card request (InstanceMetadataInterface inside the PartInstanceInfoInterface) are not of the expected type, such data cannot be requested since the field content is not indexed. In this case the attribute name is included in the DocumentContentInterface.getNonIndexedContent fields, depending on the case.

Available values for a string attribute are not available from the AttributeInfoInterface. Please use an AttributeValuesEnumeratorInterface to get available string values of a given string attribute.


Metadata

interface AttributeInfoInterface {
    getAttributeMaxFromNumericType(): number;
    getAttributeMinFromNumericType(): number;
    getAttributeName(): string;
    getAttributeNestedPath(): string;
    getAttributeNumericType(): AttributeNumericType;
    getAttributeType(): AttributeType;
    isSensitiveToConfiguration(): boolean;
}

Methods

  • Gets the maximum value of the attribute inferred from its numeric type (byte, short, int, long long, float, double).

    Javascript only exposes numbers, but the 3djuump Infinite API exposes several numeric types. All numeric types have the type AttributeType.ATTR_NUMBER or AttributeType.ATTR_NUMBER_RANGE. It may be interesting to know the maximum value inferred by its type.

    Returns number

    The maximum numeric value inferred by the type of this attribute.

  • Gets the minimum value of the attribute inferred from its numeric type (byte, short, int, long long, float, double).

    Javascript only exposes numbers, but the 3djuump Infinite API exposes several numeric types. All numeric types have the type AttributeType.ATTR_NUMBER or AttributeType.ATTR_NUMBER_RANGE. It may be interesting to know the minimum value inferred by its type.

    Returns number

    The minimum numeric value inferred by the type of this attribute.

  • Gets the name of the attribute. This name is the one stored inside the database.

    Returns string

    The name of the attribute in the database.

  • If this attribute is included in a sub-document (nested), gets the path of nested array in parent.

    All attributes that share the same nested path are included in the same nested document.

    Returns string

    The nested path if the attribute is nested, undefined if not.

  • Tells if this attribute may change value according to the current configuration.

    Returns boolean

    true if this attribute is sensitive to configurations and thus may change value depending on the current configuration.