Notifications
Clear all

[Closed] Exporting using .net

Hi,

I have created an exporter in .net following the 3dsexp.cpp file sample in the maxsdk. I have one problem however, how to check if 2 max sdk objects are the same in .net. Here is some code I want to convert:


oe->tri = (TriObject *)obj->ConvertToType(0, triObjectClassID);

if(obj != (Object *)(oe->tri)) { // this is the line I want to convert to C#
  oe->tri->DeleteThis();
  oe->tri = NULL;
}

This is the code I have in .Net:


ITriObject triObject = o.ConvertToType(0, global.TriObjectClassID) as ITriObject;

if(o != triObject)  // this does not work
{
}

Anyone?

2 Replies

Usually in C# you check if an object is of a given type by using the β€˜is’ operator


 if (obj is MyObject) { }
 
1 Reply
(@lassesundjohansen)
Joined: 10 months ago

Posts: 0

Looks like it did the trick, thanks