Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8532

How to save plugin preferences to 3dm file

$
0
0

Hi everyone,

I have preferences in my plugin like language, unit, default values for objects and these objects can change by user in file. But when I save, close and open file again, of course these changed preferences return default values, because I didn’t save them anywhere. I am wondering what is the best practice to save some .json preferences to .3dm file. There is File3dm object but, it’s not clear for me how to use it.

I basically want to achieve to save this file to 3dm file.

{
   "Preferences": {
   "Unit" : "SI",
   "Language" : "English",
   "DefaultObjectProperty1" : 5,
   "DefaultObjectProperty2" : 3,
   "DefaultObjectProperty3" : 2.5,
   }
}

Then, when user open file again, I want to read preferences from file3dm.

Should I initialize this object or 3dmFile has some implicit methods to save without initalizing?

File3dm file = new File3dm();

Thanks in advance
-Oğuzhan

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 8532

Trending Articles