Open second instance of rhino and control both

Hi All,

I am working on writing a script to extract some curve geometry from one rhino file and I would like to import it into a second, pre-existing rhino file and perform some secondary operations on it. I can certainly do it by writing an export and import script and use a dummy file to store the info in between running each script. I feel that this is a fairly sloppy way to handle it and more prone to human error which is why I want to do it all from one script. That means controlling 2 instances of Rhino and I have no knowledge of how one might go about doing that.

Is this possible? If so, can someone please provide me some direction on how to do it?



You can edit the contents of other (not currently open) Rhino files. The limiting factor might be what other things you’d like to do to the curves.

You might want to look at the File3dm class in RhinoCommon. It has an object table you can add to. In this situation you would not necessarily be opening a second instance of Rhino, you would just be editing an otherwise not visibly open Rhino File. Do you need the second file to actually be open?

I think if we can better understand what you want to accomplish, we can suggest the best way to go about it.

No, I do not believe I need the second file actually open; I think I can do most of what I am wanting to do in the open file and then just transfer into the second file. Thanks for directing me to that class, I have not used it before. I will dig into the File3dm class shortly!

What I am looking to do is extract a profile from a unit (think large crown molding profiles) in the open rhino file and generate a catalog of unique profiles for the job in a second file. So a few ideas I am wanting to implement in the script around include, comparing profiles, arraying the profiles for easy viewing, placing each profile on its own layer, name the profile (to populate the title block) and probably a few other things that I am forgetting at the moment.

A fantasy script of mine is:
Once the drafting portion is complete I can cycle through the files to determine the linear feet of each profile, then generate a nested cutting file for my CNC Hotwire Cutter with a scale factor to account for my product’s shrinkage rate. I could easily do this if they were all straight runs but I deal with a lot of compound mitered units and units that have multiple profiles meeting.