Grasshopper

algorithmic modeling for Rhino

Hello,

I've been trying to get the colour value of an object from a vb module but I cant seem to manage.  The objects have been colour coded through another program so I want to use the colour value as a way to reorganize the list's hierarchies (blue has less value than red...).
If I plug the list directly into the colour button it returns false rgb values so that doesn't work either. 
Any thoughts?

Thanks

M

Views: 1389

Replies to This Discussion

Hi Mateo,

sorry for the late response. You can get object attribute information from Rhino provided you have an Object ID.

You should be able to get the ID of any referenced object. Just plug the Object data into a GUID parameter, then use the following script:


--
David Rutten
david@mcneel.com
London, UK
Perfect. Thanks David.

Hello David,

I'm trying to get the color id of mesh objects but i can't get output from the vb component.

Am i doing something wrong ?

all the best,

sinan

You're using the new SDK (RhinoCommon) whereas the example I posted way back then used the old SDK (Rhino_DotNET). Functions, classes and properties have all changed. I attached a file with updated code, but this is what it looks like:

 

Dim obj As Rhino.DocObjects.RhinoObject = doc.Objects.Find(id)
If (obj Is Nothing) Then
  col = Color.Transparent
Else
  col = obj.Attributes.ObjectColor
End If

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

David - is there a way for this script to reference the layer color, rather than the individual object color?

nevermind - found a component in Horster that does exactly what I need.... http://www.grasshopper3d.com/group/horster-tools

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