Cast double to object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Cast double to object

Brian Ashcroft

I have an array of type object that I am trying to populate from inside a script.  I create the data, type it and assign it to the array.  However, it seems that ironpython will only accept data that has been cast to int.  Here is the code, can you tell me what I am doing wrong?

 

RectangleToken = Filters.GeneralToken()

      mRectangleToken.Parameters =Array[object](range(1))

      mRectangleToken.Parameters[0]=IronPythonConversions.ConvertToDouble(3)

      Filter =Filters.Effects.Morphology.OpeningTool()

      BitmapImage=Filter.RunEffect(BitmapImage,mRectangleToken)


_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Reply | Threaded
Open this post in threaded view
|

Re: Cast double to object

Brian Ashcroft

In a second related problem,  GeneralToken is from the inheritance IEffectToken, which RunEffect expects.  The line RunEffect(BitmapImage,mRectangleToken) sometimes works and sometimes throws a specific cast is invalid error as well.  I am using Ironpython 2.6.2 (2.6.10920.0) on .net 2.0

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Brian Ashcroft
Sent: Wednesday, March 09, 2011 9:44 AM
To: [hidden email]
Subject: [IronPython] Cast double to object

 

I have an array of type object that I am trying to populate from inside a script.  I create the data, type it and assign it to the array.  However, it seems that ironpython will only accept data that has been cast to int.  Here is the code, can you tell me what I am doing wrong?

 

RectangleToken = Filters.GeneralToken()

      mRectangleToken.Parameters =Array[object](range(1))

      mRectangleToken.Parameters[0]=IronPythonConversions.ConvertToDouble(3)

      Filter =Filters.Effects.Morphology.OpeningTool()

      BitmapImage=Filter.RunEffect(BitmapImage,mRectangleToken)


_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com