Where can I get the type library for the V-Ray for Rhino plugin?
Background: I have RhinoScript code that looks like this:
Sub SetVRayRenderOutputSize( width, height )
Dim Vray
Set Vray = Rhino.GetPlugInObject ("V-Ray For Rhino")
If IsNull(Vray) Then
Rhino.Print "***** V-Ray Scripting Object Not Available *****"
Exit Sub
End If
VRay.SetRenderOutputSize width, height
End Sub
I need to re-implement this in C#, controlling Rhino via its COM interfaces. So far, I have this (based on http://wiki.mcneel.com/developer/automation):
Rhino4.Application app = new Rhino4.Application();
int attempts = 0;
object rhino_script_obj;
while (((rhino_script_obj = app.GetScriptObject()) is System.DBNull) && (attempts < 10))
{
Thread.Sleep(500);
}
if (rhino_script_obj is System.DBNull)
{
throw new Exception("Could not acquire RhinoScript object!");
}
RhinoScript4.IRhinoScript script_obj = (RhinoScript4.IRhinoScript)rhino_script_obj;
object v_ray = script_obj.GetPlugInObject("V-Ray For Rhino");
The last line appears to work, in the sense that I get a System.__ComObject, but what do I cast that to? Generally there would be a type library (.tlb) file that I would add to my project as a reference (as I already do with Rhino4.tlb and RhinoScript4.tlb), but I can’t find a type library for VRay anywhere. Anyone know where I can find it?
Thank you for any help.
Background: I have RhinoScript code that looks like this:
Sub SetVRayRenderOutputSize( width, height )
Dim Vray
Set Vray = Rhino.GetPlugInObject ("V-Ray For Rhino")
If IsNull(Vray) Then
Rhino.Print "***** V-Ray Scripting Object Not Available *****"
Exit Sub
End If
VRay.SetRenderOutputSize width, height
End Sub
I need to re-implement this in C#, controlling Rhino via its COM interfaces. So far, I have this (based on http://wiki.mcneel.com/developer/automation):
Rhino4.Application app = new Rhino4.Application();
int attempts = 0;
object rhino_script_obj;
while (((rhino_script_obj = app.GetScriptObject()) is System.DBNull) && (attempts < 10))
{
Thread.Sleep(500);
}
if (rhino_script_obj is System.DBNull)
{
throw new Exception("Could not acquire RhinoScript object!");
}
RhinoScript4.IRhinoScript script_obj = (RhinoScript4.IRhinoScript)rhino_script_obj;
object v_ray = script_obj.GetPlugInObject("V-Ray For Rhino");
The last line appears to work, in the sense that I get a System.__ComObject, but what do I cast that to? Generally there would be a type library (.tlb) file that I would add to my project as a reference (as I already do with Rhino4.tlb and RhinoScript4.tlb), but I can’t find a type library for VRay anywhere. Anyone know where I can find it?
Thank you for any help.
Comment