Quantcast
Channel: MicroStation Programming - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 383

[V8 MDL] Checking Element's Named Group

$
0
0
Hi,

I want to check whether an element is a member of a particular named group.

Here my code:
I know the name of the group. It is 104.

MSElement elm;
ElementRef elmRef;
NamedGroupMemberP pNamedGroupMember;
NamedGroupP pNamedGroup;
MSWChar uniGrpName[10];
long pIndex;

mdlNamedGroup_findByName (&pNamedGroup, NULL, NULL, uniGrpName, MASTERFILE);
if (pNamedGroup != NULL)
{
elmRef = dgnCache_findElemByID (mdlModelRef_getCache (MASTERFILE), mdlElement_getID (&elm));
pNamedGroupMember = mdlNamedGroup_findMemberByElementRef (pNamedGroup, &pIndex, elmRef, MASTERFILE);

if (pNamedGroupMember == NULL)
{
mdlDialog_openInfoBox ("xx");
MarkError (filePos);
}
}
else
{
MarkError (filePos);
}

The 'mdlNamedGroup_findByName' function returns the named group object. But the
'mdlNamedGroup_findMemberByElementRef' function returns Null object, though the element is a member of that group.
Please see the attached screenshot.

Can anyone suggest me, what goes wrong in my code.

Thanks & Regards,
Siva

Viewing all articles
Browse latest Browse all 383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>