Minimum distance between grid points and multiple objects

Minimum distance between grid points and multiple objects

Anonymous
Not applicable
1,336 Views
4 Replies
Message 1 of 5

Minimum distance between grid points and multiple objects

Anonymous
Not applicable

How can we get minimum distance from a selected source object to multiple destination objects in a drawing? I have 40000 grid points and 1500 lines. Need to find minimum distance of every grid point with every line. 

0 Likes
1,337 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

Give us more information.  Are the 40000 grid points in a regular rectangular grid?  Are they Point entities, or Blocks, or just locations, or something else?  What is the "minimum distance of [a] grid point with [a] line"?  Is it the distance from either endpoint  of the Line to the nearest grid point [A below]?  Or the distance from the nearest grid point to the closest point  on the Line [B], if that's not an endpoint?  Etc., etc.  A [smaller-quantity] image or sample drawing would help.

 

PointLine.PNG

 

Kent Cooper, AIA
0 Likes
Message 3 of 5

stevor
Collaborator
Collaborator

You could use the '  Project Point onto Line'  -  Lee Mac,

lee-mac.com/mathematicalfunctions.html,

if you intended to use the 'LINE' data; or use

'vLax-curve-getCLosestPointTo for a bit less code

and more speed.

 

 

S
0 Likes
Message 4 of 5

Anonymous
Not applicable

The grid points are in a rectangular grid. I have to find the minimum distance between grid point and every line.

0 Likes
Message 5 of 5

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

The grid points are in a rectangular grid. I have to find the minimum distance between grid point and every line.


I repeat the remainder of my questions after the first, and add some more:

 

The grid of points in the image is in a limited area.  Do you want to know the distance [whatever that means] from Lines that are outside  that area to those grid points shown, or to what would be the nearest grid point in an extension of that grid, or should Lines outside that area be ignored?

 

By "line," do you mean Line entities, or does a series of end-to-end connected ones constitute one "line" [probably really a Polyline?] and you need to know only one minimum distance from anywhere on it to the nearest grid point?

 

That's a lot of "lines" [whether individual Lines or Polylines}.  What would be the desired format of the information?  Text in the drawing?  If so, at  each Line, or in a Table or block of Mtext, or...?  An external file of some kind?  List the entity name of a Line plus the distance to the nearest grid point, plus maybe the coordinates of that grid point?  Etc., etc.

Kent Cooper, AIA
0 Likes