Lisp Problem

I wonder if anyone could help - I have a number of small routines which place text at a user defined point, then let you fine-place it using the line:
(COMMAND "MOVE" "l" "" P1 (GETPOINT))
It used to drag the text just as in the command Move, that was the point - you could see it move.

In the last few releases of V10 it no longer drags the text, just plonks it at the "to" point.

Is this yet another action the lisp police have let me get away with for years and now apply a no tolerance policy?

Comments

  • John: Does this work for you?

    (COMMAND "_MOVE" "_L" "" P1 PAUSE)
    (WHILE (> (GETVAR "CMDACTIVE") 0)
    (COMMAND PAUSE)
    )
  • Good one! Thanks Greg, that works like a charm. I still wonder why my original no longer works though.

  • Dear John,
    I also tried your sample code ... and naturally, your original code
    (COMMAND "MOVE" "l" "" P1 (GETPOINT))
    can not show the drag symbol ...

    But as Greg pointed, using
    (COMMAND "_MOVE" "_L" "" P1 PAUSE)
    is fine - even without the (while) loop following, as _MOVE only
    requests 1 further input, that target point.

    It is not changed Lisp philosophy at all ... instead, Bricscad APIs are
    all forced to be Acad compatible as much as possible, to allow using
    application code created for Acad under Bricscad.

    If your sample was ever working, including the dragging graphics,
    then it is a clear difference to Acad, which surely will break something.

    Just to explain ... you can trust us not to change anything simply by an
    idea - but only to better match Acad behaviour.

    Many greetings, Torsten

  • Here's a function we use. A curious aspect of the MOVE (and COPY) command is that unless you specify a target, the X and Y coordinates of the object are used as Offset values. Of course, you could use (INITGET 1) and force selection of a target, but often the initial location is just fine and a simple Enter would be an appropriate response - except it sends the object into outer space only to mysteriously show up when you do a Zoom Extents.

    This function lets you either accept the initial location or MOVE the object as often as required to fine-tune its final location. Tested in BCAD V10 and works.

     

    (defun f:_mmove ( ent / ename elist ptst p1 dis)
    (setq ename ent elist (entget ename) p1 (cdr (assoc 10 elist)) ptst p1)
    (while p1
    (command "_MOVE" ename "" "drag" p1 pause)
    (setq ptst (getvar "lastpoint"))
    (setq elist (entget ename) p1 (cdr (assoc 10 elist)) dis (distance p1 ptst))
    (if (> dis 0.0)(progn
    (command "_MOVE" ename "" p1 ptst)
    (setq p1 nil)
    ))
    )
    )
    ;
  • A clarification: If you work in 3D, either or both point values evaluated by the Distance function could have Z coordinate values which could yield a misleading result. Our code actually uses a function that adjusts both points to zero Z- coordinate for the Distance evaluation.

  • Thank you all for helpful comments. A working fix is more than I had hoped for.

    Apparently all that was really needed was to replace (getpoint) with pause.

    I get the Acad compatability, it's just that when something which has worked literally for years (and possibly in Acad before 1998) suddenly doesn't, I'm not sure if that is the reason.

    A better book might help, the one I have doesn't even include Pause. But books often don't include small twists such as this.

  • Larry:

    nice lisp.

    What's the significance of the "f:XXX" syntax?

     

    I use something simple that uses the pickpoint as the initial point,

    and allows the user to continously pick objects to move, copy, rotate or scale:

    (defun c:mmove ( / &t)
               (while (setq &t (entsel))
               (command "move" (car &t) "" (cadr &t) pause)
    ))

    (defun c:mcopy ( / &t)
               (while (setq &t (entsel))
               (command "copy" (car &t) "" (cadr &t) pause)
    ))

    (defun c:mrotate ( / &t)
               (while (setq &t (entsel))
               (command "rotate" (car &t) "" (cadr &t) pause)
    ))
    (defun c:mscale ( / &t)
               (while (setq &t (entsel))
               (command "scale" (car &t) "" (cadr &t) pause)
    ))

    I have them mapped to alt-m,alt-k, alt-r and alt-s.

  • Hmmm.... guess I wasn't really thinking with the WHILE loop... oops!

  • Yaacov

    The function is part of a large 'standard' functions file and is used in many routines to help in the placement of symbols, tags, call-outs, etc. In my industry, the insertion points of symbols are extremely useful in proper placement of the item.

    You can check out our application at www.amate-online.com

    We are in the final stages of porting this 20+ year old ACAD application to BCAD. We've solved all of the LISP differences, but DCL is another matter. We'll probably end up with two sets of DCL files, one for ACAD and one for BCAD.

  • Dear Larry,
    thanks for your posts !
    As you might imagine, it is indeed not intended that developers are enforced to
    use 2 sets of DCL files ... in theory, but of course, we are also aware of several
    layout differences, which could result in different files, unfortunately.
    (I also support several developers which are faced with same situation)

    So please be ensured, this is not our intention ... in case you think that some of
    those layout issues should be fixed, please send us a little sample to illustrate the
    difference ... our DCL expert Tijs is very active to solve those differences, whenever
    possible ...

    Maybe, this will still not be enough for you to get back to unified DCL set ... but it could
    help others, and/or reduce differences at least.
    Only to encourage you :-)

    Many greetings

This discussion has been closed.