Changing a real number result to an integer.

Discussion in 'AutoCAD' started by cthorne, Mar 15, 2005.

  1. cthorne

    cthorne Guest

    I am very much in the early stages of learning Lisp programming so this may seem rather basic to some people.

    This is the lisp I have written:

    (DEFUN C:arr ( / a b ss )
    (setq a(getdist "\nClick the two walls "))
    (setq b (/ a 103))
    (PRINC "select object to array\n")
    (SETQ SS (SSGET))
    (COMMAND "array" SS "" "r" b "1" "103" "")
    (PRINC)
    )

    I am trying to make the number of rows in an array change according to the distance between two lines (walls). The distance between the rows is always 103.
    The lisp below doesn't work because the resulting number for 'b' is a real number, I need to know how I can return an integer, as CAD will only allow integers to be inputted for rows.

    I told you it was basic, any help will be appreciated.

    Thanks
     
    cthorne, Mar 15, 2005
    #1
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.