Grasshopper

algorithmic modeling for Rhino

I've been trying to use the File3dm methods to save an instance of rhino geometry to a 3dm file. 

I haven't had luck writing code that can connect the instance (ie. a grasshopper brep) to its original rhino brep.  Can someone please direct me to the methods are out there that will enable this?  I've looked at rhino commmon but haven't been lucky in finding the right method.

Views: 3076

Replies to This Discussion

Hi Tree,

are these two separate questions? Are you having trouble creating and populating a File3dm instance or are you having trouble figuring out which -if any- Rhino brep is associated with a Grasshopper brep?

--

David Rutten

david@mcneel.com

David - thanks for taking the time to help.

I've been able to make a file that opens successfully when saved, I just haven't been able to place the brep that should be saved into the file.

Some code would be helpful. How is the Brep declared, where does it come from?

--

David Rutten

david@mcneel.com

Their isn't really any code - the brep isn't generated in grasshopper but rather is sitting in rhino as an existing object. I want to save it out to a new file after grasshopper sorts it.

See attached.

--

David Rutten

david@mcneel.com

Attachments:

David,

Is there a way to do with completely within c#? I'm writing a custom component and I'd like to eliminate the need for someone to connect an "ID" component to produce the definition.

Sure, but by what logic do you choose which breps/curves etc. to select from the document?

--

David Rutten

david@mcneel.com

I'm passing a known brep (a brep that has been introduced to the component through the standard GH brep parameter) into a definition.  I'd like to take that same brep (ie the original Rhino brep) and save it out to a 3ds file.

If you're doing this in a script component then that won't work. Any breps that go into a script component have all their non-geometry data stripped and you can no longer tell what GUID it used to have. The only way around this by using a GUID parameter instead of a Brep parameter. 

In Visual Studio this is possible as you can get the IGH_Goo.

On the other hand, any brep in Grasshopper (whether or not it came from Rhino) can be placed into a File3dm instance as well. What would the difference be?

--

David Rutten

david@mcneel.com

David,

It would be very helpful to see a simple example of this in code if possible.  I'm connecting this issue to the thread stated a couple of days ago because I'm still not finding any success with selecting an original instance of geometry.

Basically I have a brep in grasshopper that should link to it's rhino brep - but am having no luck writing code that ties the two instances together so that the rhino instance can be saved out into a 3ds file.

In respect to the logic, I'm really not sure it matters. If I can pass the brep object directly from (DA!.GetData(...)) I would.

Here is the other thread: http://www.grasshopper3d.com/forum/topics/replacing-a-rhino-object-...

You mention 3DS file here, implying export to a different file format. Later, it's 3dm. I guess it's a typo. Is there a way of exporting to OBJ or 3DS directly from IGH_Goo ? I'm currently converting, then adding to activedoc, and running the export script. 

Thanks

Hello David. i was looking your script. But i am having problems with the ID. What i am trying to do is to save geometry that is internalized in grasshopper. and can you gime where i can find more info about de GH_Goo.

Thanks

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service