dynamo to grasshopper – new mantis shrimp

image by archi-lab

Couple of weeks ago I had a conversation with Mostapha (@__Mostapha__) about Mantis Shrimp plug in that I was working on, and he suggested that I rebuilt it from ground up and start by creating my own geometry/data classes. It has been a busy few weeks at work/holiday travel so I am not entirely done, but I think I got enough of it working that I am ready to let it out into the wild. I would also like to take this opportunity to thank another person – Giulio Piacentino from http://www.giuliopiacentino.com/ for help with Grasshopper DataTrees. Here’s a list of what’s new in Mantis Shrimp:

Grasshopper User Objects for importing Dynamo geometry:

  • Point
  • Line
  • PolyLine
  • Arc
  • Nurbs Curve
  • Ellipse
  • Circle
  • Data (strings, floats etc)
  • Nurbs Surface
  • Mesh

 

6

These components will allow you to import geometry directly from Dynamo for easy manipulation in Grasshopper. One of the new and most crucial functionality that was added to Mantis Shrimp is ability to move data between the two programs. Moving geometry is great, but I am usually more interested in getting data out of Grasshopper. One of the tasks that comes up the most at work is to create schedules from set-out points in Grasshopper. As a matter of fact, for now I am usually using Lyrebird to write data back to Revit families. Eventually I want to get away from this workaround so I will be working next on some of that functionality. In case that you were wondering what I mean by “data” here’s an example:

Grasshopper Twitter read using Mosquito plug-in:

2

…and that “data” (my last Tweet) sent to Dynamo:

1

What this new Data component does, is that it allows me to get away from attaching data to geometry as user strings (that component is still somewhat useful so I am not going to discontinue it just yet), and instead I can just send it over directly.

One more example of where Mantis Shrimp new components come handy is in case of some really simple geometry in Revit that can be quickly reconstructed in Grasshopper. Let’s take Adaptive Components (AC) for example:

5

4

Using Lunchbox Adaptive Component Collector we can get all of the panels and their location points very easily. Then using Mantis Shrimp we can just as easily ship them out to Grasshopper and then re-create those same AC surfaces:

3

As you can see it takes exactly two (2) GH Components to re-create our surfaces in GH. Now, forget about those time consuming Import/Export workflows, you will not need them anymore.

Now, you probably noticed that since my AC families in Revit were made with three points, then when they were queried for location points the result was a list with three points for each panel. That creates an output of nested lists or in Grasshopper something called DataTree. In this case its important to retain that structure when points are being exported so that we know which three points make up which surface. Fret not, since Mantis Shrimp will retain your list structure on either import from GH or export from Dynamo. 

These are just two really simple examples of how geometry exchanges can now be handled between Grasshopper and Dynamo (and somewhat Revit). Obviously it’s not a world shattering improvement, but for someone like me who spends a lot of time in Grasshopper developing concepts, doing analysis – the ability to quickly move that knowledge to Dynamo and then Revit makes for an important improvement.

Here’s what else is new in Mantis Shrimp:

New Paths:

Few extra paths were added in case that not everyone has their Rhino installed in the same place as mine. Unfortunately I am sure they will not cover all of the possible locations, so I am now considering adding an extra input that will allow users to specify location of the rhinocommon.dll library. Paths covered:

  • C:\Program Files\Rhinoceros 5 (64-bit)\System\RhinoCommon.dll
  • C:\Program Files\Rhinoceros 5.0 (64-bit)\System\RhinoCommon.dll
  • C:\Program Files\McNeel\Rhinoceros 5.0\System\RhinoCommon.dll

