Author Topic: bisect does not bisect  (Read 6041 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: bisect does not bisect
« Reply #15 on: November 21, 2005, 08:20:15 AM »
Oh, UCS too, good one sdoman.

Code: [Select]
(defun c:bisect (/ line1 line2 vp p1 p2)
  (vl-load-com)
  (while (null (setq line1 (entsel "\nSelect first Line : "))))
  (while (null (setq line2 (entsel "\nSelect second line : "))))

  (setq vp (getpoint "\nPick the vertex of the two lines."))

  (if (and line1 line2 vp)
    (progn
      (setq p1 (trans (vlax-curve-getclosestpointto (car line1) (trans (cadr line1) 1 0) t) 0 1)
            p2 (trans (vlax-curve-getclosestpointto (car line2) (trans (cadr line2) 1 0) t) 0 1)
      )
      (vl-cmdf "_xline" "_non" "b" vp "_non" p1 "_non" p2 "")
    )
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sdoman

  • Guest
Re: bisect does not bisect
« Reply #16 on: November 21, 2005, 08:27:27 AM »
Hey Cab,

Check out what happens when you pick a line and arc.  You can get to two possible intersections.  Not that a user would want to draw a bisecting Xline between them.  But the code bombs unless you account for that somehow.

Steve
« Last Edit: November 21, 2005, 08:32:52 AM by sdoman »

Sdoman

  • Guest
Re: bisect does not bisect
« Reply #17 on: November 21, 2005, 08:29:39 AM »
Oh, I forgot you are not using intersectwith.  Not sure why.  I assumed the OP wanted to eliminate one pick point.