algorithmic modeling for Rhino
Hi All,
I have been googling all morning and have not found anything on what I am looking for.
I am really interested in creating an 'interactive' model - i.e. if you select an object in Rhino Space, it triggers a grasshopper definition and performs an action (I.e. drawing a graph in the model space, only while the object is selected).
Has anyone looked into this at all?
Regards
Lyndon
Tags:
It works, but it's not pretty code and I'm not (ever) removing the handlers, so when the Grasshopper document which contains this C# component goes away it will be kept in memory until Rhino shuts down.
David,
This is fantastic, thank you.
When you say when the grasshopper code 'goes away' it will be kept in memory - are you saying the objects created will remain in memory - or the code remains in memory?
What I am keen to do is select 'instruments' in a Dam 3D model (water level instruments etc) then, depending on the instrument, when it is selected, read the correct data column out of excel.
I think i can use your definition, then use the object ID's from Rhino with if statements to to return the correct data sets. Is it easy to retrieve the Rhino object ID though the C# script?
Cheers
LJ
Hi David,
Im not sure if that would be a problem or not, best thing for me to do will be to get the definition working on on of my models - and ill see how it works. Once I have something working I can upload something for comment? Should give you some context on the project.
Have tried the GUID component. Only problem i have run into is i tried to feed this into a VB If statement and am getting errors.
If x = 32a6738d-65de-44fd-aa4a-53842af54c38 Then
A = 1
End If
1. Error (BC30205): End of statement expected. (line 83)
Tried to convert to a string and got an error that GUID cannot convert...
Can you advise on how I can correct the above?
Cheers
Lyndon
All sorted, put it through a parameter viewer first - then it works (I figured this out trying to show a colleague the error i was getting!)
Cheers.
This is not valid VB code:
If x = 32a6738d-65de-44fd-aa4a-53842af54c38 Then
Guids cannot be written like that, you'll have to actually do something like New Guid("32a6738d-65de-44fd-aa4a-53842af54c38").
This worked, Thanks David.
I have done a simple 'proof of concept' only, by creating 4 objects and using their (X,Y) locations to select which data to graph out of excel. As you click on each object, a different graph is displayed.
I need to write a def. to do an X-Y scatter plot - so once I have got that together will post the example for others reference.
If you know code for C# that would retrieve the object ID that would be excellent, as it would be a much more robust solution.
Cheers
Lyndon
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by