CModel.SetUseStress: Difference between revisions
Jump to navigation
Jump to search
Chris Kahn (talk | contribs) |
Kate Racaza (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:cModel.SetUseStress}} | {{InProgress}}{{DISPLAYTITLE:cModel.SetUseStress}}{{Template:API}}{{Template:APIBreadcrumb|9|.[[CModel Class|cModel]]}} | ||
{{Template: | |||
<onlyinclude>For ALTA models only. Sets the use stress level for one or multiple stresses of a [[CModel Class|cModel]] object.</onlyinclude> | |||
This method does not apply to published models, which are model resources that have been published from and are associated with an existing analysis/data source. | |||
== Syntax == | == Syntax == | ||
'''VBA''' | |||
'''.SetUseStress'''(''Index'', ''StressValue'') | |||
'''.SetUseStress_2'''(''StressValues()'') | |||
'''VB.NET''' | |||
'''.SetUseStress'''(''Index'', ''StressValue'') | |||
'''.SetUseStress'''(''StressValues()'') | |||
===Parameters=== | |||
''Index'' | |||
:Required. Integer. The 0-based index of the stress for which the use stress level will be updated. | |||
''StressValue'' | |||
:Required. Double. The value to use for the use stress level. | |||
''StressValues()'' | |||
:Required. Double. An array of new use stress values that correspond to the array of stresses in the model (e.g., the first stress value will become the use stress level for the first stress). | |||
== | == Example == | ||
{{APIComment|'Declare a new repository connection object. See [[Repository Class|Repository]].}} | {{APIComment|'Declare a new repository connection object. See [[Repository Class|Repository]].}} | ||
Dim MyRepository As New Repository | Dim MyRepository As New Repository |
Revision as of 00:00, 2 October 2015
Member of: SynthesisAPI9.cModel
For ALTA models only. Sets the use stress level for one or multiple stresses of a cModel object.
This method does not apply to published models, which are model resources that have been published from and are associated with an existing analysis/data source.
Syntax
VBA .SetUseStress(Index, StressValue) .SetUseStress_2(StressValues())
VB.NET .SetUseStress(Index, StressValue) .SetUseStress(StressValues())
Parameters
Index
- Required. Integer. The 0-based index of the stress for which the use stress level will be updated.
StressValue
- Required. Double. The value to use for the use stress level.
StressValues()
- Required. Double. An array of new use stress values that correspond to the array of stresses in the model (e.g., the first stress value will become the use stress level for the first stress).
Example
'Declare a new repository connection object. See Repository. Dim MyRepository As New Repository 'Connect to the Synthesis repository. Dim Success As Boolean = False Success = MyRepository.ConnectToRepository("RepositoryFileNamePath") 'Get the list of projects in the connected repository. Dim ListOfModels() As NameIdPair ListOfModels = MyRepository.GetAllModelsInfo() 'Select the ID of the model and retrieve it. In this example, the first model is used. Dim AModel as cModel AModel = MyRepository.GetModel(ListOfModels(0).ID) 'Get the number of stresses in the model. Dim MyNumStresses As Integer MyNumStresses = AModel.NumStresses 'Create an array and specify the use stress values for each of the stresses. 'Assume the MyNumStresses in this example is 2. Dim UseStressArray(MyNumStresses - 1) As Double UseStressArray(0) = 500 UseStressArray(1) = 750 'Set the UseStress for the model. AModel.SetUseStress(UseStressArray)