If your Rhino is installed in any of the above locations you should be good, if not then you have to change that in every Dynamo node. Not fun :-( (maybe that extra input will be something that I have to do after all)

Units:

I also, added ability to read Units when importing geometry from a 3dm file. Since, Dynamo by default always operates in Meters then there is a string possibility that if your Rhino file was set up in units other than Meters that you were getting some out of scale imports. That should be fixed now, and here’s what the new nodes look like:

7

So far I only wrote conversion methods for some of the “possible” units in Rhino. Here’s a list of units covered:

These changes I think are a great improvement to Mantis Shrimp and in general Dynamo/Grasshopper workflows. I think next, I will look at generating native Revit elements. Schedules are first on my list, but other things like Drafting Views and Drafting Lines, Filled Regions etc are high up there. If I am not too busy at work next week, I might have some examples and new workflows for Mantis Shrimp. Stay tuned.

PS. PolyLines were just added to the set. (12/30/2014 5:40pm)

Support archi-lab on Patreon!

13 Comments

  1. Melissa says:

    Konrad,

    Hi, I’m trying to get room outlines from dynamo into grasshopper using the lunchbox room element collector and mantis shrimp. I convert the boundaries (lines and arcs) into nurbscurves in dynamo, then make the .geo file with no error in dynamo. When I go to import into grasshopper using the mantis shrimp nurbscurves componenet, I keep getting the following error, any ideas what might be wrong? I can send screen shots, etc via email.

    0. Runtime error (ArgumentTypeException): toRHNurbsCurve() takes exactly 1 argument (2 given)

  2. Melissa,

    I like LunchBox package but I don’t think it will be needed at the moment. You can use the latest archi-lab_Grimshaw and Mantis Shrimp package to complete this. Please see the attached images. I am using Revit 2016, Dynamo 0.9.0 stable, Rhino 5 x64 and Grasshopper .

    Attachment:  image1.png

  3. This is Grasshopper side.

    Attachment:  image2.png

  4. Melissa says:

    Thanks Konrad!
    I’ll give that a shot.

    Melissa

  5. Nick Curtis says:

    Konrad,

    I am working on a Virtual Machine, my whole team is, so I’m trying to get Mantis Shrimp running on this setup. We are running Revit 2015, Dynamo 0.9.1, and Rhino 5 SR12 and latest Grasshopper 0.9.0076. After having pathing issues with Mantis Shrimp 2015.10.27 (fyi this setup worked briefly and then broke, I think after restart), I’ve uninstalled and then installed Mantis Shrimp (MS) 2016.2.22 from the package manager.
    The way the VM is set up, Rhino is installed here: C:\Program Files\Rhinoceros 5.0 (64-bit)\System

    BUT

    Dynamo (and hence the rhPath.txt file in the extra folder) is actually at this path: X:\Users\nick.curtis\AppData\Roaming\Dynamo\0.9\packages\Mantis Shrimp\extra. (Not C:\ Drive)

    When, in GH, I pull the MS node “Specify Rhinocommon.dll path”, I get this error: “could not find part of the path “C:\Users\nick.curtis\AppData\Roaming\Dynamo\0.9\packages\Mantis Shrimp\extra\rhpath.txt”. I am guessing this is because it is actually installed on an X: drive and not the C: drive.

    And when I pull other MS Nodes in GH I get the following error: “No module named Mantis Shrimp”

    And when trying to run, pretty much all MS nodes within Dynamo, I simply get Null results. And yes it is set to run automatic.

    Any help would be huge, Thanks!

    Nick

    • Nick Curtis says:

      Konrad,

      And if there is no easier fix for the short term than to edit paths within nodes, I’m game to hear it, and would be interested to know if this node repathing would need to be done specifically for each user. VM’s are coming, so hopefully this exercise could help future-proof your plugin!?

      -best
      Nick

      • hey Nick! Thanks for reporting. This is great. I was recently looking at a similar issue for Bumblebee where user was having trouble with custom package locations for dynamo. I think this can be sorted out, the only issue for me is that I am not running on a VM machine and have no access to one so testing is a bit of a problem for me as I have to basically do dry tests and hope it works. Let me have a look and I will get back to you. Also, if you want to get a head start on this, have a look under the hood of Bumblebee’s most recent update. It will have piece of code there that looks for package location based on XML file stored by Dynamo (it stores custom package paths so dynamo can find them), and if you are feeling lucky you can implement that. I will basically be doing that, but I can’t promise when. :-)

        Cheers!

  6. Luciano says:

    Thank you for your work.
    I am wondering if Mantis Shrimp works fine in Rhino v6 and Dynamo v 2.x? Thanks in advance.

    • Hi, I haven’t had a need to use Mantis Shrimp with Dynamo 2.0 and Rhino 6 so it went un-updated. I am not sure, if I will have time to do that. There are some other options available and very few people asked me to do that, so it’s been a while.

  7. tarek says:

    HI
    any update for this plug in?
    really It is an amazing plug in

    • It’s been a while since I was able to keep this plugin up to date. It has to do with lack of time for this kind of support. I encourage my supporters to fund archilab via Patreon here: https://www.patreon.com/archilab It’s the only way at the moment to keep working on these plugins. I also have the archi-lab.net, mandrill, bumblebee and many other open source initiatives and plugins that I am supporting.

Reply to Melissa Cancel Reply