zoom screws up tis basic lisp routine

Discussion in 'AutoCAD' started by kemp, Apr 9, 2004.

  1. kemp

    kemp Guest

    Why will this only work when you are zoomed in closely? If you are zoomed
    out and use this command it will draw a line from p1 to p2 instead of p3 to
    p4 like I want it to!

    (defun C:blocking ( / p1 p2 p3 p4 gap ang )
    (store)
    (command "-LAYER" "m" "blocking" "")
    (setq gap 2)
    (setq p1 (getpoint "\n Pick first point:"))
    (setq p2 (getpoint p1 "\n Pick second point:"))
    (setq ang (angle p1 p2))
    (setq p3 (polar p1 ang gap)
    p4 (polar p2 (+ ang (dtr 180)) gap)
    )
    (command "LINE" p3 p4 "")
    (restore)
    (*error* nil)
    (princ)
    )

    Thanks for your help in retaining my sanity!
     
    kemp, Apr 9, 2004
    #1
  2. kemp

    Jeff Mishler Guest

    Or eliminate any chance of osnaps, orthomode, snap, etc. affecting the
    outcome:
    (entmake (list '(0 . "LINE")(cons 10 p3)(cons 11 p4)))
     
    Jeff Mishler, Apr 9, 2004
    #2
  3. you don't seem to be doing anything with osmode - which I think is where
    your problem lies - and to which Ruul is providing a clue on how to proceed.

    Other people save the osmode variable, set it to 0, and then reset it upon
    exiting the routine.

    --


    Jamie Duncan

    Consulting - If you're not part of the solution, there's good money in
    prolonging the problem.
     
    Jamie Duncan \(remove lock to reply\), Apr 9, 2004
    #3
  4. kemp

    kemp Guest

    Thanks - This works perfectly, but can anyone explain the reason why this
    was happening? What about the osnaps is the cause of this weird behavior?

    kemp
     
    kemp, Apr 9, 2004
    #4
  5. kemp

    Jeff Mishler Guest

    Well, if the points you are selecting are close to an entity and the
    object snaps are enabled then they will be honored.....just as if you
    were drawing the line manually. Same goes for orthomode and snaps. This
    is why I don't use the command call to draw entities unless I know there
    is NO chance of snap, ortho, or osnap influencing the result, which is
    not very often, if ever.

    Jeff
     
    Jeff Mishler, Apr 9, 2004
    #5
  6. kemp

    kemp Guest

    Ah, this makes sense. Thanks for clearing it up for me.

    kemp

     
    kemp, Apr 9, 2004
    #6
  7. kemp

    Rudy Tovar Guest

    Next time use 'entmake' or activex.


     
    Rudy Tovar, Apr 9, 2004
    #7
  8. kemp

    Jamie Duncan Guest

    entmake a hatch can be tricky, or so I've heard



    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 9, 2004
    #8
  9. kemp

    Rudy Tovar Guest

    You must have been talking to wrong individuals...

    What makes it dificult is the associativity, everything else is a piece of
    cake.

    "The hardest thing in the world to understand is the income tax."
    Albert Einstein.
     
    Rudy Tovar, Apr 9, 2004
    #9
  10. kemp

    Jamie Duncan Guest

    say I have a circle and a line that crosses it - and I want one side of the
    semicircle solid hatch - how would you go about it using entmakeity?

    And yes, associative is not necessary.


    --
    Jamie Duncan

    "How wrong it is for a woman to expect the man to build the world she wants,
    rather than to create it herself."
    - Anais Nin (1903-1977)
     
    Jamie Duncan, Apr 10, 2004
    #10
  11. Crap, taxes....almost forgot.

    --
    Ken Alexander
    Acad2004
    Windows XP

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Apr 12, 2004
    #11
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.