I have a question regarding opening a gh file from another gh canvas. I can open a gh file in another gh canvas. But, I can’t compute both of them simultaneously. When I open a gh file in a canvas with python, it is opened in the same rhino file. I think, I should create a new Rhino document inside of canvas and open the gh file in this Rhino document. Do you know, how can I do it?
thank you for your response. Yes, I need to solve 4 file in parallel. I thought about hops. But, we can’t afford hops (core billing because of using windows server) at the moment. I developed a component for my case. It works well. But, I need to open these 4 files in batch mode simultaneously. I can open these files in grasshopper sequently or with python outside in the same time. It doesn’t matter. However, I could open only one file until now. Do you have any suggestion?
if you use windows server, you have to have core-billing licence. I spoke Andy before about it and I think I don’t need so sophisticated component. I should only be able to open 4 different files in parallel. Therefore, I would be appreciated, if you help me with python code
Not sure if we are understanding each other. You want to solve 4 definitions at the same time, on your computer right? You don’t need windows server for this. Just get the Hops component from the package manager, and restart Rhino / GH. This will run a Rhino.Compute instance on your computer (running Windows Desktop OS), and the Hops component will use that to solve the other definitions in parallel. No Windows Server or core-hour billing needed.
If you want to solve these 4 different files remotely, then yes, that is when you might need Windows Server and core-hour billing.
Maybe take a look at the “Read 3dm file” component in the Human plugin. It allows you to import objects from external files. Not sure if you need to edit the files or just read the objects. If you use this method you can operate on the data simultaneously using data-trees:
I’m using a workstation, which has windows server. I can’t change it (the decision is not from me). In addition, it would be also better, when I solve these files remotely. My system works well apart from openning files now. I need only to open four files simultaneously.
I don’t have a problem to import or export the objects. But, I’m trying to solve the files remotely. For that reason, I need to open 4 different files simultaneously. Then, my code can solve the files correctly.
Therefore, “Read 3dm file” can’t help in my case, I think. I wrote the following code. If I run this code outside from Rhino, it opens one GH-File. However, a for loop doesn’t work(of course with appropriate change in the code). The code changes only current GH-File, not opening four files in parallel. If I run this code inside of canvas, the code changes the current canvas.
import rhinoscriptsyntax as rs
from Rhino import RhinoApp, RhinoDoc
from Rhino.Geometry import *
import rhinoscript as rs
rs.application.Command("-SaveAs " + “delete.3dm”)
gh = RhinoApp.GetPlugInObject(“Grasshopper”)
out = True
Hopefully, I could explain, what I really need. Thank you for your help
I’m not entirely sure about the topology of what your trying to archive, in terms of what runs first and all that. But that being said Rhino is a single monolithic application if your running your Python code from within Rhino, so For Loops are sequential by design. I think @fraguada’s solution of using hops for this might be the only way to archive your goal of concurrent computing all GH files in parallel. You can limit the number of Child Processes it spins up to 1 but at that point your calculating in sequence again.