User login


You are here

Abaqus/Python - commands to find nearest node to a given point

Leon Mishnaevsky's picture

I need to write a python comman code to find a node (in a given set), nearest to a given point.
The code now looks as follows:
import sys
import nearestNodeModule
a = mdb.models['FibreModel'].rootAssembly
n1 = a.instances['Fibre0-1'].nodes
pickedSelectedNodes = n1[0:599]
g=nearestNodeModule.findNearestNode(xcoord=101, ycoord=106, zcoord=58, name='', selectedNodes=pickedSelectedNodes, instanceName="'Fibre2-1'")

And I get an error:
File "SMAPyaModules\SMAPyaPluginsPy.m\src\abaqus_plugin s\findNearestNode\", line 71, in findNearestNode
AttributeError: 'NoneType' object has no attribute 'instances'

Does anyone know what is wrong there?



Frank Richter's picture

The question was also adressed on

I attach a script with instruction from an old Abaqus site.




Find Nearest Node Plug-in




NOTE: This plug-in has undergone testing and is expected to work with the version of Abaqus that it is shipped with.  However, the level of testing is not as stringent as that for the Abaqus products in general.  Limited support will be available from Dassault Systemes, for this plug-in, and it may not be available with future Abaqus releases.








This plug-in locates the node in a model database (MDB) or output database (ODB) that is nearest to a specified coordinate point.  The plug-in works with meshed models (in an MDB) and undeformed plots (in an ODB); the plug-in does not work with deformed plots in an ODB. 




For large models, you can specify the area of the model to search by selecting a subset of nodes from the viewport.








To install the plug-in, unzip and save the contents of the attached archive to one of the following directories:


  • abaqus_dir\cae\abaqus_plugins, where abaqus_dir is the ABAQUS parent directory
  • home_dir\abaqus_plugins, where home_dir is your home directory
  • current_dir\abaqus_plugins, where current_dir is the current directory




After installing the plug-in, start Abaqus/CAE and enter any assembly-related module or the Visualization module.  Find Nearest Node is available in the Plug-ins menu on the main menu bar (Plug-insàAbaqusàFind Nearest Node).








Enter the X, Y, and Z coordinates for the starting point.  Click Find to highlight in the viewport the node nearest to the specified starting coordinates.  Click the Select Nodes for Reduced Search button and select nodes in the viewport to limit your search to a particular area of the model.







When searching in reduced mode, only nodes on one instance can be selected.


from abaqusGui import *
import _abqPluginUtils, os
thisPath = os.path.abspath(__file__)
thisDir = os.path.dirname(thisPath)

# Use package syntax to avoid possible name clashes with other plugins
from abq_FindNearestNode.nearestNodeForm import NearestNodeForm

# Register commands
version = '2.1-1'
status = _abqPluginUtils.checkCompatibility('Find Nearest Node', version)
if status == 'OK':
        buttonText='Abaqus|Find Nearest Node...',
        kernelInitString='import abq_FindNearestNode.nearestNodeModule',
        applicableModules=["Assembly","Step","Interaction","Load","Mesh","Job", "Visualization"],
        author='Dassault Systemes',
        description='This plug-in finds the nearest node to a given point.',
        helpUrl=os.path.join(thisDir, 'abq_FindNearestNode', 'NearestNode_help.html'),

Subscribe to Comments for "Abaqus/Python - commands to find nearest node to a given point"

Recent comments

More comments


Subscribe to Syndicate