Notifications
Clear all
[Closed] Exporting using .net
Mar 29, 2014 1:26 am
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
Mar 29, 2014 1:26 am
Usually in C# you check if an object is of a given type by using the βisβ operator
if (obj is MyObject) { }
1 Reply