walkinside / sdk

Develop powerful desktop and web applications on top of Walkinside 3D engine
4 stars 4 forks source link

IVREntityManager Create method is sequence of results returned defined ? #36

Closed griemens closed 7 years ago

griemens commented 7 years ago

Hi,

IVREntityManager in Walkinside Viewer SDK has the following method to create entities. IEnumerable Create(IEnumerable<KeyValuePair<string, IDictionary<string, object>>> entityData);

I was wondering if the sequence of entities returned is the same as the sequence the keyvalue pairs are passed as argument.

For example is following code valid

  MyObject[] myobjects = GetAllObjects();
  KeyValuePair<string, IDictionary<string, object>>[] myobjects_values =   GetAllObjectsProperties(myobjects);
  int index = 0;
  foreach(var entity in EntityManager.Create(myobjects_values)
  {
    myobjects[index].Entity = entity;
    index++;
  }

The above code is assuming the entities returned is in same order as the myobjects_values passed as argument.

Thank you,

kveretennicov commented 7 years ago

Sorry for the delay, the team is quite busy these days. As far as I can tell - the answer is yes, result order matches input order .

kveretennicov commented 7 years ago

We updated SDK documentation for the next package to say that entity creation result order follows input order (like it's done for branch creation).

griemens commented 7 years ago

Thats good news, my assumptions were correct. Thanks