safearray conversion...

Discussion in 'AutoCAD' started by Devin, Aug 9, 2004.

  1. Devin

    Devin Guest

    Does anybody remember a routine we worked on a while back that traversed
    into a safearray's depth and converted it into a list?

    Thanks,

    Devin
     
    Devin, Aug 9, 2004
    #1
  2. Devin

    Jeff Mishler Guest

    "DEPTH"?
    (vlax-safearray->list var) is this what you are after?
     
    Jeff Mishler, Aug 9, 2004
    #2
  3. Devin

    Devin Guest

    Hi Jeff,

    Doesn't that function stop at the top level of the array? I thought it
    wouldn't traverse into the lists within the list.
     
    Devin, Aug 9, 2004
    #3
  4. (defun lisp-value (v)
    ;; Copyright 2002 Vladimir Nesterovsky.
    ;; Free for use by any commercial entity with
    ;; less then $100 million annual revenue.
    (cond
    ((= (type v) 'variant)
    (lisp-value (variant-value v)))
    ((= (type v) 'safearray)
    (mapcar 'lisp-value (safearray-value v)))
    (T v)
    )
    )
     
    Bobby C. Jones, Aug 10, 2004
    #4
  5. Devin

    John Uhden Guest

    That could be *real* cute. But, um, where do you get the safearray-value
    function or is that really the vlax-safearray->list function?
     
    John Uhden, Aug 11, 2004
    #5
  6. Devin

    Doug Broad Guest

    safearray-value is a built-in function.
     
    Doug Broad, Aug 11, 2004
    #6
  7. Devin

    John Uhden Guest

    Hmm. I found those functions only today after your mentioning. Nice
    documentation, eh? So how many years ago did you know about them? :/
     
    John Uhden, Aug 12, 2004
    #7
  8. I first saw (or is that first paid attention to) them
    in posts by Ken Alexander and thought the same
    thing as you.
     
    Jason Piercey, Aug 12, 2004
    #8
  9. Devin

    Doug Broad Guest

    Agreed about the documentation. It was probably part
    of the R14 vlisp package and left undocumented.

    I can't remember where I learned about it.
    It may have been when Vladimir posted this function
    several years ago. Appropos has helped me find
    some others(don't ask me though :):)

    Regards,
    Doug
     
    Doug Broad, Aug 12, 2004
    #9
  10. Devin

    Doug Broad Guest

    Thanks Luis.
     
    Doug Broad, Aug 12, 2004
    #10
  11. Devin

    John Uhden Guest

    Well there ya go. Thanks, Luis, et al. I still have Vital Lisp installed, so
    maybe I oughta check out the help a little more. If I find anything of value,
    I'll let you know.
     
    John Uhden, Aug 13, 2004
    #11
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.