Hi, i wrote a plugin in visual studio based on rhinocommon.
Did someone has an idea how to insert a *.3dm file into the actual model using rhinocommon and c#??
I thought it has to do with
RhinoGet.GetFileName(GetFileNameMode.Import,...);
Johannes
Tags: c#, file, import, insert, rhinocommon
Permalink Reply by Dale Fugier on February 26, 2013 at 8:56am Hi Johannes,
Rhino.Input.RhinoGet.GetFileName is really just a customized version of System.Windows.FormsOpenFileDialog. Thus, it just returns a string.
If you want to import a file, then just script Rhino's Import command using Rhino.RhinoApp.RunScript.
I've attached an example for you to review.
-- Dale
Permalink Reply by Johannes Kuhnen on February 26, 2013 at 11:54pm Hi Dale,
thanks alot for the example. It works perfectly fine.
So RunScript gives us the safety that every command is working like Rhino.Command was doing it... Nice to have but i hope that we can get rid of command scripting.
Johannes
Permalink Reply by Dale Fugier on February 27, 2013 at 8:25am Hi Johannes,
Command scripting might seem a little hokey. But in terms of file I/O, it really is the only way to go. You see, every file type you want to import or export potentially has a different set if arguments. Thus, it is not possible to write a generic function that will allow you to open/import/save all file types. Thus the requirement for command scripting.
Hope this helps.
-- Dale
© 2013 Created by McNeel Admin.
