Extract node set coordinates in abaqus using python script

Started by Wahid, April 02, 2021, 04:41:04 PM

Previous topic - Next topic

Wahid

Hello,
I would like to extract the Node set coordinates using a python script. i tried with this method using an odb file :

import sys
from odbAccess import *
from abaqus import *
from abaqusConstants import *
import __main__

odb = openOdb('C:/Temp/Job-1.odb')
set = odb.rootAssembly.instances['part-1'].nodeSets['Set-1']

numNodes = len(set.nodes)
partlabel=[];
partxcord=[];
partycord=[];
partzcord=[];
for curNode in a.nodes:
    partlabel.append(curNode.label)
    partxcord.append(curNode.coordinates[0])
    partycord.append(curNode.coordinates[1])
    partzcord.append(curNode.coordinates[2])

The error displayed is : keyerror : Set-1.
knowing that when I defined the same syntax for the coordinates of the instance nodes, it works correctly.

myInstance = odb.rootAssembly.instances['part-1']

Mark Barkey

make sure that the node set is being written to the ODB
check the name of the set and name of the part

otherwise, I don't know what the issue could be from that information.

Thanks,
MEB

Wahid

Thank you for te reply Mr. Barkey.

I found the solution, the name of the set must be noted in upper case ['SET-1']. knowing that in the model abaqus CAE, it is defined like that ['Set-1']

Thanks
Wahid