Command call for lisp

Discussion in 'AutoCAD' started by cadman_meg, Jul 14, 2003.

  1. cadman_meg

    cadman_meg Guest

    I can't seem to figure out what the command is for calling this routine. Can someone look at it and let me know please. TIA.

    (defun EastNorthToXY (p / AeccApp AeccDocs AeccDoc AeccUtil)
       (if (not *acad*)(setq *acad* (vlax-get-acad-object)))
       (if
          (and
             (setq AeccApp (vl-catch-all-apply 'vla-getinterfaceobject (list *acad* "aecc.application")))
             (not (vl-catch-all-error-p AeccApp))
             (setq AeccDocs (vl-catch-all-apply 'vlax-get (list AeccApp "Documents")))
             (not (vl-catch-all-error-p AeccDocs))
             (setq AeccDoc (vla-item AeccDocs 0))
             (setq AeccUtil (vl-catch-all-apply 'vlax-get (list AeccDoc "Utility")))
             (not (vl-catch-all-error-p AeccUtil))
             (vlax-method-applicable-p AeccUtil "EastNorthToXy")
          )
          (vlax-invoke AeccUtil "EastNorthToXy" p)
       )
    )
     
    cadman_meg, Jul 14, 2003
    #1
  2. cadman_meg

    Paul Turvill Guest

    (eastnorthtoxy p1)
    .... where p1 is the point to be processed.
    ___

    Can someone look at it and let me know please. TIA.
     
    Paul Turvill, Jul 14, 2003
    #2
  3. cadman_meg

    Mark Godfrey Guest

    What I mean is, most lisp have a command defined. Such as "defun C: xyz".
    This I can not figure becaue that is not in the code and I don't see how
    else to call upon the commands for the functions within the lisp. Is that
    much clearer to hopefully get some help? Thanks.
     
    Mark Godfrey, Jul 15, 2003
    #3
  4. cadman_meg

    Mark Godfrey Guest

    Anyone know thr answer to this one? Would be greatly appreciated. Thanks.
     
    Mark Godfrey, Jul 15, 2003
    #4
  5. cadman_meg

    Paul Turvill Guest

    What I posted *IS* the answer. You call a non-"C:" function by placing the
    function, plus any required parameters within a set of parentheses, just
    like any other LISP function. So, to call the function EastNorthToXY, with
    its required parameter, the correct syntax is

    (eastnorthtoxy p1) ... where p1 is the required parameter -- in this case a
    point.

    That's the only answer possible. If you need more information, I'd suggest
    perhaps the Customization Guide section of the HELP system might be of
    interest.
    ___
     
    Paul Turvill, Jul 16, 2003
    #5
  6. cadman_meg

    Dan Allen Guest

    Revise the defun to have a c:xyz, remove the parameter 'p', and add a (setq
    p (getpoint)) or other means of assigning the point. Not knowing the purpose
    of the function more than (vlax-invoke AeccUtil "EastNorthToXy" p) makes
    things difficult.

     
    Dan Allen, Jul 16, 2003
    #6
  7. cadman_meg

    Mark Godfrey Guest

    That makes more sense Dan. Guess some folks assume that everyone knows
    exactly the same stuff. That is why I reitterated the question. Not that
    Paul's answer would be suitable to the die hard programmer. Thanks all.
    Think I will scrap this though because it doesn't even seem like it would be
    of much use without a hassle. And besides, LDD has a function to do this
    already.
     
    Mark Godfrey, Jul 17, 2003
    #7
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.