AUTOCAD SPECIFY LOCATION OF A POINT RELATIVE TO AN EXISTING LINE

868 Views Asked by At

enter image description here I have a line (3d) with defined chainage (km relative to a reference location). There are a list of fixed objects around the line, wherein the X-Y-Z coordinates of the objects are given. The line and the objects have the same origin and same coordinate system. I need to extract the location of the objects relative to the line, that is, the relative chainage and the distance to the line. Anyone knows how to extract the list of relative locations for those objects?

ps. I showed an example of a line and some objects around it. The objects are plot out based on their coordinates. Now I need to find the km-info of these points relative to the line and the distance to the line (in practice the line can containe lots of curves, just imaging it's the centre line of a road).

Thanks in advance!

1

There are 1 best solutions below

3
On

I don't have ready solution but algorithm would be:

  1. select those objects, in LISP You may use (ssget )
  2. get the basepoint for each of object center of circle for example: (setq center(vlax-get-property Object 'Center)).
  3. Project center point to curve - axis (setq projection(vlax-curve-getClosestPointTo axis center )).
  4. Read length of curve from it's begining to projection: ( setq dist ( vlax-curve-getDistAtPoint axis projection ) ).
  5. Recalculate distance based on fixed distance of line.