Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vba object's property as argument to a function

4 REPLIES 4
Reply
Message 1 of 5
huret
172 Views, 4 Replies

Vba object's property as argument to a function

Hello
I try to send object property as argument to a function in vba
this function must sort objects by "LAYER" or "COLOR"
but i don't know how to use this argument in the function

Public Function tri_par ( Aray , value)
For i = 1 To UBound (aray)
..............
..........
objprop = objent.value (where value is equal to "LAYER" or "COLOR")
doesn't seems to be right

if it isn't possible, Is there a command that accept dxf code as argument ?
That irritates me, if I succeeded not, I go back in Lisp 😉

Thank for help me.
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: huret

I'm not sure what you are asking.....if you could post the lisp code that does what you want, I/we can help you get the VB code to do the same thing. Jeff "herve" wrote in message news:10675457.1077204590971.JavaMail.jive@jiveforum2.autodesk.com... > Hello > I try to send object property as argument to a function in vba > this function must sort objects by "LAYER" or "COLOR" > but i don't know how to use this argument in the function > > Public Function tri_par ( Aray , value) > For i = 1 To UBound (aray) > .............. > .......... > objprop = objent.value (where value is equal to "LAYER" or "COLOR") > doesn't seems to be right > > if it isn't possible, Is there a command that accept dxf code as argument ? > That irritates me, if I succeeded not, I go back in Lisp ;) > > Thank for help me.
Message 3 of 5
huret
in reply to: huret

My question is :
Can i have a variable to define a property
like in visual lisp
(setq dummy "layer")
(vlax-get-property object dummy)
in vba
dummy = "layer"
object.dummy
is incorrect
is there a method in vba to do this ?
sorry, I explained with difficulty because my English is poor
Message 4 of 5
Anonymous
in reply to: huret

Perhaps this is what you are after? (setq dummy "layer") (vlax-get-property object (read dummy)) -- -Jason Member of the Autodesk Discussion Forum Moderator Program "herve" wrote in message news:31488696.1077549922688.JavaMail.jive@jiveforum2.autodesk.com... > My question is : > Can i have a variable to define a property > like in visual lisp > (setq dummy "layer") > (vlax-get-property object dummy) > in vba > dummy = "layer" > object.dummy > is incorrect > is there a method in vba to do this ? > sorry, I explained with difficulty because my English is poor
Message 5 of 5
Anonymous
in reply to: huret

OK, I think I've got what you are attempting. Try this: For i = 1 To UBound(Aray) .............. .......... Select Case value Case "LAYER" objprop = objEnt.Layer Case "COLOR" objprop = objEnt.Color End Select HTH, Jeff "herve" wrote in message news:10675457.1077204590971.JavaMail.jive@jiveforum2.autodesk.com... > Hello > I try to send object property as argument to a function in vba > this function must sort objects by "LAYER" or "COLOR" > but i don't know how to use this argument in the function > > Public Function tri_par ( Aray , value) > For i = 1 To UBound (aray) > .............. > .......... > objprop = objent.value (where value is equal to "LAYER" or "COLOR") > doesn't seems to be right > > if it isn't possible, Is there a command that accept dxf code as argument ? > That irritates me, if I succeeded not, I go back in Lisp ;) > > Thank for help me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost