Skip to content

Commit 8a5127e

Browse files
authored
Better handling of int64 (#727)
2 parents 49f127f + a6ca346 commit 8a5127e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Grasshopper_UI/Helpers/ToGH_Param.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ public static IGH_Param ToGH_Param(this ParamInfo info)
7979
break;
8080
case "System.Int16":
8181
case "System.Int32":
82-
param = new Param_Integer();
83-
break;
8482
case "System.Int64":
85-
param = new Param_Time();
83+
param = new Param_Integer();
8684
break;
8785
case "System.String":
8886
param = new Param_String();

Grasshopper_UI/Helpers/ToGoo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ public static IGH_Goo ToGoo(this int obj)
167167

168168
public static IGH_Goo ToGoo(this long obj)
169169
{
170-
return new GH_Time(new DateTime(obj)); // Based on what is done in CallerComponent.ToGHParam()
170+
int cast = (int)obj;
171+
if (obj != cast)
172+
BH.Engine.Base.Compute.RecordError("Grasshopper does not support 64-bit integers, casting to 32-bit resulted in integer overflow.");
173+
174+
return new GH_Integer(cast);
171175
}
172176

173177
/*************************************/

0 commit comments

Comments
 (0)