Selecting features NEAR a location with python
Selecting features NEAR a location with python
(OP)
Hi,
I am writing parametric studies for some abaqus designs via python. Most of this has went pretty smoothly but I have reached a frustrating problem for selecting edges (from python) for a particular structure as the geometry changes. I typically use the findAt() commands and write basic algebra equations so the features are continuously selected as the geometry changes, but now the points I need to determine are slightly inexact. Is there a command where I specify points NEAR to the desired feature I wish to select rather than the EXACT location?
In other words, errors emerge in selecting the feature with findAt because the points are off by about 1E-6 (very small for the system I'm working with) as the geometry changes after a certain amount. Rather than rewriting my model so it has this inaccuracy corrected, I would rather find a python command or algorithm that just selects points within a 1E-6 to 1E-5 range of the desired feature. Is there a command for this?? If not, do any of you guys have an idea on an algorithm I could write to achieve this?
Thanks!
I am writing parametric studies for some abaqus designs via python. Most of this has went pretty smoothly but I have reached a frustrating problem for selecting edges (from python) for a particular structure as the geometry changes. I typically use the findAt() commands and write basic algebra equations so the features are continuously selected as the geometry changes, but now the points I need to determine are slightly inexact. Is there a command where I specify points NEAR to the desired feature I wish to select rather than the EXACT location?
In other words, errors emerge in selecting the feature with findAt because the points are off by about 1E-6 (very small for the system I'm working with) as the geometry changes after a certain amount. Rather than rewriting my model so it has this inaccuracy corrected, I would rather find a python command or algorithm that just selects points within a 1E-6 to 1E-5 range of the desired feature. Is there a command for this?? If not, do any of you guys have an idea on an algorithm I could write to achieve this?
Thanks!





RE: Selecting features NEAR a location with python
Sill Struggle and this seems like a problem other people have probably ran into before.
thanks
RE: Selecting features NEAR a location with python
maybe this?
RE: Selecting features NEAR a location with python
p = point
q = array of points
d = asarray(q)-asarray(p)
d = asarray(sqrt(sum(d*d,-1)))
d.argmin() or d[d<1e-5] for the closest point or the points within the tolerance