cModel.SetUseStress

From ReliaWiki
Revision as of 00:00, 2 October 2015 by Kate Racaza (talk | contribs)
Jump to navigation Jump to search

Template:InProgress

APIWiki.png


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)