Using vlax-get-property with parameters

Discussion in 'AutoCAD' started by filionf, May 20, 2004.

  1. filionf

    filionf Guest

    Hi,

    I have a problem getting information from an ActiveX. The object I use has a property where I have to put an integer as a parameter. I tested it in debug, and no matter what is the value I put in the parameter, the object receives 0. I also tried the vlax-invoke-method, but it crashes. Is it a limitation from VLISP ?
    Any help will be appreciated.
    Thanks
     
    filionf, May 20, 2004
    #1
  2. Show some code so we can see what's going on.

    a property where I have to put an integer as a parameter. I tested it in
    debug, and no matter what is the value I put in the parameter, the object
    receives 0. I also tried the vlax-invoke-method, but it crashes. Is it a
    limitation from VLISP ?
     
    Rick Francken, May 21, 2004
    #2
  3. filionf

    filionf Guest

    Here is the code. It is a loop that goes from 0 to the number of points. At each call to vlax-get-property, the value that the ActiveX receive is 0.

    (setq iCnt 0)
    (while (< iCnt iVLNTotal)
    (setq sVlnFromPnt (vlax-get-property axDG "VLNFromPnt" iCnt))
    (setq iCnt (1+ iCnt))
    )
     
    filionf, May 21, 2004
    #3
  4. Good. Now show us the ActiveX object.

    Also, what is the value of iVLNTotal when you enter the While loop?

    And what is VLNFromPnt? a property or a method?
    Vlax-get-property expects only 2 arguments, but you are passing 3. If
    VLNFromPnt is a method, you should be using Vlax-invoke-method.

    At each call to vlax-get-property, the value that the ActiveX receive is 0.
     
    Rick Francken, May 21, 2004
    #4
  5. filionf

    filionf Guest

    That is actually the problem: VLNFromPnt is a property that needs a parameter. It does not take the parameter when using vlax-get-property and it crashes when using vlax-invoke-method.
     
    filionf, May 25, 2004
    #5
  6. try

    (vlax-get <object> <property> <parameter>)





    using vlax-get-property and it crashes when using vlax-invoke-method.
     
    Tony Tanzillo, May 25, 2004
    #6
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.