name of object
#2
If you have read the 3D models with Ab3d.Reader3ds, than Reader3ds fills NamedObjects dictionary (Dictionary<string, object>) that have names as keys and objects as values. This dictionary can be used to get the object from its name.

But if you need to get name from the object, I would recommend to convert the NamedObjects dictionary into objectNames dictionary where object is set as key and name as value.

The following code in csharp (sorry I am not very familiar with VB):

// create a new dictionary with objects as values
objectNames = new Dictionary<object, string>();
foreach (KeyValuePair<string, object> namedObject in namedObjects)
{
if (namedObject.Value != null)
objectNames[namedObject.Value] = namedObject.Key;
}

Than you can get the name of your object simply with:

string objectsName = objectNames[hitModel];
Andrej Benedik
  


Messages In This Thread
name of object - by fred_2420 - 11-07-2014, 03:30 PM
RE: name of object - by abenedik - 11-19-2014, 12:05 AM
RE: name of object - by fred_2420 - 01-04-2015, 01:09 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)