""" - script to create a path based on a node set and a set with the start node - the distance of each node to the start node is calculated and used to define the path - sets need to be defined on part level - make sure the two setnames and instancename in this script fit to the names in the simulation - open odb in abaqus cae and run script - to check afterwards see Tools > Path > Manager or the Paths container in the results tree """ # to be defined by user in preprocessing set_nodes = 'set-path' # set with the edge where the path should be set_startnode = 'set-start' # set with point of that edge to indicate start of path instancename = 'block-1' pathname = 'Path-x' # name of the path that is created by this script ## from abaqus import * from abaqusConstants import * from caeModules import * from math import * dict_nodes ={} list_nodes = [] set_nodes = set_nodes.upper() set_startnode = set_startnode.upper() instancename = instancename.upper() vps = session.viewports.values()[0] odbName = vps.displayedObject.name odb = session.odbs[odbName] coord_point = odb.rootAssembly.instances[instancename].nodeSets[set_startnode].nodes[0].coordinates for node in odb.rootAssembly.instances[instancename].nodeSets[set_nodes].nodes: dist = sqrt((pow(node.coordinates[0]-coord_point[0],2))+ \ (pow(node.coordinates[1]-coord_point[1],2))+ \ (pow(node.coordinates[2]-coord_point[2],2))) dict_nodes[dist] = node.label x = dict_nodes.keys() x.sort() for y in x: list_nodes.append(dict_nodes[y]) list_nodes = tuple(list_nodes) session.Path(name=pathname, type=NODE_LIST, expression=((instancename, ( list_nodes)), )) print '\nPath was created'