Filtering Relevant Members
The aim is to transfer only the members of a certain cross‑section to the RF‑/STEEL EC3 design. In the following example, all members with the IPE 300 cross‑section should be filtered. For this, it is necessary to get all cross-sections from the main program first:
' Create a string of a desired cross‑sectioncrsc_desc = "IPE 300"
' Get all cross-sections from RFEMDim crscs() As RFEM5.CrossSectioncrscs = iModelData.GetCrossSections
' Loop over all cross-sectionsDim crsc_no As Longcrsc_no = -1Dim iAs LongFor i = 0 To UBound(crscs, 1) ' If the cross-section description is right, save the cross-section number If InStr(LCase(crscs(i).Description), LCase(crsc_desc)) > 0 Then crsc_no = crscs(i).No Exit For End IfNext i
' Quit the program if the desired cross-section was not foundIf crsc_no = -1 Then Err.Raise 513, "Get cross-section number", "No cross-section with "" " & crsc_desc & " "" within its description found!"End If
The cross-section description should be synchronized as generally as possible. For this, the cross‑section description as well as the string to be searched is set to lower‑case letters via "LCase" first, then the string is searched for in the cross‑section description. If no suitable cross-section is found, the cross-section number remains at -1, which can then be requested and acknowledged by an abort.
After this step, the cross‑section number is known and the members with this cross‑section number can be searched. Only the member with this cross‑section at the member start and end should be adopted:
' Create string for the list of members and set it to zeroDim mems_str As Stringmems_str = vbanullstr
' Get all members from RFEMDim mems() As RFEM5.Membermems = iModelData.GetMembers
' Loop over all membersFor i = 0 To UBound(mems, 1) ' If a member has this cross-section number at the start and the end, ' then take this number in the string If mems(i).EndCrossSectionNo = crsc_no Then If mems(i).EndCrossSectionNo = mems(i).StartCrossSectionNo Then mems_str = mems_str & mems(i).No & "," End If End IfNext i
' Quit the program if no member was foundIf mems_str = vbanullstr Then Err.Raise 514, "Get members", "No member with cross-section "" " & crsc_desc & " "" found!"End If
Getting Add-on Module Interface
The link to a module is exactly the same as the link to RFEM or RSTAB. The only difference is that there is no difference between opening an already open instance or opening a new instance, since there is always one already open instance:
' Get interface for the moduleDim iStec3 As STEEL_EC3.ModuleSet iStec3 = iModel.GetModule("STEEL_EC3")
Next, all existing module cases are removed:
' Get number of existing module casesDim count As Longcount = iStec3.moGetCaseCount
' If there are any cases, always delete the first one in the tableIf count > 0 Then For i = 0 To count - 1 iStec3.moDeleteCase i, AT_INDEX Next iEnd If
Now, you can create the desired case can be created and enter the member to be designed by using the previously created string.
' Create the 'Optimization' module caseDim iStec3Case As STEEL_EC3.ICaseSet iStec3Case = iStec3.moSetCase(1, "Optimization")
' Set members for designiStec3Case.moSetMemberList mems_str
Last, but not least, you can enter the desired load combinations:
' Set load combinationsDim iStec3_uls_loads(0 To 2) As STEEL_EC3.ULS_LOAD
iStec3_uls_loads(0).DesignSituation = DS_FUNDAMENTALiStec3_uls_loads(0).No = 1iStec3_uls_loads(0).Type = ILOAD_GROUP
iStec3_uls_loads(1).DesignSituation = DS_FUNDAMENTALiStec3_uls_loads(1).No = 2iStec3_uls_loads(1).Type = ILOAD_GROUP
iStec3_uls_loads(2).DesignSituation = DS_FUNDAMENTALiStec3_uls_loads(2).No = 3iStec3_uls_loads(2).Type = ILOAD_GROUP
iStec3Case.moSetULSLoads iStec3_uls_loads
Summary and Outlook
The procedures described in this article can be used for all modules that can be controlled by COM. The source code and the Excel file help so that you can better understand the subject matter. In my next article, I would like to go deeper on this matter and explain the link between the elements in the module and in the main program.