如何使用Abaqus中的Python脚本在同一实例中的矩形板的两个边缘中定义两个参考点?

问题描述 投票:1回答:1

我想在程序集中的同一个实例的两个边缘中定义两个引用点,以便我可以使用它们在模型中稍后定义约束。我的代码看起来像这样:

myAssembly.ReferencePoint(point=(0.0,50.0,0.0))
r1=myAssembly.referencePoints
refpoints1=(r1[3],)
myAssembly.Set(referencePoints=refpoints1, name='RF-Displacement')

myAssembly.ReferencePoint(point=(10.0,50.0,0.0))
r2=myAssembly.referencePoints
refpoints2=(r2[3],)
myAssembly.Set(referencePoints=refpoints2, name='RF-Fix')

创建参考点和集合,但两个集合都指向第一个参考点。如何创建两个参考点并将每个参考点选为另一个参考点?

我想我在访问第二个参考点时犯了一个错误。如果有人能指出我的错误,会很高兴。

python scripting modeling abaqus finite-element-analysis
1个回答
1
投票

当你创建点时抓住它的索引如下:

 pointid=myAssembly.ReferencePoint(point=(0.0,50.0,0.0)).id

然后像这样引用它:

 myAssembly.Set(referencePoints=
    (myAssembly.referencePoints[pointid],),
      name='RF-Displacement')

像你一样硬编码索引永远不是一个好主意。

© www.soinside.com 2019 - 2024. All rights reserved.