vlax-put-property??

Discussion in 'AutoCAD' started by T.Willey, Jun 22, 2004.

  1. T.Willey

    T.Willey Guest

    Command: !pt1a
    (6.57642 0.227973 0.0)

    Command: !ent4
    #<VLA-OBJECT IAcadLine 051cedb4>

    Command: (vlax-put-property ent4 'StartPoint pt1a)
    ; error: lisp value has no coercion to VARIANT with this type: (6.57642
    0.227973 0.0)

    I'm trying to understand the vlisp more, but I can't seem to get this to work and I don't understand the error it gives me. If someone could shed some light on this situation it would be greatly appreciated.

    Tim
     
    T.Willey, Jun 22, 2004
    #1
  2. T.Willey

    ECCAD Guest

    Review 'safe-array'
    Bob
     
    ECCAD, Jun 22, 2004
    #2
  3. T.Willey

    Don Butler Guest

    Jeff:

    Do you know if the VLAX-PUT and VLAX-GET functions might be removed from
    Visual Lisp in a future release?

    Currently, they are undocumented.

    Aren't they holdovers from Vital Lisp?

    Don
     
    Don Butler, Jun 22, 2004
    #3
  4. T.Willey

    Jeff Mishler Guest

    they (usually) allow the use of lisp lists instead of variants/safearrays
    this newsgroup and the mentioned T & E
     
    Jeff Mishler, Jun 22, 2004
    #4
  5. T.Willey

    andywatson Guest

    T.

    The way I always remember it is....
    vlax-put-property & vlax-invoke-method require that all the arguments be "vba"-dified. You need to prepare them before you present them to to the property or method using conversion methods (like vlax-3d-point). And if they return anything (like arrays of coordinates, object names, etc) , the values will need to be un-"vba"-dified, except if they return real numbers or strings. Also, the method or property name must be preceded by a ' symbol.

    On the other hand, vlax-put and vlax-invoke will accept lisp formatted arguments and also return lisp formatted arguments. The method or property is enclosed in quotes.

    (vlax-put LineObj "Startpoint" pt1a) should work just fine.

    Andrew
     
    andywatson, Jun 22, 2004
    #5
  6. T.Willey

    Don Butler Guest

    I think they're great as well but I always worry about unexpected results
    with future releases.

    Don
     
    Don Butler, Jun 23, 2004
    #6
  7. T.Willey

    Larry Travis Guest

    Are you sure they are undocumented. If you go to the Autolisp Developer's Guide, under "Using Visual LISP Functions with ActiveX Methods, you will find the following paragraph:

    VLISP also adds a set of ActiveX-related functions whose names are prefixed with vlax-. These are more general ActiveX functions, each of which can be applied to numerous methods, objects, or properties. For example, with the vlax-get-property function, you can obtain any property of any ActiveX object. If your drawing contains custom ActiveX objects, or if you need to access objects from other applications, such as a Microsoft Excel spreadsheet, you can use the vlax-invoke-method, vlax-get-property, and vlax-put-property functions to access their methods and properties; you'll see examples using these functions in Using ActiveX without Importing a Type Library.

    Looks like they are documented to me :)


    LT
     
    Larry Travis, Jun 23, 2004
    #7
  8. I see nothing in that quote for (vlax-get) or (vlax-put). I *do* see
    (vlax-get-property) and (vlax-put-property).

    ;^)

    --
    R. Robert Bell


    Are you sure they are undocumented. If you go to the Autolisp Developer's
    Guide, under "Using Visual LISP Functions with ActiveX Methods, you will
    find the following paragraph:

    VLISP also adds a set of ActiveX-related functions whose names are
    prefixed with vlax-. These are more general ActiveX functions, each of which
    can be applied to numerous methods, objects, or properties. For example,
    with the vlax-get-property function, you can obtain any property of any
    ActiveX object. If your drawing contains custom ActiveX objects, or if you
    need to access objects from other applications, such as a Microsoft Excel
    spreadsheet, you can use the vlax-invoke-method, vlax-get-property, and
    vlax-put-property functions to access their methods and properties; you'll
    see examples using these functions in Using ActiveX without Importing a Type
    Library.

    Looks like they are documented to me :)
     
    R. Robert Bell, Jun 23, 2004
    #8
  9. T.Willey

    Larry Travis Guest

    My apologies. In my own head I was just grouping vlax-get-property and
    vlax-put-property under the umbrella of the vlax-get and vlax-put functions
    and had brainlock since the original post was using vlax-put-property.
    Obviously I don't use the functions that often myself ;-)

    LT
     
    Larry Travis, Jun 23, 2004
    #9
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.