grread confusion

Discussion in 'AutoCAD' started by coachball8, May 19, 2004.

  1. coachball8

    coachball8 Guest

    Could someone help me understand how to do this, please? I want to select a starting point, then follow the mouse with a target cursor while executing a command. The help file is very vague to me. (setq code_12 (grread (setq code (grread)))) gives me the cursor location, but how do I change to the selection (target) cursor and follow it from there? TIA
     
    coachball8, May 19, 2004
    #1
  2. coachball8

    BillZ Guest

    I'm no expert on grread but this might help.

    ;5/19/04 Bill Zondlo
    ;program to get input
    ;and show drag.
    ;
    ;---------------;
    (defun fig_pts ()
    (setq ct (cadr pt3)
    inc 0
    ang (angle pt1 (cadr pt3))
    d1 (distance pt1 ct)
    sl (cons pt1 sl)
    sl (cons (polar pt1 ang d1) sl) ;center to point line.
    sl (cons 256 sl) ;add color to draw line list.
    sh sl
    )
    )
    ;---------------;
    (defun c:show_drag (/ )
    (initget 1)
    (setq pt1 (getpoint "\nSelect Base Point:") ;select
    dif 0
    )
    ;---------------;
    (while (/= (car (setq pt3 (grread 'T 1 2))) 3)
    (setq dif (1+ dif)
    )
    (cond ((= dif 1)
    (fig_pts)
    (grvecs sl)
    (setq lst nil
    sl nil)
    )
    ((= dif 2)
    (grvecs sh)
    (setq lss nil
    sh nil
    dif 0)
    )
    )
    (princ "\n ")(princ pt3)
    ) ;end while
    ;---;
    (grvecs sh)
    (princ "\n ")(princ pt3)(princ)
    ) ;end defun

    Bill
     
    BillZ, May 19, 2004
    #2
  3. coachball8

    coachball8 Guest

    That's exactly what I was looking for.....a good example. Thanks very much, Bill.
     
    coachball8, May 19, 2004
    #3
  4. coachball8

    BillZ Guest

    You're welcome.

    Bill
     
    BillZ, May 19, 2004
    #4
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.