THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 14/01/2012 at 10:07, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
Hey guys.
There's all kinds of of good stuff in the archives on getting points and polygons from selection tags. But not one of them shows how to create the selection tag itself.
I'm trying to use AutoAlloc. And I'm getting all kinds of crashing problems.
BaseDocument *doc = GetActiveDocument();
BaseObject *obj = doc->GetActiveObject(); //Start out using BaseObject to grab the polygon object
PolygonObject *pobj = ToPoly(obj); //Cast the BaseObject type to a PolygonObject type and assign it to a variable "pobj"
AutoAlloc<SelectionTag> st(Tpolygonselection); //Create a selection tag
/// Up to this point. Everything seems to work properly ///
pobj->InsertTag(st,NULL); // <--OUCH!! crashes C4D!
I also tried to use MakeTag() and that crashes too.
I'm missing something really simple. But I can't see it.
How do I insert the tag on the object properly?
-ScottA