Author Topic: setq another point  (Read 4788 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
setq another point
« on: November 07, 2003, 02:36:19 PM »
i have two lines (in 3d space) that fillet together with a radius of "0"and im trying to extract out the intersecting point  without having to use the (inters) command (trying to setq that magical point without having to pick on the lines 2 different times.) that (setq lp  (getvar "lastpoint")) was pretty slick maybe a twist on this will get me where i need to be?
cya

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
setq another point
« Reply #1 on: November 07, 2003, 02:44:10 PM »
Are you creating the two lines? Or selecting them as part of your program? Or..............someting else.
TheSwamp.org  (serving the CAD community since 2003)

Craig

  • Guest
setq another point
« Reply #2 on: November 07, 2003, 02:46:55 PM »
Are you going to select each line? If you actually touch each line why not get the (10 8.32499 6.36463 0.0) (11 20.0262 10.8276 0.0) out of the list of each line and compare the two X & Y's, this can get you your intersection. I hope I'm understanding you correctly

CADaver

  • Guest
setq another point
« Reply #3 on: November 07, 2003, 02:48:06 PM »
Try this it's "real" old.  Wrote it long before APPINT was a possible osnap.  It can be streamlined considerably, but you can read this and see how the points are extracted from the lines.

Code: [Select]

(defun ip (/ line1 line2 list1 list2 pt1 pt2 pt3 pt4)
    (setq line1 (entsel "\nSelect first line: ")
 line2 (entsel "\nSelect second line: ")
 list1 (entget (car line1))
 list2 (entget (car line2))
 pt1   (cdr (assoc 10 list1))
 pt2   (cdr (assoc 11 list1))
 pt3   (cdr (assoc 10 list2))
 pt4   (cdr (assoc 11 list2))
    )
    (inters pt1 pt2 pt3 pt4 nil)
)

rude dog

  • Guest
setq another point
« Reply #4 on: November 07, 2003, 10:41:03 PM »
Sorry took me so long to get back to you all...caddaver (pretty original name) came up with a helpful solution, i believe (havent got to try it yet wanted to write back first)my routine prompts the user to pick two (points) on existing lines (that dont necessarily have to be  tanget with each other...but are perpendicular) fillets the two lines together with a radius of "0" and i was trying to get that intersecting point with the two previous points picked, without having to write alot of extra code (that im not that good @ yet!)just basically trying to run lean and mean....no what i mean?