418x
004199
2019-11-08

Question

How can I create an imperfection via the COM interface?


Answer:

An imperfection is considered as a load and is transferred via the interface of the load case. Provided that the interface to the model has already been imported, the interface to the loads (ILoads) followed by the interface to Load Case 1 (ILoadCase) will subsequently be imported, if it has already been created:

        '   set loadcases
        Dim iLoads As iLoads
        Set iLoads = model.GetLoads
        
        '   get load case
        Dim iLc1 As ILoadCase
        Set iLc1 = iLoads.GetLoadCase(1, AtNo)
        
        '   define imperfection
        Dim imperf As Imperfection
        imperf.Comment = "test"
        imperf.Direction = LocalZType
        imperf.Inclination = 200
        imperf.no = 1
        imperf.ObjectList = 1
        imperf.Precamber = 300
        imperf.PrecamberActivity = ActivityAccording_EN_1993_1_1
        
        '   set imperfection
        iLc1.PrepareModification
        iLc1.SetImperfection imperf
        iLc1.FinishModification

The data of the imperfection are then filled out first, here for Member 1, then transferred within the Prepare-/FinishModification block of the Interfaces load case.