<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to measure distance from one fixed point to many others individually? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13174800#M5816</link>
    <description>&lt;P&gt;I have attached a diagram to help with explaining. I have one fixed point (Red X) and potentially hundreds of other points that each need a distance measured to (Blue X). I know I can do it individually, but is there a way to speed this up by perhaps selecting all the points in one go and highlighting X as the one I need a distance from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked for an addon or lsp but cannot seem to find what i'm looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 13:58:30 GMT</pubDate>
    <dc:creator>Callum_Roberts64LCV</dc:creator>
    <dc:date>2024-11-26T13:58:30Z</dc:date>
    <item>
      <title>How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13174800#M5816</link>
      <description>&lt;P&gt;I have attached a diagram to help with explaining. I have one fixed point (Red X) and potentially hundreds of other points that each need a distance measured to (Blue X). I know I can do it individually, but is there a way to speed this up by perhaps selecting all the points in one go and highlighting X as the one I need a distance from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked for an addon or lsp but cannot seem to find what i'm looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 13:58:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13174800#M5816</guid>
      <dc:creator>Callum_Roberts64LCV</dc:creator>
      <dc:date>2024-11-26T13:58:30Z</dc:date>
    </item>
    <item>
      <title>Betreff: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13174895#M5817</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;returns the 3D-distance between point objects and a point of your choice.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:MIST (/ n ss) ; (c:MIST)
    (if (and (setq n -1 p1 (getpoint "\nBASEpoint: ")) (setq ss (ssget '((0 . "POINT")))))
	(repeat (sslength ss)
	   (princ(rtos (distance p1 (cdr(assoc 10 (entget(ssname ss (setq n (1+ n))))))) 2))
	)
    )
 (princ)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Nov 2024 14:30:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13174895#M5817</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2024-11-26T14:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13175084#M5818</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16519603"&gt;@Callum_Roberts64LCV&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... is there a way to speed this up by perhaps selecting all the points in one go and highlighting X as the one I need a distance from. ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In what form do you want the results?&amp;nbsp; A reporting to the command line for each [as in the routine from &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;]?&amp;nbsp; or Dimensions drawn from the common base Point to each other Point?&amp;nbsp; or output to some kind of file?&amp;nbsp; or something else drawn in the drawing, such as a Table or Mtext?&amp;nbsp; or ...?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 15:38:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13175084#M5818</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-11-26T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13175993#M5819</link>
      <description>&lt;P&gt;Like &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;would you want bearing and distance, points numbered and so on, a table of results,&lt;/P&gt;&lt;P&gt;point1 - 180deg 23.45 - point23,and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to confirm so anyone does not waste time guessing.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 23:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13175993#M5819</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-11-26T23:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177578#M5820</link>
      <description>&lt;P&gt;Hi all, Thanks for the replies &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;. Just to clarify this is 2D CAD. The trouble is that these points (Blue X) do not have specific ID Numbers so if you outputted all the distances I wouldn't be able to match them to their respective points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A desired output that would work would be:&lt;BR /&gt;Polylines drawn from the centre of the fixed point (Red X) to the centre of the other points (Blue X's). So if I could select the fixed point, press enter, then select all of the other points, then enter. It would then draw individual polylines and look something like the attached image. I could then select each polyline and write down the distance. This would be much quicker and much less messy to manually draw.&lt;/P&gt;&lt;P&gt;What do you think could this be done? Thanks a lot for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 14:28:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177578#M5820</guid>
      <dc:creator>Callum_Roberts64LCV</dc:creator>
      <dc:date>2024-11-27T14:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177651#M5821</link>
      <description>&lt;P&gt;Well, that's possible, but there is still plenty of manual work left up to the user...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you post a DWG sample and also explain where/how you write down the value in Excel or another program? how do you pair the points with distances? Some screenshots or videocapture might be helpful to better understand the work you do.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 14:54:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177651#M5821</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-11-27T14:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177841#M5822</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16519603"&gt;@Callum_Roberts64LCV&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... A desired output that would work would be:&lt;BR /&gt;Polylines drawn from the centre of the fixed point (Red X) to the centre of the other points (Blue X's). ...&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I see no reason they should be Polylines, which in this situation would only take more memory than Lines, for no benefit.&lt;/P&gt;
&lt;P&gt;And I suggest having the length of each Point from the base Point &lt;EM&gt;written in Text right there&lt;/EM&gt;.&amp;nbsp; If that's desirable, you might consider eliminating the drawing of Lines, unless you want them anyway to indicated which was the selected base Point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:DTMP ; = Distances To Multiple Points
  (/ baseobj basedata pts base n pt target)
  (if
    (and
      (setq baseobj (car (entsel "\nBase Point object to measure from: ")))
      (member '(0 . "POINT") (setq basedata (entget baseobj)))
      (not (prompt "\nFor Point objects to measure to,"))
      (setq pts (ssget '((0 . "POINT"))))
    ); and
    (progn ; then
      (ssdel baseobj pts); in case base was selected along with others
      (setq base (cdr (assoc 10 basedata)))
      (repeat (setq n (sslength pts))
        (setq
          pt (ssname pts (setq n (1- n)))
          target (cdr (assoc 10 (entget pt)))
        ); setq
        (command
          "_.line" "_non" base "_non" target ""
          "_.text" "_mc" "_non" target "" 0 ; current height, zero rotation
            (rtos (distance base target)); in current mode &amp;amp; precision settings
        ); command
      ); repeat
    ); progn
    (prompt "\nSelected base not a Point, or no other Point(s) selected."); else
  ); if
  (prin1)
); defun&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That uses whatever the current Text Style and height are, and assumes the Style does &lt;EM&gt;not&lt;/EM&gt; have a fixed height, and draws everything on the current Layer.&amp;nbsp; Variants to those assumptions are easily accommodated, and a Style and height and Layer(s) and format for the distance Text, can all be built in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can include the base Point in the selection of other Points to make it easier -- it will be ignored in the "reporting."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Text will show &lt;EM&gt;3D distances&lt;/EM&gt; if there are different Z coordinates involved, not the plan-view XY distances.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 16:07:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177841#M5822</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-11-27T16:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177874#M5823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am drawing up Yardage Markers for golf irrigation, so players know how far they are away from the hole at a glance. Which involves finding the distance to the Front, Centre &amp;amp; Back of the putting green from each sprinkler on that hole. As you can imagine, that's roughly 60 sprinklers per hole * 3 * 18 holes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will quickly run through what I would usually have to do. Draw a polyline from the Front of the green to every sprinkler for that hole. Repeat for the Centre &amp;amp; Back. I would then click on every polyline and record the distance in an excel spreadsheet. Each sprinkler has its own code, but that isn't recorded in CAD, just on the spreadsheet. The sprinklers in my drawing are just blocks, and have nothing to identify them individually. The spreadsheet converts the entered distanced from Meters into Yards. I would then have to create a text box in CAD for each sprinkler with the Front Distance, Centre Distance &amp;amp; Back Distance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached 3 images of what it looks like without any pipework for clarity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 16:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177874#M5823</guid>
      <dc:creator>Callum_Roberts64LCV</dc:creator>
      <dc:date>2024-11-27T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177915#M5824</link>
      <description>I have just tested this out. This works with points. However the data that is used comes in blocks as it is survey data. Can it be modified to pick the Centrepoint of the blocks when selected? Thanks</description>
      <pubDate>Wed, 27 Nov 2024 16:30:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13177915#M5824</guid>
      <dc:creator>Callum_Roberts64LCV</dc:creator>
      <dc:date>2024-11-27T16:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13178192#M5825</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16519603"&gt;@Callum_Roberts64LCV&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a routine that could work if you put a little more prep work into the elements/layering in your drawing.&lt;/P&gt;&lt;P&gt;This uses layers of items to identify what/where they are, measures to appropriate locations on greens, then automatically labels blocks. Run this routine in my attached drawing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:GOLF ( / LayerList deuce h holes holeCnt sprCnt ssSpr ssFront ssCenter ssBack eFront eCenter eBack ptFront ptCenter ptBack eSpr ptSpr)
  (defun LayerList ( / lyr lyrList)
    (while (setq lyr (tblnext "LAYER" (null lyr)))
      (setq lyrList (cons (cdr (assoc 2 lyr)) lyrList))
    );while
  );defun
  (foreach lay (LayerList)
    (if (or (setq deuce (wcmatch (strcase lay) "HOLE-##-*")) (wcmatch (strcase lay) "HOLE-#-*"))
      (progn
        (setq h (substr lay 6 (if deuce 2 1)))
        (if (not (member h holes))
          (setq holes (cons h holes))
        );if
      );progn
    );if
  );foreach
  (prompt (strcat "\n" (itoa (length holes)) " HOLES FOUND."))
  (setq holeCnt 0 sprCnt 0)
  (foreach hole holes
    (setq holeCnt (1+ holeCnt))
    (if (setq ssSpr (ssget "_A" (list (cons 0 "INSERT") (cons 2 "SPRINKLER-*") (cons 8 (strcat "HOLE-" hole "-SPRINKLER")))))
      (progn
        (prompt (strcat "\nMeasuring " (itoa (sslength ssSpr)) " sprinklers for hole " hole "... "))
        (setq ptFront nil ptCenter nil ptBack nil)
        (and (setq ssFront (ssget "_A" (list (cons 0 "POINT") (cons 8 (strcat "HOLE-" hole "-FRONT")))))
             (setq eFront (ssname ssFront 0))
             (setq ptFront (cdr (assoc 10 (entget eFront)))))
        (and (setq ssCenter (ssget "_A" (list (cons 0 "POINT") (cons 8 (strcat "HOLE-" hole "-CENTER")))))
             (setq eCenter (ssname ssCenter 0))
             (setq ptCenter (cdr (assoc 10 (entget eCenter)))))
        (and (setq ssBack (ssget "_A" (list (cons 0 "POINT") (cons 8 (strcat "HOLE-" hole "-BACK")))))
             (setq eBack (ssname ssBack 0))
             (setq ptBack (cdr (assoc 10 (entget eBack)))))
        (repeat (setq cnt (sslength ssSpr))
          (setq eSpr (ssname ssSpr (setq cnt (1- cnt))))
          (setq ptSpr (cdr (assoc 10 (entget eSpr))))
          (if ptFront (setpropertyvalue eSpr "FRONT" (rtos (distance ptSpr ptFront) 2 2)))
          (if ptCenter (setpropertyvalue eSpr "CENTER" (rtos (distance ptSpr ptCenter) 2 2)))
          (if ptBack (setpropertyvalue eSpr "BACK" (rtos (distance ptSpr ptBack) 2 2)))
          (setq sprCnt (1+ sprCnt))
        );repeat
        (prompt "Complete")
      );progn
    );if
  );foreach
  (alert
    (princ
      (strcat
        "\nGOLF COMPLETE"
        "\n"
        "\nReviewed " (itoa holeCnt) " holes, measuring " (itoa sprCnt) " sprinklers."
      );strcat
    );princ
  );alert
  (princ)
);defun&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...Starts with empty blocks:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1439471iC21AC2B2ED0C60FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...Finishes with populated info in blocks:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1439472i7A464C5C918B464B/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 18:00:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13178192#M5825</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2024-11-27T18:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to measure distance from one fixed point to many others individually?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13178201#M5826</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/16519603"&gt;@Callum_Roberts64LCV&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have just tested this out. This works with points. However the data that is used comes in blocks as it is survey data. Can it be modified to pick the Centrepoint of the blocks when selected? Thanks&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the center point is the insertion point, just replace "POINT" with "INSERT" in two places.&amp;nbsp; The 10-code entry is the location of a Point object &lt;EM&gt;and&lt;/EM&gt; the insertion point of a Block.&amp;nbsp; [And, if you like, replace "Point object" with "Block."]&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2024 18:46:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-measure-distance-from-one-fixed-point-to-many-others/m-p/13178201#M5826</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-11-27T18:46:55Z</dc:date>
    </item>
  </channel>
</rss>

