Parts

Functions and constants relating to Parts

Functions

Details of functions

GetPartInfo(part_id[integer]) [static]

Description

Returns information about a part in the current model

Arguments

  • part_id (integer)

    Internal part number

    Returns

    Object with the following properties:

    Name Type Description
    alpha integer Part transparency (0-255)
    blue integer Blue component of part colour (0-255)
    green integer Green component of part colour (0-255)
    include integer The include number part is in (0 if main file)
    red integer Red component of part colour (0-255)
    title string The part title

    Return type

    object

    Example

    // Return the title of the first part in the model
    var info = GetPartInfo(1);
    Print("Part title = " + info.title + "\n");
    


    GetPid(type_code[integer], item[integer], state_id (optional)[integer]) [static]

    Description

    Returns the internal part id of internal <item> of type <type_code>

    Arguments

  • type_code (integer)

    A valid part-based element type code (e.g. SOLID, SHELL)

  • item (integer)

    If +ve, the internal item number starting at 1. If -ve, the external label of the item. Internal numbers will be many times faster to process.

  • state_id (optional) (integer)

    State number to be used instead of the current state

    Returns

    integer

    Return type

    Number

    Example

    // Return the internal part index of the 27th internal shell
    var a = GetPid(SHELL, 27);
    // Return the external part label of the shell with label 123
    var pid = GetLabel(PART, GetPid(SHELL, -123));