mdlElmdscr_partialDeleteのサンプル


 プロダクト:MicroStation
 バージョン:CE update15
 環境:N/A
 エリア:Programming
 サブエリア:MDL

mdlElmdscr_partialDeleteのCONNECT Edition版は以下の様なコードとなります。

dgnmodelrefパラメーターを明示的に指定する必要があります。

void partialDeleteTest()
{
MSElement myLine;
DPoint3d pts[2] = { {0,0,0}, {10000,0,0} }, pt1 = { 4000,0,0 }, pt2 = { 6000,0,0 };
mdlLine_create(&myLine, NULL, pts);

MSElementDescrP inEdP = NULL, outEdP1 = NULL, outEdP2 = NULL;
mdlElmdscr_new(&inEdP, NULL, &myLine);
inEdP->h.dgnModelRef = ACTIVEMODEL; //VERY IMPORTANT line
if (SUCCESS == mdlElmdscr_partialDelete(&outEdP1, &outEdP2, inEdP, &pt1, NULL, &pt2, tcb->lstvw))
{
mdlElmdscr_add(outEdP1);
mdlElmdscr_add(outEdP2);
}
if (NULL != inEdP)
mdlElmdscr_freeAll(&inEdP);
if (NULL != outEdP1)
mdlElmdscr_freeAll(&outEdP1);
if (NULL != outEdP2)
mdlElmdscr_freeAll(&outEdP2);
}

 Original Author:Mikihiko Tabata