Closed mostaphaRoudsari closed 9 years ago
Nah, I just didnt know any better way, plus I was considering making that be a user input. I will implement your function, that seems to be a good idea.
So like I have mentioned in my email for some reason path to Rhino is not part of the os.environ["PATH"] which causes this function to return NULL when asked for "Rhino.exe". Also, the initial check of the home path os.access() is not returning the right path since that's the Revit folder for the Dynamo. I am not sure how to proceed with this, but I will keep looking at different solutions. In the meantime i included RhinoCommon.dll with Mantis Shrimp install in the "bin" folder and added a path to look there if all other fail. This ensures that you at least will always be able to get it to work. I understand that this might be a small violation of Rhino license, but I am out of options at this point, unless I want users to specify that path manually.
@ksobon you are right. When you run the script from Grasshopper side it does add Rhino folder to path so you can find it but it is not happening on Revit side.
In the meantime i included RhinoCommon.dll with Mantis Shrimp install in the "bin" folder and added a path to look there if all other fail. This ensures that you at least will always be able to get it to work.
I don't think it is a good idea. Violation is violation - there is no small or big for this in my book.
I think the best solution is to to save the folder in an ASCII file in user's MantisShrimp folder. You can either do it from Grasshopper side or add a new node on Dynamo side to SetRhinoPath. The code will try to find RhinoCommon based on your best guess and if it finds it then it will write it to the file in MS folder. In case it fails to find the path then it gives a warning to user to define the path using the same component and write it to the file. The file will look something like this: {"RhinoCommonFolder" : "WhateverPath"}
All the other components will look to this file to find the path and if the file doesn't exist then they give a warning to user to set the path using SetRhinoPath node.
@mostaphaRoudsari I am not sure how you came up with this idea that redistributing RhinoCommon.dll is actually some sort of violation of Rhino's license. RhinoCommon is an open source project. It's perfectly fine to distribute it with Mantis Shrimp. Here's a link: ://github.com/mcneel/rhinocommon Are we good? :-)
Ha! You are right. My bad! The license says that you can do it with no problem. Then you have already solved this issue. I'm closing this.
@ksobon I see that you have multiple paths for RhinoCommon but Hiram just showed me that it still fails on our systems here. Is there any reason that you don't use a method to find it instead of guessing? Function below should do it for you.