我想在组件中同一实例的两条边上定义两个参照点,以便稍后在模型中使用它们来定义约束。我的代码如下所示:
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')参考点和集合被创建,但这两个集合都指向第一个参考点。如何创建两个参考点并选择每个参考点作为不同的集合?
我想我在访问第二个参考点时犯了一个错误。如果有人能指出我的错误我会很高兴的。
发布于 2017-12-21 02:33:06
在创建点时,如下所示获取它的索引:
pointid=myAssembly.ReferencePoint(point=(0.0,50.0,0.0)).id然后像这样引用它:
myAssembly.Set(referencePoints=
(myAssembly.referencePoints[pointid],),
name='RF-Displacement')像你这样硬编码索引从来都不是个好主意。
https://stackoverflow.com/questions/47895497
复制相似问题