DM_PARTID_TAGNAME_FOR_AMOUNT_IN_BOM

Syntax

DM_PARTID_TAGNAME_FOR_AMOUNT_IN_BOM ( part_id );
Input arguments
string part_id Part id as a string.

Return Values

Success:

One of string values: "len", "qty", "are" or "vol".

string len Length
string qty Quantity
string are Area
string vol Volume
Failure:
int -1 Script interface error.
int -2 Bad partid.

Description

This function returns tag name that is used to measure amounts in bill-of-material of materials with a given part-id.

This function mostly finds use in scripts that build user-interfaces to prompt info of extra materials.

Example

Copy
#include include/dmutil.h

main()
 {
 go_on = 1;
 while (go_on){
        rec = DM_INIT_TAGREC();
        pid = DM_BROWSE_PARTCODE("", 1, rec);
        DM_FREE_TAGREC(rec);
        if (!ISSTRING(pid) | ISINT(pid))
          return(-1);
        if (pid == "")
          return(-1);
        bomtag = DM_PARTID_TAGNAME_FOR_AMOUNT_IN_BOM(pid);)
        if (ISSTRING(bomtag))
          U_MESSAGE("Tag in bom: " + bomtag)
        else
          U_MESSAGE(("No bom tag");
}
return(0);
}