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

Re: [v8i SS2 MDL] Getting level ID of a Cell

$
0
0
Hi Jon & Brien,
Thank you for your valuable information and help.Below code solved my problem. I am not checking element type is CELL_HEADER_ELM because I used MODIFY_REQUEST_NOHEADERS option which means never call eleFunc for the headers of complex elements.
// Get level ID of a nested cell
void akElmdscr_getLevel
(
MSElementDescr **edP,
ULong *levelid
)
{
*levelid = 0;

#if defined (MSVERSION) && (MSVERSION >= 0x8b0)
mdlModify_elementDescr2(edP,ACTIVEMODEL,MODIFY_REQUEST_NOHEADERS, naElmfunc_getLevel,levelid,0);
#else
mdlModify_elementDescr(edP,ACTIVEMODEL,MODIFY_REQUEST_NOHEADERS, naElmfunc_getLevel,levelid,0);
#endif
}


/* Element function to get level of first element after the header */
int naElmfunc_getLevel
(
MSElementUnion *elP, /* <=> element to be modified */
UInt32 *levelID, /* => user parameter ( level of elmdscr ) */
DgnModelRefP fileNum, /* => file # for current elem */
MSElementDescr *elmDscrP, /* => element descr for elem */
MSElementDescr **newDscrPP /* <= if replacing entire descr */
)
{

if(elP->ehdr.isGraphics)
{
/* Get level of the element */
mdlElement_getProperties (levelID, NULL, NULL, NULL, NULL, NULL, NULL, NULL, elP);
return (MODIFY_STATUS_ABORT); /* Level got, abort process */
}
return (MODIFY_STATUS_NOCHANGE);
}
Regards,
Ahmet Sedat ALIS

Viewing all articles
Browse latest Browse all 1677

Trending Articles



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