React on direction

Discussion in 'AutoCAD' started by Marcel Janmaat, Sep 21, 2004.

  1. Is it posible to let lisp react on direction. What i mean is;

    If I use (getpoint pnt "\nDirection: ") I want to send text to the
    commandline before giving the actual point. When just moving the crosshair
    perpendicular or in the same direction to a certain line from witch i have
    the coordinates.

    Is this posible?

    Regards MJ
     
    Marcel Janmaat, Sep 21, 2004
    #1
  2. If I understand what you're trying to do correctly: yes. You can use
    (entget (car (entsel))) to select the line and get its association list,
    then set the SNAPBASE to one end, (assoc 10) or (assoc 11), and rotate the
    snap angle to the other end. Then turn ortho on.

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Sep 21, 2004
    #2
  3. Here's an excerpt from my door-insertion routine that does this in a
    different way, using Nearest Osnap to find two points on the line, rather
    than dxf codes 10 and 11 to find the endpoints. One of those two points is
    then the base-point for the rubber-band line that appears for the last
    prompt.
    ....
    (setq wallline (entsel "HINGEPOINT ON WALL: ")) \+
    (setq hinge (osnap (cadr wallline) "NEA")) +
    (setq rot (angle hinge (osnap (getpoint +
    "DIRECTION TO OTHER SIDE OF DOOR: ") "NEA"))) \+
    SNAP R !hinge !rot ORTHO ON +
    (setq dir (getangle hinge "OPENING DIRECTION: ")) \
    ....

    [Earlier in the routine it saves the current Snap basepoint and rotation,
    and the Ortho state, and it restores those later.]

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Sep 21, 2004
    #3
  4. Thanx for your input but this is not what i mean..

    What i mean is when using (getpoint pnt "\nDirection: ") there is a "line"
    between the crosshairs and the given pnt. I want to send remarks to the
    command line at the time i'm moving the crosshairs in the same or
    perpendicular direction (ortho has to be on) of the line I earlier selected
    in the routine and from wich i obtained the coordinates using entsel.

    I was thinking more of the grread command but am not completely sure on how
    to use it. If I am correct it has to be possible to send streaming input
    like coordinates to a variable en use it to determain the direction in
    opposite of this line.

    Regards MJ

     
    Marcel Janmaat, Sep 21, 2004
    #4
  5. Does the coordinates section of the status line at the bottom show what you
    want? Experiment with the F6 button and/or the COORDS command to have it
    display streaming relative or absolute coordinates.

    I poked around with grread, but couldn't quite figure it out either,
    couldn't get anything to rubber-band in connection with it, and don't see
    any way to have it feed streaming content to the Command line, but that
    coordinates display does "stream" as you move the cursor around (or can,
    with COORDS set right). Then you can easily save the coordinates at the
    time you pick a point, using getpoint, which you can rubber-band from a
    previously saved point, and its rubber band obeys Ortho.

    Or, if what you want to establish is just the opposite direction, you can
    use getangle to save an angle instead of a point, and add pi radians to it.
    Getangle also rubber-bands and obeys ortho.

    In any case, I don't think it would be possible to "send streaming input
    like coordinates to a variable." The variable has to store something fixed,
    like a point or an angle, so "streaming" doesn't mean anything except as
    displayed along the way, until you pick somewhere to fix a value to store in
    the variable.

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Sep 21, 2004
    #5
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.