algorithmic modeling for Rhino
I'm trying to update my Karamba scripts from 1.2.2 version to 1.3.0. I'm trying to write a simple C# script to understand this new organization between materials and cross sections, but i'm facing some issues.
The code I wrote is the following, trying to retreive the Modulus of Elasticity of one element:
private void RunScript(object x, ref object A)
Karamba.Models.Model model = (Karamba.Models.Model) x;
A = model.elems.crosec.material.E();
With Karamba 1.3.0 properly assembled.
I'm getting the following errors:
1. Warning (CS1701): Assuming assembly reference 'RhinoCommon, Version=6.1.18037.13441, Culture=neutral, PublicKeyToken=552281e97c755530' matches 'RhinoCommon, Version=6.3.18090.471, Culture=neutral, PublicKeyToken=552281e97c755530', you may need to supply runtime policy
2. Warning (CS1701): Assuming assembly reference 'Grasshopper, Version=6.1.18037.13441, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803' matches 'Grasshopper, Version=6.3.18090.471, Culture=neutral, PublicKeyToken=dda4f5ec2cd80803', you may need to supply runtime policy
1. [A]Karamba.Models.Model cannot be cast to [B]Karamba.Models.Model. Type A originates from 'karamba, Version=188.8.131.52, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' in a byte array. Type B originates from 'karamba, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\Program Files\Rhino 6\Plug-ins\karamba.gha'. (line: 116)
Looks like a problem between Karamba 1.3.0 and Rhino 6 assembles. Any ideia to solve this? I need to update my exiting scripts since they all stopped working.
did you install the Rhino6-version of Karamba? Do you reference the correct karamba.gha-File in your C#-component? Did you disable the option that Grasshopper loads .gha-assemblies to memory? You can do this for all plug-ins using the 'GrasshopperDeveloperSettings' command in the Rhino text window. It is also possible to do this for each plug-in individually via Grasshopper/Help/About/...
I have the following problem in karamba 1.3 for rhinoceros 6, I deactivate the Memory load.GHA * assemblies using COFF byte arrays, but at the moment of using the component c # this can not recognize the karamba.gha file, at which point I return to the Memory load. GHA assemblies using COFF byte arrays, then there if you recognize the karamba.gha file but it does not recognize the code (it does not recognize the classes), I can not use the GrasshopperUnloadPlugin and GrasshopperLoadPlugin commands because Rhinoceros 6 does not have them, then. How could you solve this issue to be able to program properly?
In order that you can use 'karamba.gha' from the Grasshopper C#-component the 'Using COFF byte arrays'-option for Karamba3d needs to be disabled.
In case the C# -component has troubles with the 'karamba.gha'-assembly use 'Manage Assemblies' from the context menu of the C#-component (right-click on the component for that), remove 'karamba.gha' from the list of assemblies and then readd it.
Since Rhino6 does not have an unload command for Grasshopper it needs to be closed and reopened for changes to take effect.
probe with all the above and I still have the same problem, rewrite the TensionEiim component in visual studio and I see a similar problem which is seen in the image, I'm working with the version of framework 4.5 since I have rhino 6 and karamba 1.3 for rhino 6, I have also disabled the option Using COFF byte arrays, I sent the rewritten file of the component TemsionElim, thanks in advance!
the file is in visual studio c # 2017
did you try to copy your plug-in to the Rhino plug-ins-folder? Does this also work?
What I did was move the karamba.gha file from the folder plug-ins to the Components folder of the grasshopper folder and it worked !!!!