Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts
Friday, December 10, 2010
how to port Excel data to GH
original source link
Dim xlApp As Object
''Grab a running instance of Excel
xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")
''send volume and area to Excel
xlApp.range("B12").Value = volume
xlApp.range("B13").Value = area
Thursday, September 2, 2010
Backing Objects with colors
Link: http://www.grasshopper3d.com/forum/topics/error-in-old-vb-code
If blnBake Then
'Bake Object
Dim mObj As New MRhinoBrepObject
mObj = doc.AddBrepObject(obj)
'Find obj attributes to change color
Dim att As New MRhinoObjectAttributes(mObj.Attributes())
att.SetColorSource(1) 'set color source to From Object
Dim rColor As New OnColor (color) 'make OnColor
att.m_color = rColor 'Set Object Color
'Modify the attributes
Dim objref As New MRhinoObjRef(mObj.Attributes.m_uuid)
doc.ModifyObjectAttributes(objref, att)
End If
If blnBake Then
'Bake Object
Dim mObj As New MRhinoBrepObject
mObj = doc.AddBrepObject(obj)
'Find obj attributes to change color
Dim att As New MRhinoObjectAttributes(mObj.Attributes())
att.SetColorSource(1) 'set color source to From Object
Dim rColor As New OnColor (color) 'make OnColor
att.m_color = rColor 'Set Object Color
'Modify the attributes
Dim objref As New MRhinoObjRef(mObj.Attributes.m_uuid)
doc.ModifyObjectAttributes(objref, att)
End If
Subscribe to:
Posts (Atom)