Grasshopper

algorithmic modeling for Rhino

Thanks very much!

Views: 4186

Replies to This Discussion

BTW, I can't get the drop-dowm list by key in "." behind a List<> object when I update GH to 0054

Yeah it's broken. I'm awaiting a fix from the QWhale people. They claim the next version will work again but they won't tell me when.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

You mean the InstanceGUID or the ComponentGUID?

Also, what programming language are you using and where is your code running from?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

David,

I know this post is a bit old but I have been looking in the discussions for a way to find GUID's of instances in Grasshopper and I have not found a good explanation yet.

My understanding is that this C# script gets the ID of the input of the component:

List<Guid> guids = new List<Guid>();

foreach (IGH_Param param in Component.Params.Input)
{
foreach (IGH_Param source in param.Sources)
{
guids.Add(source.InstanceGuid);
}
}
A = guids;

I understand that I can get the Rhino GUID of referenced geometry in GH but that's not my aim.

What I would like to get is the GUID for Grasshopper Geometry (curves, points or breps etc...).

Any hint on that?

Thank you very much.

What do you mean exactly? What are you trying to accomplish? I'm not certain GH geometry types even have GUIDs... There's a property on IGH_GeometricGoo called ReferenceID but none of the geometry I pass it seems to yield a result. In any case, I think this property only refers to the Rhino GUID of referenced geometry. 

Hi Andrew, and thanks a lot for your answer.

I'll try to be more clear; Let's say I have 20 lines in Grasshopper and I want to name them somehow (Line1, Line2...etc) and write some properties attached to them (length, coordinates and more) in Excel.

Later on, let's say that I modify my Grasshopper model (add more lines, delete some and add some new lines). At this point I want to know which line was deleted, which one was modified and which one was added.

The Rhino GUID would be good for this but every time I change my Grasshopper model and re-bake the new geometry the elements get a new GUID and this makes it impossible to keep track of them. I couldn't find any GUID for Grasshopper geometry either but I thought you guys might know a workaround for it.

Thanks for your help.

yeah... I'm not sure there's any mechanism for doing this. Maybe David has some suggestions. You could conceivably attach some data to their userdata/ userdictionary and use this to track, but I think it depends on the mechanism by which you're adding, modifying, and deleting these lines. Generally in GH an entire set of geometry is modified at once.

If you're dividing a line 20 times you'll get some set of points, and if you divide the same line 10 times later, you'll get some points which have been "deleted" and some which are in the same place as others were - but are these really the same point objects? Probably not. If I were you I'd use some identifiable geometry characteristics to make up some sufficiently detailed naming scheme to describe the line's position completely - and then use this to check for same/new/removed.

There is no mechanism for this. Types do not have IDs, nor do instances have IDs. The only way to identify data instances is by their position within a DataTree.

[...] but are these really the same point objects? Probably not.

Indeed they are not.

Thanks for the answer guys.

I'll revise my thinking then and see if I can work this out in another way.

I have te same problem, do you maybe have found already another solution to still find the elements that have be changed or you want to change?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service