THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/03/2012 at 11:47, xxxxxxxx wrote:
Sorry to hijack this thread into C++ land. But maybe seeing it working in C++ will help Python users.
Do you have a more complete example of this David?
There's no information about this in the forum archives.
I've been trying to figure out how to get the index number from the moselection tag. And toggle them on/off as needed. And I'm not having any luck.
I can get all the parts. But I can't figure out how to make them work together to toggle the bits in the moselection tag.
The parts of the moselection code:
BaseObject *obj = doc->GetActiveObject();
if(!obj) return FALSE;
BaseTag *moSelTag = obj->GetTag(Tmgselection,0); //Look for a moselection tag starting from the first tag
if(!moSelTag) return FALSE;
LONG bits = moSelTag->GetAllBits();
GetMGSelectionMessage *gms = NULL; //Create a struct that will hold the selection data
BaseSelect *sel = gms->sel;
BaseSelectData *bsd = sel->GetData();
bsd->a;
bsd->b;
LONG count = sel->GetCount();
GePrint(LongToString(count));
SelectionTag *tag = static_cast<SelectionTag*>(obj->GetTag(Tmgselection)); //Cast the moselection tag to a BaseSelect type variable
BaseSelect *sel = tag->GetBaseSelect();
LONG count = sel->GetCount();
GePrint(LongToString(count));
I've got all this stuff to work with. Yet I still can't use them to find and toggle the various moselection bits.
I keep getting strange bit results. And crashing in my experiments.
-ScottA