Re: [IronPython] The return value (out)

2011-03-26 Thread Afan Olovcic
Thanks for your help guys,
It works ,
I have another problem now ,
i have new error msg : :)expected TEntity, got TPivot  but I know why .
TPick is struct :

 public struct TPick
{
public TEntity entity;
public TEntity surface;
public float X, Y, Z;
public float NX, NY, NZ;
public int triangle;
}

that is why he expect TEntity
but TMesh, TPivot, Tlight etc All of them are TEntity in same time
in c or c# I can say  Tlight light  or TEntity light TMesh mesh  or
TEntity mesh
do you guys have idea how to solve this problem

Thanks





On Sat, Mar 26, 2011 at 6:44 AM, Dino Viehland  wrote:

>  Is the method overloaded?  There could be enough confusion w/overloads
> where we aren’t picking the right overload.  Alternately you can do:
>
>
>
> import clr
>
> ref = clr.Reference[TPick]()
>
>
>
> And then call it with the reference value whose’s .Value property will be
> updated on a successful call such as:
>
>
>
> int_res = EntityPick(ref, …)
>
> print ref.Value
>
>
>
> If it is overloaded you can also index into the .Overloads property to
> select the proper overload but hopefully using Reference (which is an alias
> for StrongBox) should work.
>
>
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *Afan Olovcic
> *Sent:* Friday, March 25, 2011 7:24 PM
> *To:* Discussion of IronPython
> *Subject:* Re: [IronPython] The return value (out)
>
>
>
> Hi,
>
>
>
> It doesn't work I have an error message
>
>
>
> Microsoft.Scripting.ArgumentTypeException: expected StrongBox[TPick], got
> TMesh
>
>
>
> code:
>
>
>
> result, pick = LE.*EntityPick*(entity,10.0)
>
>
>
> On Sat, Mar 26, 2011 at 3:13 AM, Tomas Matousek <
> tomas.matou...@microsoft.com> wrote:
>
> This should work:
>
>
>
> result, pick = EntityPick(entity)
>
>
>
> That is, out arguments are returned bundled in a tuple with the result of
> the method.
>
>
>
> Tomas
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *Afan Olovcic
> *Sent:* Friday, March 25, 2011 6:56 PM
> *To:* users@lists.ironpython.com
> *Subject:* [IronPython] The return value (out)
>
>
>
> Hi,
>
>
>
> Can somebody help me to solve this problem please ?
>
>
>
> in the .NET Assembly there is C# function:
>
> public static extern int EntityPick(out TPick pick, TEntity entity, float
> range = 100, float radius = 0, int collisionType = 0, PickFilterCallback
> pickfilter = null);
>
>
>
> how to call that function in ironPython and get return value of pick
>
>
>
> I can't find working solution
>
>
>
> Thanks
>
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] The return value (out)

2011-03-25 Thread Dino Viehland
Is the method overloaded?  There could be enough confusion w/overloads where we 
aren't picking the right overload.  Alternately you can do:

import clr
ref = clr.Reference[TPick]()

And then call it with the reference value whose's .Value property will be 
updated on a successful call such as:

int_res = EntityPick(ref, ...)
print ref.Value

If it is overloaded you can also index into the .Overloads property to select 
the proper overload but hopefully using Reference (which is an alias for 
StrongBox) should work.


From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Afan Olovcic
Sent: Friday, March 25, 2011 7:24 PM
To: Discussion of IronPython
Subject: Re: [IronPython] The return value (out)

Hi,

It doesn't work I have an error message

Microsoft.Scripting.ArgumentTypeException: expected StrongBox[TPick], got TMesh

code:

result, pick = LE.EntityPick(entity,10.0)

On Sat, Mar 26, 2011 at 3:13 AM, Tomas Matousek 
mailto:tomas.matou...@microsoft.com>> wrote:
This should work:

result, pick = EntityPick(entity)

That is, out arguments are returned bundled in a tuple with the result of the 
method.

Tomas

From: 
users-boun...@lists.ironpython.com<mailto:users-boun...@lists.ironpython.com> 
[mailto:users-boun...@lists.ironpython.com<mailto:users-boun...@lists.ironpython.com>]
 On Behalf Of Afan Olovcic
Sent: Friday, March 25, 2011 6:56 PM
To: users@lists.ironpython.com<mailto:users@lists.ironpython.com>
Subject: [IronPython] The return value (out)

Hi,

Can somebody help me to solve this problem please ?

in the .NET Assembly there is C# function:
public static extern int EntityPick(out TPick pick, TEntity entity, float range 
= 100, float radius = 0, int collisionType = 0, PickFilterCallback pickfilter = 
null);

how to call that function in ironPython and get return value of pick

I can't find working solution

Thanks

___
Users mailing list
Users@lists.ironpython.com<mailto:Users@lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] The return value (out)

2011-03-25 Thread Afan Olovcic
Hi,

It doesn't work I have an error message

Microsoft.Scripting.ArgumentTypeException: expected StrongBox[TPick], got
TMesh

code:

result, pick = LE.EntityPick(entity,10.0)


On Sat, Mar 26, 2011 at 3:13 AM, Tomas Matousek <
tomas.matou...@microsoft.com> wrote:

>  This should work:
>
>
>
> result, pick = EntityPick(entity)
>
>
>
> That is, out arguments are returned bundled in a tuple with the result of
> the method.
>
>
>
> Tomas
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *Afan Olovcic
> *Sent:* Friday, March 25, 2011 6:56 PM
> *To:* users@lists.ironpython.com
> *Subject:* [IronPython] The return value (out)
>
>
>
> Hi,
>
>
>
> Can somebody help me to solve this problem please ?
>
>
>
> in the .NET Assembly there is C# function:
>
> public static extern int EntityPick(out TPick pick, TEntity entity, float
> range = 100, float radius = 0, int collisionType = 0, PickFilterCallback
> pickfilter = null);
>
>
>
> how to call that function in ironPython and get return value of pick
>
>
>
> I can't find working solution
>
>
>
> Thanks
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] The return value (out)

2011-03-25 Thread Tomas Matousek
This should work:

result, pick = EntityPick(entity)

That is, out arguments are returned bundled in a tuple with the result of the 
method.

Tomas

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Afan Olovcic
Sent: Friday, March 25, 2011 6:56 PM
To: users@lists.ironpython.com
Subject: [IronPython] The return value (out)

Hi,

Can somebody help me to solve this problem please ?

in the .NET Assembly there is C# function:
public static extern int EntityPick(out TPick pick, TEntity entity, float range 
= 100, float radius = 0, int collisionType = 0, PickFilterCallback pickfilter = 
null);

how to call that function in ironPython and get return value of pick

I can't find working solution

Thanks
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] The return value (out)

2011-03-25 Thread Afan Olovcic
Hi,

Can somebody help me to solve this problem please ?

in the .NET Assembly there is C# function:
public static extern int EntityPick(out TPick pick, TEntity entity, float
range = 100, float radius = 0, int collisionType = 0, PickFilterCallback
pickfilter = null);

how to call that function in ironPython and get return value of pick

I can't find working solution

Thanks
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com