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

Views: 291

Replies to This Discussion

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

Attachments:

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

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

RSS

Translate

© 2014   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service