Grasshopper

generative modeling for Rhino

Tarek Rakha
  • Male
  • Brighton, MA
  • United States
Share on Facebook
Share Twitter
  • Blog Posts
  • Discussions (5)
  • Events
  • Groups
  • Photos
  • Photo Albums
  • Videos

Tarek Rakha's Friends

  • Mostapha Sadeghipour

Tarek Rakha's Discussions

Grabbing Points from Layer and Casting Objects to Point3d in C#
2 Replies

Hello,I am attempting to grab various geometries from layers in Rhino and using them as input in a C# component. I used code provided here on the forums in VB and translated it to C# to grab objects…Continue

Started this discussion. Last reply by Tarek Rakha Dec 22, 2012.

Error - Foreach and 'GetEnumerator'
4 Replies

Hello,I've been working on a C# component for quite some time now, and it was working just fine until I installed the new Grasshopper 0.9.0006. That's when this error showed up:"Error: foreach…Continue

Started this discussion. Last reply by Tarek Rakha Aug 17, 2012.

 

Tarek Rakha's Page

Latest Activity

Tarek Rakha replied to Tarek Rakha's discussion Grabbing Points from Layer and Casting Objects to Point3d in C#
"Thanks a lot Florian!See I am not sure where I can get this kind of information (specifically about GH Types and casts), this forum helps a lot and I am very grateful.  Quick fix just in case someone looks this up: "
Dec 22, 2012
Florian Frank replied to Tarek Rakha's discussion Grabbing Points from Layer and Casting Objects to Point3d in C#
"Hi Tarek, You can use the Grasshopper Types to cast from GeometryBase to Rhinocommon types. 1. Method: List<GeometryBase> geo = new List<GeometryBase>(); foreach (Rhino.DocObjects.RhinoObject obj in objs) { GH_Point p = new…"
Dec 22, 2012
Tarek Rakha posted a discussion

Grabbing Points from Layer and Casting Objects to Point3d in C#

Hello,I am attempting to grab various geometries from layers in Rhino and using them as input in a C# component. I used code provided here on the forums in VB and translated it to C# to grab objects from layers:String layer = "Points";Int32 layer_index = doc.Layers.Find(layer, true); if ((layer_index < 0)) return;Rhino.DocObjects.Layer lay = doc.Layers[layer_index]; Rhino.DocObjects.RhinoObject[] objs = doc.Objects.FindByLayer(lay); if ((objs == null)) return;List<GeometryBase> geo =…See More
Dec 21, 2012
Tarek Rakha replied to Tarek Rakha's discussion Error - Foreach and 'GetEnumerator'
"Yes there a class definition for Block, but it turns out that the issue is in running a foreach loop on a single curve. For some reason it worked before, although it shouldn't have! Thanks Andy."
Aug 17, 2012
Andy Payne replied to Tarek Rakha's discussion Error - Foreach and 'GetEnumerator'
"Do you have a class definition for Block (in line: foreach(Block b in blocks))?  As far as I know, Grasshopper doesn't have a datatype for Block, so unless you've defined your own... this might be what is causing the issue.…"
Aug 16, 2012
David Rutten replied to Tarek Rakha's discussion Error - Foreach and 'GetEnumerator'
"What type is boundaries_1? It sounds like a collection of some sort, but if it is a single Curve, then you cannot foreach it. Rhino.Geometry.Curve does not implement IEnumerable and to my knowledge never did. Something else must have gone…"
Aug 16, 2012
Tarek Rakha posted a discussion

Error - Foreach and 'GetEnumerator'

Hello,I've been working on a C# component for quite some time now, and it was working just fine until I installed the new Grasshopper 0.9.0006. That's when this error showed up:"Error: foreach statement cannot operate on variables of type ‘Rhino.Geometry.Curve’ because ‘Rhino.Geometry.Curve’ does not contain a public definition for ‘GetEnumerator’ "  I'm going to assume something changed in rhinocommon. What changed? How do I deal with the part of the script that used a foreach loop on curves…See More
Aug 15, 2012
Tarek Rakha is now a member of Grasshopper
Aug 15, 2012

Profile Information

Comment Wall

You need to be a member of Grasshopper to add comments!

Join Grasshopper

  • No comments yet!
 
 
 

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service