Showing results 1 to 3 of 3

Thread: Recipe Group Manager (RGM)

  1. #1
    robertf Gast

    Idee 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"!

    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
    Last edited by robertf : 7th August 2007 at 10:49

  2. #2
    Join Date
    15.10.2009
    Posts
    28

    Default Re: Recipe Group Manager (RGM)

    Hallo zusammen,

    ist es auch möglich im RGM auf die "Einheit" der Variable zuzugreifen. Wenn ja, wie kann ich darauf zugreifen?

    Gruß
    stimpfig

  3. #3
    Join Date
    28.07.2008
    Posts
    64

    Default Re: Recipe Group Manager (RGM)

    Geht nur direkt über die Variable:

    Debug.Print "Test :" & MyWorkspace.ActiveDocument.Variables.Item("Test").Unit

Posting Rules

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