Grasshopper

algorithmic modeling for Rhino

Through vb.net I am trying to select all current points. Basically, the Edit>select objects>Points in Rhino, so that grasshopper has all existing points. 

thanks,
Tim

Views: 1322

Replies to This Discussion

Any particular reason why you'd like to do this? Is retrieving all the points within a parameter in GH, then passing that to a scripting component not satisfactory? You can do this, but you'll have to use an object iterator and deal with MRhinoObjects as well. It can be done, but I'm just not seeing where the advantage is over just supplying the points through GH.

http://en.wiki.mcneel.com/default.aspx/McNeel/SdkObjectIterator
Well, I was trying to put together an Image tracking def. with the goal of having a polyline track the movement of a red dot taken from a webcam (done outside of grasshopper). So once the deff finds the red dot then it uses ModeLabs Bake component (with the boolean set to true) to bake the point everytime it moves to a different location. This is where the script came in. Then the script hopefully would grab each of these points which have been created by the Bake component and create a polyline. Let me know what you think. This could be a good exercise to really help me learn vb.net if pointed in the right direction.
thanks!
-Tim
Attachments:
So if I understand your correctly, your reason for wanting to grab all the points in the document is to have a record of the movement of the different iterations of solving this definition. If I do understand correctly, then I think there might be a better way to go about this. I guess you could continue on with your approach, but here's how I would attack the problem...

The main issue here is storing the points from the previous iterations, which I'd just take care of through a text file. Pass the point of the current iteration into a script component along with the path of the text file in question. Read all the existing points that are in that text file, then add the point that's been passed in to the file and the list of points that you've parsed, then make your polyline from your list of points.
Exactly Damien. The problem is this. I was planning on using processing to capture an image from a webcam every second or so and it would save to the same location and file, overwriting each time. Grasshoppers image sampler is linked to that single image and therefore, almost, has a video feed in grasshopper. But this means that it has the same data path each iteration.
I tried streaming the data file to the .txt but I cannot figure out how to just add to the array rather than overwrite it. Any clues??
thanks so much.
Interesting.. How about reading the txt first, adding new stuff on it through concatenation, and writing it again?

Ouch! just tried it and puts GH into a infinite loop.. because everytime it writes to it, it changes the file attributes, so the file parser detects a change in the object and reads it again and ends the loop with writing it again!

Let me now a try a work around to that..
All the reading and writing would need to be done within the same scripting component in order for this to work correctly. If your relying on the parser in the post it notes, then it would certainly go haywire.
Hmm... I figured (two forced 'end process's later).
There is no way one could use that.

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