PyMacroModelPlugin.MacroScenarioNewCmd¶
- class MacroScenarioNewCmd¶
Macro Assignment Scenario creation command
Details
Command to create a new macro assignment scenario either at the model level or inside a sub-area object
The correct way to create this command is to use the function:
GKCommand * createNewCmd( GKType * type ) const;
from the
GKModelclass.Once created, and in order to do it use the function:
GKCommandReport * addCommand( GKCommand * aCommand );
from the
GKCommanderclass.A sample code for creating a new Static Assignment Scenario would look like:
cmd = model.createNewCmd( model.getType( "MacroScenario" )) cmd.setProblemNet( subnetwork ) model.getCommander().addCommand( cmd ) res = cmd.createdObject()
See also
createNewCmdaddCommandSynopsis¶
Methods¶
def
__init__()def
setProblemNet()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
- setProblemNet(aproblemNet)¶
- Parameters:
aproblemNet –
GKProblemNet
Sets the sub-area (
GKProblemNetobject) this macro assignment scenario will be created in, if any. When this function is not called, the macro assignment scenario will be created for the whole model