Showing results 1 to 3 of 3

Thread: Create recipe by function and modify the new recipe in C#

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    25.04.2019
    Posts
    1

    Default Create recipe by function and modify the new recipe in C#

    Hi, I would like to create a recipe using a function and edit it in C# right after creating it.
    Creating the recipe by function works using the following command:

    this.RtFunctions().Item("Function_Recipe_Offline_Save_As").Start();

    Modifying an existing recipe works as well using the following code:

    zenOn.IRGMRecipeGroups zRGM;
    zRGM = this.RGMGroups();
    zenOn.IRGMRecipeGroup zRecipeGroup = zRGM.Item("Product_Data");
    zenOn.IRGMRecipe zRecipe;zRecipe = zRecipeGroup.RecipeItem("RecipeName");
    zRecipe.set_DynProperties("RecipeNumber", RequestedID);
    zRecipe.ValueItem(1).set_DynProperties("Type", 2);
    zRecipe.ValueItem(1).set_DynProperties("StringValue", RequestedName);
    zRecipe.ValueItem(2).set_DynProperties("Type", 2);
    zRecipe.ValueItem(2).set_DynProperties("Value", RequestedID);
    zRecipe.Save();

    In both cases the Recept Name comes from a PopUp, that means the name is known in the Project. Instead of the string "RecipeName" it would be a variable RequestedName.
    What doesn't work is to create and change the Receptes in one step. Apparently the currently created Recept is not available yet? Is there someting to be updated? Does anyone have an idea how I can realize this?
    Last edited by StephanJ : 29th April 2019 at 09:12

Similar Threads

  1. Recipe combobox not refreshing after create
    By MOSA_SENMATIC in forum VSTA
    Replies: 2
    Last Post: 17th August 2018, 10:18
  2. Replies: 1
    Last Post: 11th December 2013, 07:15
  3. Recipe value
    By scadavmesnik in forum zenon Supervisor
    Replies: 1
    Last Post: 13th September 2012, 00:13
  4. RGM actual recipe
    By scadavmesnik in forum zenon Supervisor
    Replies: 1
    Last Post: 8th July 2012, 23:56

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •