Find closest point ID via tcl command

Madlen
Madlen Altair Community Member
edited October 2020 in Community Q&A

Hello,

 

Does anybody know function for finding the closest point ID to another point (using tcl command)? Or probably to find the point ID using its coordinates?

I find only command 'hm_findclosestpointonsurface', but it gives only coordinates as an output when I need ID of this point.

 

From Altair HyperWorks Help for scripts:

Syntax

hm_findclosestpointonsurface x y z surf_id

Description

For a given point on a surface, returns the closest other point on that same surface:

xs ys zs dist

 

Thank you in advance!

 

Tagged:

Answers

  • PrasannaK
    PrasannaK
    Altair Employee
    edited July 2020

    Hi Madlen,

     

    Try the following:

    set n_point 4859
    set lst_points '4864 4848 4847 4846 4845 4844 4843 4842 4841 4840 4839 4838 4837 4836 4835 4834 4833 4831 4830 4829 4828 4827 4826 4812 4811 4810 4796 4794 4793 4760'
     
    *createmark points 1 $n_point
    eval *createmark points 2 $lst_points 
    set n_closestPoint [lindex [hm_measureshortestdistance points 1 0 points 2 0 0] 8]

     

    Thank You!