463x
001352
2020-04-27

[ZH] 常见问题解答 004409 | 如何通过 COM 接口创建截面?

问题:
如何通过 COM 接口创建截面?

答案:
原则上,截面是一个单元,例如杆件,并且可以通过相同的方式创建。 首先,需要对象的接口。 对于杆件,这将是 IModelData,对于截面,这将是 ISections。 该接口可以在 IModel3 中找到:

子测试部分()
' 从打开的模型中获取接口并锁定许可证/程序
    Dim iModel As RFEM5.IModel3
    Set iModel = GetObject(, "RFEM5.Model")
    iModel.GetApplication.LockLicense

出错时转到 E

    Dim iSecs As RFEM5.ISsection
    设置 iSecs = iModel.GetSections()

首先删除之前创建的所有截面,然后创建两个新的截面。 
第一部分应该是具有可见截面面积的实体截面(见图 01)。 输入方法与 RFEM 类似。 选择类型为“SectionOnSectionalArea”,截面的角点通过使用“边缘点”设置,并使用“向量”定义截面的方向:

   ' 首先删除所有部分
    iSecs.PrepareModification
    iSecs.DeleteObjects(“全部”)
    iSecs.FinishModification

    ' 在实体上设置截面
    Dim sec As RFEM5.Section
    sec.EdgePointA.X = 2
    sec.EdgePointA.Y = 5
    sec.EdgePointA.Z = 0
    sec.EdgePointB.X = 2
    sec.EdgePointB.Y = 8
    sec.EdgePointB.Z = 0

    sec.no = 1
    sec.Name = "实体截面"
    sec.Plane = GlobalPlaneInPositiveX
    sec.ShowValuesInIsolines = False
    sec.Type = SectionOnSolidSectionLine
    sec.ObjectList = "1"

    iSecs.PrepareModification
    iSecs.SetSection 秒
    iSecs.FinishModification

正如从其他单元中已知的那样,新的截面最终被传递到 Prepare-/FinishModification 块中。 创建面的截面作为第二个截面(见图 02)。 为此必须使用类型“SectionViaSurfacePlane”。 除了截面方向的矢量外,还必须选择面截面结果的显示平面。 在下面的示例中,xy 平面是通过设置 "GlobalPlaneInPositiveX" 来选择的。

' 在面上设置截面
    sec.EdgePointA.X = 2
    sec.EdgePointA.Y = 0
    sec.EdgePointA.Z = 0
    sec.EdgePointB.X = 2
    sec.EdgePointB.Y = 3
    sec.EdgePointB.Z = 0

    sec.no = 2
    sec.Name = "面的截面"
    sec.Plane = GlobalPlaneInPositiveX

    sec.ShowValuesInIsolines = True
    sec.Type = SectionViaSurfacePlane
    sec.ObjectList = "1"

    sec.Vector.X = 0
    sec.Vector.Y = 0
    sec.Vector.Z = 1

    iSecs.PrepareModification
    iSecs.SetSection 秒
    iSecs.FinishModification

也可以通过使用接口 "IResults2" 的单独方法 "GetResultsInSection" 来获取截面的结果。 接下来计算作用在面上的剪力。 通过“ContinuousDistributionWithinObjects”将内力的分布设置为“面内连续”:

 ' 得到结果
    Dim iCalc As ICalculation2
    设置 iCalc = iModel.GetCalculation

    将 iRes 调暗为 IResults2
    设置 iRes = iCalc.GetResultsInFeNodes(LoadCaseType, 1)

    Dim secRes() As RFEM5.SectionResult
    secRes = iRes.GetResultsInSection(2, AtNo,
      剪切力Vy、对象内连续分布、假)

在下载下,您可以找到 Excel 宏和测试文件,以帮助您理解程序。