The Macro Object

The Macro object is an element of the Macros collection and contains all the information stored about each defined macro in the model.

Properties for the Macro Object

Count

The number of terms in the macro. (Integer Property - Read Only)

Name

The name of the macro. (String Property - Read Only)

Value

The computed value of the macro. (Double Property - Read Only)

Visual Basic Example:


    Dim MPL As OptiMax
    Dim planModel As Model
    Dim mac As Macro

    Set MPL = New OptiMax
    MPL.Solvers.Add("CPLEX")
    Set planModel = MPL.Models.Add("Planning.mpl")
    MPL.WorkingDirectory = "c:\mplwin4"

    Result = planModel.ReadModel(planModel.Name)
    Result = planModel.Solve
    For Each mac In planModel.Macros
        Debug.Print mac.Name & " = " & mac.Value & "  (" & mac.Count & ")"
    Next mac

        

Back To Top | Maximal Home Page | Table of Contents | Previous Page | Next Page