Grasshopper

algorithmic modeling for Rhino

This recent discussion clearly states that once an object (a curve in my case) enters a script, then the GUID is <poof!> gone. Does that mean I can never find the name of an object that is output from a script?

I have a C# component that painstakingly finds intersections between sets of curves, and outputs a tree where each branch contains curves that intersect. That's fine so far. But I want to then find the names of the intersecting curves, to create some human-readable documentation. But to do that I need the object's GUID, I think (or at least that's how I've been doing it: a simple C# component with a GUID input).

Am I missing something here? I hope so...

Views: 817

Replies to This Discussion

You could accept a list of Guids (or names) and output a parallel tree of Guids at the same time you're structuring your tree of curves - does that make sense?

Thanks, Andrew. It does make sense, but alas, in my case the source of all the curves is another script, one that searches through all objects in the document to find curves with particular names :-) Whoops!

I'm beginning to think that my "clever" idea to use object names to manage complexity is starting to backfire on me, simply because the names are not as accessible (from Grasshopper) as I had thought.

I think I can structure the output so that the object's position implies a name, but it will complicate the script more than I'd hoped. That will be tomorrow's task...

Thanks again.

Can you edit the first script? I can't see any reason why you'd need to derive the name from the object's position - but maybe I'm missing some complexity of this problem.

The only input to the first script is a string: the script finds all curves in the document whose name contains that string. It then constructs several output trees containing the various curves (other parts of the name identify the curve's purpose, and thus what tree it goes in).

So no, there's no easy way, currently, to get GUIDs in there. It's obvious to me now that this wasn't the best architectural choice...but now I have a hard deadline and can't backtrack too much.

However, lessons have been learned! And that's always a good thing. Next time (and there will be a next time), I'll structure things differently.

Thanks again for the suggestions.

Whatever part of that script is doing the "finding" can easily access the Guids at the same time, no? If you are willing to post (or send me) the script I'd be happy to give you more precise suggestions - but deadlines are deadlines, so good luck regardless!

D'oh! Of course! Silly me...thanks so much for the brain bump.

I'm well on the way, examples of getting lists of guids abound. If I run into trouble I'll yell.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service