Example of Import/Export Plugin in C#

Hello World,

I am trying to write an import plugin so that Rhino can read directly COLLADA files. Is there any example of an Import/Export plugin in C# so that I know how it could be integrated?

Thanks in advance!

Ayoub

If you use the Visual Studio templates you can instantiate a “skeleton” of a working plug-in. Then only implement what you need to implement.

Where can I find sample code for importing a rhino file while building an import-plugin in C#?
Thanks

A import plug-in for Rhino will import some file format other than Rhino’s.

What are you trying to do? What file format do you want to import?

– Dale

Hi Dale. Thanks for your response.
I am trying build a rhino plug-in which will help me import multiple custom rhino template files. Do I need to store the rhino-template files in a different file format?

– Atharva

Rhino already has worksessions:

Is this all you need? If not, please explain further what you want to do and, specifically, why.

Thanks,

– Dale

I currently have multiple rhino template files which contain a layer and sub-layer setup, display settings, aliases etc. I want to build a plug-in which would give me flexibility on importing either just one or multiple such files to a main rhino file. Ideally this process should run from the rhino-command line which gives you flexibility to import the templates.

In any case, where can I find a solution/example of a C# rhino import-plugin (highlighted part in image below) that is used to import a file format other than rhino’s.

image

Thanks

Hi @atharvaranade4,

Generally speaking, the purpose of a file import plug-in is to read some foreign file format into Rhino. You wouldn’t write a file import plug-in to read Rhino files, as it’s already pretty good at doing this.

Perhaps all you need is a general plug-in that has a command this does what you want? A Python script might even do what you want.

How are you storing this template data? Do you have some kind of file that references the template file?

– Dale

Thanks for your response Dale. I have come very close to coding the import files. Can you help me through this:

I see your first post has been replied to.

– Dale