Author Topic: vlax-invoke with vlax-get-property  (Read 2913 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
vlax-invoke with vlax-get-property
« on: February 26, 2015, 05:44:06 AM »
Hello guys .

is there a way to use the vlax-invoke with vlax-get-property to pass over the the variant value of the vlax-get-property ?

I am collecting a value from excel file from a cell like this .

Code: [Select]
(vlax-get-property cells "Item" 7 3)

Thanks in advance  :-)

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: vlax-invoke with vlax-get-property
« Reply #1 on: February 26, 2015, 06:19:45 AM »
Hi,

Try (not tested):
Code - Auto/Visual Lisp: [Select]
  1. (vlax-get cells "Item" 7 3)
Speaking English as a French Frog

Coder

  • Swamp Rat
  • Posts: 827
Re: vlax-invoke with vlax-get-property
« Reply #2 on: February 26, 2015, 06:23:25 AM »
Hi gile

That gives me error .  :-(
; error: too many arguments

Coder

  • Swamp Rat
  • Posts: 827
Re: vlax-invoke with vlax-get-property
« Reply #3 on: February 27, 2015, 12:19:55 PM »
Any other suggestion please ?

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: vlax-invoke with vlax-get-property
« Reply #4 on: February 27, 2015, 12:48:49 PM »
What's wrong with using vlax-get-property and working with the variant?

Coder

  • Swamp Rat
  • Posts: 827
Re: vlax-invoke with vlax-get-property
« Reply #5 on: February 27, 2015, 01:06:28 PM »
Hi Lee ,

I just want to get the value without converting it from variant to real value cause this takes time if we have many variants to convert .

Or maybe you have another way to work around this other than vlax-invoke function ?

Thank you .

ronjonp

  • Needs a day job
  • Posts: 7527
Re: vlax-invoke with vlax-get-property
« Reply #6 on: February 27, 2015, 01:19:20 PM »
Just guessing here:


(vlax-get cells 'Item '(7 3))

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Coder

  • Swamp Rat
  • Posts: 827
Re: vlax-invoke with vlax-get-property
« Reply #7 on: February 27, 2015, 02:15:10 PM »
Just guessing here:


(vlax-get cells 'Item '(7 3))

Hi ronjonp

Also it gives error message . ; error: too many arguments  :-(

ronjonp

  • Needs a day job
  • Posts: 7527
Re: vlax-invoke with vlax-get-property
« Reply #8 on: February 27, 2015, 03:14:48 PM »
After a quick test this seems to be the most direct route to get the value:
Code - Auto/Visual Lisp: [Select]
  1. (vlax-get (vlax-variant-value (vlax-get-property cells 'item 1 1)) 'value2)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Coder

  • Swamp Rat
  • Posts: 827
Re: vlax-invoke with vlax-get-property
« Reply #9 on: February 27, 2015, 03:38:44 PM »
After a quick test this seems to be the most direct route to get the value:
Code - Auto/Visual Lisp: [Select]
  1. (vlax-get (vlax-variant-value (vlax-get-property cells 'item 1 1)) 'value2)

Thank you ron for your help , that works like a charm  :-)

Cheers

ronjonp

  • Needs a day job
  • Posts: 7527
Re: vlax-invoke with vlax-get-property
« Reply #10 on: February 27, 2015, 05:01:34 PM »
Glad to help  :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC