FAQ 004563 | How can I create member eccentricities in RF‑COM?

Easily learn how to work with the Dlubal Software programs

  • Dlubal Software | Videos

Video

First Steps with RFEM

First steps

We provide hints and tips to help you get started with the basic program RFEM.

Please accept Marketing Cookies to watch this video.

Question

How can I create member eccentricities in RF‑COM?

Answer

The following VBA macro shows the creation of two member eccentricities. The source code can be found under Downloads.

'--------------------------------------------------------------------------------------------------
Sub SetEccs()
'--------------------------------------------------------------------------------------------------
Dim model As RFEM5.model
Dim data As IModelData
Dim ecc(1) As RFEM5.MemberEccentricity

    'Get interface for model
    Set model = GetObject(, "RFEM5.Model")
    
    ' Block COM licence and program access
    model.GetApplication.LockLicense

    On Error GoTo e
    ' Get interface for model data
    Set data = model.GetModelData

   'Define eccentricity 1
    ecc(0).No = 1
    ecc(0).ReferenceSystem = LocalSystemType
    ecc(0).Start.X = 0.01
    ecc(0).Start.Y = 0.02
    ecc(0).Start.Z = 0.03
    ecc(0).End.X = -0.01
    ecc(0).End.Y = -0.02
    ecc(0).End.Z = -0.03
    ecc(0).Comment = "eccentricity 1"
    
   'Define eccentricity 2
    ecc(1).No = 2
    ecc(1).ReferenceSystem = GlobalSystemType
    ecc(1).Start.X = -0.07
    ecc(1).Start.Y = -0.08
    ecc(1).Start.Z = -0.09
    ecc(1).End.X = 0.07
    ecc(1).End.Y = 0.08
    ecc(1).End.Z = 0.09
    ecc(1).Comment = "eccentricity 2"
    
    'Transfer member eccentricities
    data.PrepareModification
    data.SetMemberEccentricities ecc

e:  data.FinishModification
    If Err.Number <> 0 Then MsgBox Err.Description, , Err.Source
    Set data = Nothing
    ' COM licence is unlocked, program access possible again
    model.GetApplication.UnlockLicense
    Set model = Nothing

End Sub

Keywords

Dlubal FAQ Member eccentricity Excel VBA Frequently Asked Question FAQ about Dlubal Question and Answer about Dlubal

Links

Write Comment...

Write Comment...

  • Views 120x
  • Updated 02/18/2021

Contact us

Do you have any questions about our products or need advice on selecting the products needed for your projects?
Contact us via our free e-mail, chat, or forum support or find various suggested solutions and useful tips on our FAQ page.

(267) 702-2815

info-us@dlubal.com