Object ID

Technical discussions
Post Reply
Ibi
Posts: 19
Joined: Mon Jul 29, 2013 12:44 am

Object ID

Post by Ibi »

Hi
I have a question. I use names of objects to identify them, is there another way of identifying an object?
One can have the same name for different objects which may cause problems. I also use object numbers but a child can
also have the same object number and also these numbers change when objects are deleted. I can ask users to ensure
objects names are unique but if there is more robust way of identifying objects this will solve my problem.
Ibi

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Object ID

Post by nickz »

Ibi,
1. Each section has user data allocated for use by the application only. It is a 32 bit integer. It can be set/read via IUSerData queried form the relevant ISection: http://www.dynoinsight.com/Help/Interfa ... rData.aspx
2. There is also a string which is used only as a layer name to hide/show groups of objects. If you are not using layers the string can also be used to store your text. It is also accessed via IUSerData.
3. Sections also implement IObject_KC http://www.dynoinsight.com/Help/Interfa ... ct_KC.aspx
The GetHash() method returns an integer which identifies the actual object instance in memory. So even if the sections are identical otherwise this hash will be different. This method should be the most useful. I just do not remember it being used much in samples via interfaces. It is used internally in several places.
4. Theoretically you could also use .NET to compare two instances of ISection. I do not remember the exact way. I also not quite sure as .NET might relocate things in memory. C++ does not.

Regards
Nick

Post Reply