Passing objects to other LISP files

Discussion in 'AutoCAD' started by JRWalker, May 6, 2004.

  1. JRWalker

    JRWalker Guest

    Hi,
    I am trying to write my well used routines into a single fas file and then
    load it and make calls to it when I need those routines. So far so good, I
    have put quite a few in there and they work nice. Then I came across a
    couple of routines that would not work and I wanted to see if it was a VLISP
    object limitation. The 1st routine was trying to pass a VLISP block object,
    a tag name, and a attribute value to a routine that would change the value
    of the attribute. When I have the routine in the originating lsp file, no
    problem. But if I try to call the routine from the loaded fas file, it will
    error on this procedure. The 2nd routine is one that gives 3 different point
    ARGS and then stretches a crossing window (1st 2 points) and then picks a
    start point (3rd point) and then pause for the user to pick a final point..
    Same deal. Works okay in the original lsp file, but not when called from the
    fas file. Here are the snippets:

    (defun SetBlockAttValue (BLKENT TAG VAL / ATTLIST ITEM)
    (setq ATTLIST
    (vlax-safearray->list (variant-value (vla-getAttributes BLKENT))
    )
    )
    (foreach ITEM ATTLIST
    (if (= (vla-get-tagString ITEM) TAG)
    (vla-put-textstring ITEM VAL)
    ) ;if
    ) ;foreach
    )


    (defun StretchWindowPause (PT0 PT1 PT2 / )
    (vl-cmdf "_.STRETCH" "C" PT0 PT1 "" PT2 PAUSE) ;wait for user to pick pt
    (getvar "LASTPOINT") ;point from last pick
    )

    Thanks for any help.
    JRWalker
     
    JRWalker, May 6, 2004
    #1
  2. JRWalker

    JRWalker Guest

    Oh, I thought I might add in case you were wondering that I include the
    (vl-load-com) at the beginning of the files so I don't include it in each
    routine.

    JRWalker
     
    JRWalker, May 6, 2004
    #2
  3. JRWalker

    Walker Guest

    Anyone?
     
    Walker, May 14, 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.