Getpoint & Appintersection - can these work together

Discussion in 'AutoCAD' started by glt, Sep 21, 2004.

  1. glt

    glt Guest

    I am working on a distance command and would like to get an apparent intersection instead of intersection. Setting the osmode to Appint (2048) it will only allow to pick once instead of two lines and finding the intersection between the two. Can anyone help or does getpoint not acknowledge Appint.
    Here is the code i am using at this time.

    (defun C:di ();int to int
    (initget 7)
    (setvar "osmode" 2048)
    (setq p1 (getpoint "\nFirst point: "))
    (setvar "osmode" 2048)
    (setq p2 (getpoint "Second point: " p1))
    (setvar "osmode" 0)
    (setq l1 (distance p1 p2))

    From this point it calculates distance, angle and other information.
    glt
     
    glt, Sep 21, 2004
    #1
  2. glt

    T.Willey Guest

    (defun c:di (/ ent1 ent2 intpt);int to int

    (setq ent1 (entsel "\n Select first line: "))
    (setq ent2 (entsel "\n Select second line: "))
    (if (and ent1 ent2)
    (progn
    (setq ent1 (entget (car ent1))
    ent2 (entget (car ent2))
    intpt (inters (cdr (assoc 10 ent1)) (cdr (assoc 11 ent1)) (cdr (assoc 10 ent2)) (cdr (assoc 11 ent2)) nil)
    ); setq
    ); progn
    ); if
    intpt
    )

    Hope this helps
    Tim
     
    T.Willey, Sep 21, 2004
    #2
  3. glt

    C Witt Guest

    osmode = 32

    you can get what you are after my just using the "int" snap.. (when it
    does not find an actual intersection it switches to the apparent
    intersection mode)

    HTH
     
    C Witt, Sep 21, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.