Recipe Group Manager (RGM)

Recipe Group Manager (RGM)

Here is an Example howto read out all RecipeGroups, RecipeGroupVariables, Recipes and Values...
The Exmaple is made for the Runtime, but it will also work in the Editor when "MyWorkspace.ActiveDocument" is used insted of "thisProject"!
VBA Code:

Public Sub zenOn_RGMGroups()
'Declarations
Dim zRGM_Groups As RGMRecipeGroups
Dim zRGM_Group As RGMRecipeGroup
Dim i As Integer

'Initialize zRGM_Groups with the "RGMGroups" object of the current project
Set zRGM_Groups = MyWorkspace.ActiveDocument.RGMGroups
'Create a new group called "zenOn_RGMGroup"
zRGM_Groups.CreateGroup ("zenOn_RGMGroup")
'Enumerate all recipe groups
For i = 0 To zRGM_Groups.Count - 1
'Assign the current item to zRGM_Group
Set zRGM_Group = zRGM_Groups.Item(i)
'Enumerate the groups
Debug.Print i + 1 & ". Group: "
'Output name of the group
Debug.Print " Name: " & zRGM_Group.DynProperties("Name")
'Output amount of recipes within the collection
Debug.Print " Recipes: " & zRGM_Group.RecipeCount
'Output amount of variables within the collection
Debug.Print " Variables: " & zRGM_Group.VariableCount
'Output a blank line
Debug.Print ""
'If there are recipes available, then output them
If zRGM_Group.RecipeCount > 0 Then
Call GetRecipesOfGroup(zRGM_Group)
End If
'If there are variables available, then output them
If zRGM_Group.VariableCount > 0 Then
Call GetVariablesOfGroup(zRGM_Group)
End If
Next i
'Delete the former created group
zRGM_Groups.DeleteGroup ("zenOn_RGMGroup")
Debug.Print ""
End Sub
Sub GetRecipesOfGroup(myRGMGroup As RGMRecipeGroup)
'Declarations
Dim zRGM_Recipe As RGMRecipe
Dim i As Integer

Debug.Print "Recipes"
'Enumerate all recipes in the group
For i = 0 To myRGMGroup.RecipeCount - 1
'Assign the current recipe item to zRGM_Recipe
Set zRGM_Recipe = myRGMGroup.RecipeItem(i)
'Output the recipe
Debug.Print " Recipe" & i + 1 & ": " & zRGM_Recipe.DynProperties("RecipeName")
Next i
'Output a blank line
Debug.Print ""
End Sub
Sub GetVariablesOfGroup(myRGMGroup As RGMRecipeGroup)
'Declarations
Dim zRGM_Variable As RGMRecipeVar
Dim i As Integer
'Enumerate all variables of the group
Debug.Print "Variables"
For i = 0 To myRGMGroup.VariableCount - 1
'Assign the current variable item to zRGM_Variable
Set zRGM_Variable = myRGMGroup.VariableItem(i)
'Output the variable
Debug.Print " Var" & i + 1 & ": " & zRGM_Variable.Name
Next i
'Output a blank line
Debug.Print ""
End Sub


This is a migrated post! Originally posted on 17.07.2007 by user robertf. Please be aware that information can be outdated.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com