329x
003569
2022-08-26

FAQ 005304 | How can I create a nodal support with the "Partial Activity" nonlinearity...

Question:
How can I create a nodal support with the "Partial Activity" nonlinearity via the COM interface?

Answer:
The following VBA macro shows the creation of a nodal support with the "Partial Activity" nonlinearity. The source code can be found under Downloads.

Option Explicit

'---------------------------------------------------------------------
Sub SetNSupports()
'---------------------------------------------------------------------
Dim model As RFEM5.model
Dim data As IModelData
Dim support(0) As RFEM5.NodalSupport
Dim ISup As RFEM5.INodalSupport
Dim ISupPA As RFEM5.IPartialActivity
Dim nlPA As PartialActivity

  1. Set model = GetObject(, "RFEM5.Model")
  2. model.GetApplication.LockLicense
  1. On Error GoTo e
  1. Set data = model.GetModelData
  1. support(0).No = 1
  2. support(0).NodeList = "1"
  3. support(0).SupportConstantX = -1
  4. support(0).SupportNonlinearityX = PartialActivityNLType
  5. support(0).SupportConstantY = -1
  6. support(0).SupportConstantZ = -1
  7. support(0).RestraintConstantX = -1
  8. support(0).RestraintConstantY = -1
  9. support(0).RestraintConstantZ = -1
  1. data.PrepareModification
  2. data.SetNodalSupports support
  3. data.FinishModification
  1. Set ISup = data.GetNodalSupport(1, AtNo)
  2. Set ISupPA = ISup.GetNonlinearity(AlongAxisX)
  1. nlPA.PositiveZone = CompleteActivityType
  2. nlPA.PositiveSlippage = 0.005
  3. nlPA.NegativeZone = FailureActivityType
  1. data.PrepareModification
  2. ISupPA.SetData nlPA
  3. data.FinishModification

e: If Err.Number 0 Then MsgBox Err.Description, , Err.Source

  1. Set data = Nothing
  2. model.GetApplication.UnlockLicense
  3. Set model = Nothing

End Sub



;