擅长:python、mysql、java
<p>不管标题是什么,我假设你想要的是最终的坐标,而不是位移。正如Daniel F所提到的,您应该添加COORDS作为字段输出。在这种情况下,下面的代码应该很有用。在</p>
<pre><code>def findCoordSet(OdbName,StepName,InstanceName,SetName):
"""
This ODB reading script does the following:
-Retrieves coordinates at SetName
"""
Coordinates={'x':[],'y':[]}
# Open the output database.
odbName = OdbName + '.odb'
odb = visualization.openOdb(odbName)
lastFrame = odb.steps[StepName].frames[-1]
coordset = odb.rootAssembly.instances[InstanceName.upper()].nodeSets[SetName.upper()]
# Retrieve Y-displacements at the splines/connectors
dispField = lastFrame.fieldOutputs['COORD']
dFieldpTip = dispField.getSubset(region=coordset)
for i in range(len(dFieldpTip.values)):
Coordinates['x'].append(dFieldpTip.values[i].data[0])
Coordinates['y'].append(dFieldpTip.values[i].data[1])
odb.close()
return Coordinates
</code></pre>