Announcement

Collapse
No announcement yet.

Looking for VfR Type Library

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Looking for VfR Type Library

    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.

  • #2
    There's a sticky item in the General section of this forum with some discussion about V-Ray scriptable functions; here's a relevant excerpt from that discussion:

    ...
    There used to be a way to get this information to load up in the MonkeyScriptEditor plugin, but since that has been added to the core of Rhino, it seems that it's not really possible anymore. So the best way to view this information, would be to open our tlb file (C:\ProgramData\ASGVIS\VfR(insert rhino version info here)\VRayForRhino.tlb) with Microsoft Visual Studio, or some other 3rd party tool (be careful!)...

    Comment

    Working...
    X