Creating multiple points on a line

Creating multiple points on a line

halilerkurt
Contributor Contributor
335 Views
4 Replies
Message 1 of 5

Creating multiple points on a line

halilerkurt
Contributor
Contributor

Hello, I want to create points at different intervals on a line. I will manually determine the point distances from the beginning of the line. And I want a 5 cm line to be drawn from these points to the Y axis. Is there a method for this?

0 Likes
Accepted solutions (1)
336 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

That could be done pretty easily without any routine, by drawing that 5cm Line at the beginning of the path Line [even if you don't need one there in the end], with a Point object at its end if that's the intent, and using a MULTIPLE COPY command, with the base point at the beginning of the path, and with the cursor "aimed" in the right direction with Ortho mode on, give it your manually determined distances.

Kent Cooper, AIA
0 Likes
Message 3 of 5

Sea-Haven
Mentor
Mentor
Accepted solution

I use a pick near end to work out direction of plines and lines.

 

Try this

; Points on a line pline
; By AlanH Sep 2024

(defun c:wow ( / oldsnap ent pt obj start end len d1 d2 dist2 dist)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 0)

(setq ent (entsel "\nPick p/line near end "))
(setq pt (cadr ent))
(setq obj (vlax-ename->vla-object (car ent)))
(setq start (vlax-curve-getstartPoint obj))
(setq end (vlax-curve-getEndPoint obj))
(setq d1 (distance pt end))
(setq d2 (distance pt start))
(setq len (vlax-get obj 'length))

(setvar 'pdmode 34)

(while (setq dist (getreal "\nEnter distance Enter to exit "))
(if (< dist len)
 (progn
  (if (< d1 d2)
   (setq dist2 (- len dist))
   (setq dist2 dist)
  )
  (setq pt (vlax-curve-getpointatdist obj dist2))
  (command "line" pt (polar pt (/ pi 2) 5.0) "")
 )
 (alert "Exceeds length of line ")
)
)

(setvar 'osmode oldsnap)
(princ)
)
(c:wow)

 

0 Likes
Message 4 of 5

halilerkurt
Contributor
Contributor
Thank you
0 Likes
Message 5 of 5

halilerkurt
Contributor
Contributor

thank you

0 Likes