CAL function in 2004

Discussion in 'AutoCAD' started by John Georgiev, May 18, 2004.

  1. Few days ago I posted the following code in another discussion:

    (defun C:cen3 (/)
    (setq P1 (getpoint "\nFirst Point: "))
    (setq P2 (getpoint "\nSecond Point: "))
    (setq P3 (getpoint "\nThird Point: "))
    (cal "(p1+p2+p3)/3")
    (princ)
    )

    I knew that the guys from Autodesk did include this command in ACAD2004 (in
    2000 it was separate geomcal.arx from the Express suite and had to be loaded
    before use). My mistake was that I didn't try my code (which I did long time
    ago under ACAD2000) before posting, assuming that since CAL is available, it
    will do the trick. Now I'm finding out that CAL starts from the command line
    just fine, but it doesn't from the lisp. The guy whom I send the code got
    the error:

    error: no function definition: CAL

    However once CAL runs for first time from the command line, you are OK for
    that CAD session (even the lisp will work).
    Similar (but not the same) problem I had with the command NEW before - it
    could not start from lisp or menu file. Finally I did something else to work
    around.
    Why is this? What is the difference between these commands and the ones
    which behave normally?
     
    John Georgiev, May 18, 2004
    #1
  2. On another thread (about erasing all insertions of a given block), the
    person found the same problem with the Express Tool "ssx" -- a lisp routine
    that used it didn't work if he ran it first thing in a drawing, but if he
    typed in ssx at the Command: prompt first, the lisp would work after that.
    I assume that's the same problem.

    Kent Cooper, AIA

    ...
    .....
    .....
     
    Kent Cooper, AIA, May 18, 2004
    #2
  3. John Georgiev

    devitg Guest

    if you need to use CAL , add this code on the lisp program

    (if (= cal nil)
    (arxload "geomcal")
    )

    It check for cal , and load if not loaded.
     
    devitg, May 18, 2004
    #3
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.