vlax-invoke vs vlax-invoke-method

Discussion in 'AutoCAD' started by User of Internet, Nov 6, 2004.

  1. hello,
    these are two diffrent function? or not?
    also vla-get vs vlax-get-property...
    best regards
    Andrzej
     
    User of Internet, Nov 6, 2004
    #1
  2. User of Internet

    Doug Broad Guest

    yes. vlax-invoke and vlax-invoke-method are different.
    yes. objects have properties and methods. The choice
    of which function to use depends on whether you are
    getting properties vs methods.

    Vlax-invoke was part of vital lisp(I think). It can be
    used in some cases to send data without first converting
    it into variants and safe-arrays. The same is true with
    vlax-get.
     
    Doug Broad, Nov 6, 2004
    #2
  3. User of Internet

    Joe Burke Guest

    Andrzej,

    Yes, they are different. In general, vlax-invoke, vlax-put and vlax-get are easier to
    use (than vlax-invoke-method, vlax-put-property, vlax-get-property) because the
    arguments supplied or data returned are similar to vanilla LISP. Similar in the sense
    safe-array and variant conversion functions are often needed with the latter
    functions.

    Simplistic example. Let's say you want to move a block reference from its current
    insertion point to 0,0,0. Both of the following will work. Vlax-put-property needs a
    variant argument. Vlax-3D-point performs the list to variant conversion. Whereas the
    vlax-put function does the variant conversion internally.

    (vlax-put-property blockref 'InsertionPoint (vlax-3D-point '(0.0 0.0 0.0)))
    (vlax-put blockref 'InsertionPoint '(0.0 0.0 0.0))

    But this won't work:
    (vlax-put-property blockref 'InsertionPoint '(0.0 0.0 0.0))
    ; error: lisp value has no coercion to VARIANT with this type: (0.0 0.0 0.0)

    HTH
    Joe Burke
     
    Joe Burke, Nov 6, 2004
    #3
  4. User of Internet

    j.buzbee Guest

    What Doug and Joe said . . . and,

    I've found that when working with vertical applications, i.e. Architectural
    Desktop, it's adventagious to use vlax-put and vlax-invoke when working with
    objects defined by these programs.

    jb
     
    j.buzbee, Nov 7, 2004
    #4
  5. and wrap those in a vl-catch-all-apply. not sure why this helps but it makes all the difference with Land Desktop
    objects...

    "User of Internet" <>
    |>hello,
    |>these are two diffrent function? or not?
    |>also vla-get vs vlax-get-property...
    |>best regards
    |>Andrzej
    |>

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Nov 8, 2004
    #5
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.