Grasshopper

algorithmic modeling for Rhino

please post here in case of karamba problems !

Views: 21519

Replies to This Discussion

Thanks Clemens,

I should have mentioned, I tried removing the buckling algorithm and attempted to optimize the deflections using the THII algorithm only, but I found the dame issues. This leads me to believe that the issue is not in the buckling mode calculation.

Sean

I think I found the memory leak. Please try the current build.

Clemens

Thanks Clemens - I will run it tonight and let you know how it goes.

Sean

Hi,

I am writing c# script in Visual Studio to generate a series of load cases on a number of meshes. I am defining loads using MeshLoad and GravityLoad, with the end result being a list of mesh loads and a list of gravity loads.

Based off the hacker's guide I know I need to transfer these to the grasshopper output components but am having issues figuring out the syntax for GH_Load. 

A bit of pseudo code:

pManager.AddParameter(new Param_Load(), "L", "L", "Mesh Loads", GH_ParamAccess.list);
pManager.AddParameter(new Param_Load(), "G", "G", "Gravity Loads", GH_ParamAccess.list);

L = List<MeshLoad>

G = List<GravityLoad>

DA.SetData(0, new GH_Load(L));

DA.SetData(1, new GH_Load(G));

Any suggestions for getting this to work are much appreciated.

Thanks,

Kristen

Hi Kristen,

in the first part you do not need to supply the GH_ParamAccess parameter:

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.RegisterParam(new Param_Load(), "L", "L", "Mesh Loads");
    pManager.RegisterParam(new Param_Load(), "L", "L", "Gravity Loads");
}

for output of data lists use SetDataList:

loads = List<MeshLoad>
...
List<GH_Load> out_gh_mesh_loads = new List<GH_Load>();
foreach (load in loads) out_gh_mesh_loads.Add(new GH_Load(load))
DA.SetDataList(1, out_gh_mesh_loads);

Best,
Clemens

Thanks Clemens,

I've implemented that section of code and am now getting a FileNotFoundException:

Object: KarambaLoadsComponent (level 1)
{
Exception has been thrown by the target of an invocation.
TargetInvocationException
}

Object: KarambaLoadsComponent (level 2)
{
Could not load file or assembly 'karamba, Version=1.12.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
FileNotFoundException
}

The component runs without errors if I comment out the following lines of code:

pManager.RegisterParam(new Param_Load(), "Loads", "Loads", "Output of ASCE 7 Superimposed Loads");
pManager.RegisterParam(new Param_Load(), "Gravity", "Gravity", "Output of ASCE 7 Factored Gravity Loads");

DA.SetDataList(0, out_gh_mesh_loads);
DA.SetDataList(1, out_gh_grav_loads); 

Where the load definitions are defined in foreach loops as recommended:

foreach (GravityLoad b in G)
{
out_gh_grav_loads.Add(new GH_Load(b));
}

I uninstalled and reinstalled rhino, grasshopper, and karamba to make sure none of the files got moved around on accident, and am still getting the exception. Do you have any suggestions for troubleshooting?

Thank you,

Kristen

Kristen,

try to name your component such that it comes alphabetically after 'karamba'. If the 'Param_Load'-class is still not accessible add the namespace 'Karamba.Loads' via a using clause.

Best,

Clemens

Thanks Clemens,

It was an issue with the order the plugins were loading. I was automatically adding my visual studio output bin using the GrasshopperDeveloperSettings, once I copied my .gha into the plugin folder where karamba.gha is, it stopped causing errors. 

One final issue that I can't seem to figure out is that the MeshLoad component is outputting loads with 0 area and accordingly 0 resulting load. I'm fairly new to c# so it's likely I forgot something or am doing something stupid but have been unable to figure out what I'm doing wrong. 

To troubleshoot so far I have:

  • checked the meshes I've defined by outputting to Grasshopper (resulting meshes are accurate and have area when baked and checked with area in Rhino)
  • looked through karamba code and verified zero area result using MeshUnitLoad.area

Follows is how I'm defining MeshLoad:

Rhino.Geometry.Mesh mesh;

mesh.Vertices.Add(Xi, Yi, Zi);

mesh.Faces.AddFace(0, 1, 2, 3);

Vector3d unitvec;

unitvec = new Vector3d(0, 0, Zload); //ksf

List<bool> GenType = new List<bool>();

GenType.Add(true);

GenType.Add(true);

MeshUnitLoad mul;

mul = new MeshUnitLoad(mesh, LoadOrientation.global, unitvec, GenType);

MeshLoad ml;

ml = new MeshLoad(mul, unitvec, List<Point3d> AllNodesInModel, List<string> BeamIds, int LoadCase);

Do you have any suggestions?

Thank you,

Kristen

Thanks again for all your help Clemens, I ended up figuring out my final question and getting the areas/resultants to calculate correctly.

I needed to add calls to:

mul.calculateMeshVertexLoads();

ml.model_unit_loads = new ModelUnitLoads(nodes,dir,mul);

-Kristen

Hallo!

I'm having problems with the Free version since Karamba doesn't allow me to install it. Looks like even if I select the FREE version, in the end I have the Trial version installed.

I'm using Grasshopper 0.9.0076 and Karamba 1.1.

Can you help me??

Hello Viola,
it might be, that some remnants of old Karamba installations cause the problem. Try to uninstall Karamba and remove all of its components from your harddisk (karamba.dll, karamba.gha, license.lic). Then reinstall Karamba.
Best,

Clemens

Hey Clemens,

many thanks for the quick replay!

Yesterday I did as you tell me several time and only when I was close to give up the Free License started to run properly!! thanks anyway!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service