Limited number of user data


(Karol Wierzbicki) #1

Hi,

Is the number of custom user data, or user dictionaries limited? I can’t work on as big models as I wish, plugin is crashing on user data after appending several hundreds of user dictionaries, one dictionary per element.


(Menno Deij - van Rijswijk) #2

What we typically do is to store up to a handful of strings of Base64 data in a UserDictionary. These strings can be converted to byte arrays, typically holding a few kB, that can be used in Serialization/Deserialization of data classes. This way, only a few entries in the UserDictionary are made.

For serialisation one can use for example the built-in .NET serializer, serialisation to JSON using http://www.nuget.org/packages/Newtonsoft.Json/ or serialisation to Google Protocol Buffer using http://www.nuget.org/packages/protobuf-net/

The protocol buffers are the fastest choice with the smallest footprint, but they do require some extra work to get it right.


(Steve Baer) #3

There is no limit that we know or have set. Are you able to catch the exception that is occurring when the crash occurs?


(Karol Wierzbicki) #4

I get indexOutOfRangeException on random number of element. This time I was able to load around 3800 elements, before I got the exception.

brep.UserDictionary.Set(“Elno”, gelref1.Elno);

Thanks menno, I will check if I can use it in my case.