如何处理这些未知/奇怪的变量类型?

2024-10-03 02:35:46 发布

您现在位置:Python中文网/ 问答频道 /正文

Abaqus FEM软件使用Python创建自己的变量/列表类型,例如:

a = mdb.models['Model-1'].rootAssembly.instances['Instance-1'].faces
print a
type(a)

['Face object', 'Face object', 'Face object', ...]

type 'FaceArray'

^{pr2}$

({'featureName': 'Name-1', 'index': 6, 'instanceName': 'Name-1', 'isReferenceRep': False, 'pointOn': ((0.0, 0.733333, -0.133333),)})

type 'Face'

当我现在初始化x=[]并用x.append(a[2])添加一个Face object'时,结果是

[mdb.models['Model-1'].rootAssembly.instances['Instance-1'].faces[2]]

而不是

^{4磅}$

如何创建与a格式相同的新变量?在


Tags: instancesinstancename列表model软件objectmodels