Object Drag

Discussion in 'AutoCAD' started by hulioman, Jul 1, 2004.

  1. hulioman

    hulioman Guest

    Is there a way to drag in lisp without using the move or copy commands?
    Example:
    I want the user to select for a selection set. Then, I want to show that object moving as the user moves the cursor. I would like to do this without initiating any commands. (like move or copy) The effect would be just like the drag effect of the commands move and copy.
     
    hulioman, Jul 1, 2004
    #1
  2. hulioman

    BillZ Guest

    Here is a copy of a reply I saved a while back:

    ;There have been several discussions on dragging/ghosting within a LISP/ARX
    ;routine without using the command. The following has been brought to my
    ;attention by Frank Whaley (Thanks Frank).
    ;It may benefit those who already have the Express Tools. With Frank's permission,
    ;I quote:

    ;The Express Tools team encountered similar problems(referring to dragging)
    ;so we developed three functions that use
    ;underlying ObjectARX utilities:

    (arxload "acetutil")

    ;; example: (acet-ss-drag-move (ssget) (getpoint "\nBasepoint: "))

    (defun highlight_selection_drag (which / )
    (cond ((= which 1)
    (acet-ss-drag-move (ssget)(getpoint "\nBasepoint: ") "\nSelect next point: < pick > " 1 0)
    )
    ((= which 2)
    (acet-ss-drag-rotate (ssget)(getpoint "\nBasepoint: ") "\nSelect next point: < pick > " 1 0)
    )
    ((= which 3)
    (acet-ss-drag-scale (ssget)(getpoint "\nBasepoint: ") "\nSelect next point: < pick > " 1 0)
    )
    )
    )

    ;Arguments:
    ;ss
    ;The selection set to drag.

    ;pt
    ;The base point.

    ;prompt
    ;If supplied, a message to display before dragging is started.

    ;highlight
    ;If supplied, causes a rubber-band line to be drawn from <pt> to the current
    ;cursor position while dragging; this parameter can be NIL to draw a rubber-band
    ;line in the inverse of the screen color, or non-NIL to draw a highlighted line.

    ;cursor
    ;If supplied, the cursor form to display while dragging (0=crosshairs, 1=no
    ;cursor, 2=target).

    ;Return values:
    ;move:
    ;Normally returns the selected point, but will honor '(initget)' settings and can
    ;return arbitrary text or keywords. Returns NIL if the dragging operation is
    ;aborted.

    ;rotate:
    ;The selected rotation value (radians), or NIL if dragging is aborted.

    ;scale:
    ;The selected scale factor, or NIL if dragging is aborted.


    Bill
     
    BillZ, Jul 1, 2004
    #2
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.