Forum Discussion

lucas's avatar
lucas
Ideator I
5 years ago
Solved

update a part's extended property through the iom

hello, i have been able to update the extended property of a part through aml but i'm looking fo a sample code to understand how to do it with iom(innovator object model) thanks, Lucas
  • Gopikrishnan's avatar
    5 years ago

    Hi Lucas

    Can you give a try using below code (Replace bold letters in below code)

    Innovator innovator = this.getInnovator();

    Item partEdit = innovator.newItem("Part", "edit");

    partEdit.setAttribute("id", "4F353307B92C40B5A9AADE4B1C857CDQ"); // Change with Part Item ID

    partEdit.setPropertyAttribute("xp-cost", "set", "value"); // Update the XProperty you want to update

    partEdit.setProperty("xp-cost", "100"); // Update the XProperty and its value

    partEdit = partEdit.apply();

    return partEdit;

    Thank You

    Gopikrishnan R