|
27 | 27 | using BH.Engine.Structure;
|
28 | 28 | using System.Linq;
|
29 | 29 | using RobotOM;
|
| 30 | +using BH.oM.Structure.Elements; |
30 | 31 |
|
31 | 32 | namespace BH.Adapter.Robot
|
32 | 33 | {
|
@@ -61,7 +62,29 @@ private bool CreateCollection(IEnumerable<ILoad> loads)
|
61 | 62 |
|
62 | 63 | private bool ICheckLoad(ILoad load)
|
63 | 64 | {
|
64 |
| - return CheckLoad(load as dynamic); |
| 65 | + //Dynamic dispatching should be working, and was working up to a point where it all of a sudden stopped. |
| 66 | + //SHould try commenting out this line of code, and/or make a bigger investigation as to why dynamic dispatching is causing an issue in Robot toolkit |
| 67 | + //Code further down as a fix for now |
| 68 | + |
| 69 | + //return CheckLoad(load as dynamic); |
| 70 | + |
| 71 | + //This _should_ not be needed. as dynamic call above _should_ work and _was_ working. |
| 72 | + if(load is IElementLoad<Bar>) |
| 73 | + return CheckLoad(load as IElementLoad<Bar>); |
| 74 | + if(load is IElementLoad<Node>) |
| 75 | + return CheckLoad(load as IElementLoad<Node>); |
| 76 | + if(load is IElementLoad<IAreaElement>) |
| 77 | + return CheckLoad(load as IElementLoad<IAreaElement>); |
| 78 | + if(load is IElementLoad<BHoMObject>) |
| 79 | + return CheckLoad(load as IElementLoad<BHoMObject>); |
| 80 | + if (load is IElementLoad<IBHoMObject>) |
| 81 | + return CheckLoad(load as IElementLoad<IBHoMObject>); |
| 82 | + if (load is IElementLoad<Panel>) |
| 83 | + return CheckLoad(load as IElementLoad<Panel>); |
| 84 | + if(load is IElementLoad<FEMesh>) |
| 85 | + return CheckLoad(load as IElementLoad<FEMesh>); |
| 86 | + |
| 87 | + return CheckLoad(load); |
65 | 88 | }
|
66 | 89 |
|
67 | 90 | /***************************************************/
|
|
0 commit comments