a guestion about "getpoint"

Discussion in 'AutoCAD' started by homhsu, Sep 17, 2003.

  1. homhsu

    homhsu Guest

    (getpoint "input a point : ")

    if user input an int such as 222, CAD will return a point such as
    (199.698 -96.9774 0.0) .

    Why this happens?
    How to prevent this kind of error?

    thanks homling pen
     
    homhsu, Sep 17, 2003
    #1
  2. This is not an error. The point returned (in your example) would be 222
    units in the direction the crosshairs were from the last point entered.
    There might be an easier way but here is my first thought to prevent this.

    ;;;Ken Alexander
    ;;;Allows only point to be
    ;;;picked on screen
    ;;;Usage:
    ;;;(get_only_pnt "Get first point: ")

    (defun get_only_pnt (txt / a)
    (while (= 'str
    (type
    (progn
    (initget 135)
    (setq a (getpoint txt))
    )
    )
    )
    )
    a
    )

    Ken Alexander
     
    Ken Alexander, Sep 17, 2003
    #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.