void convertShareCell (MSElementDescrP sharecell, DgnModelRefP modelRefP)
{
MSElementDescrP celledP = NULL;
if (SUCCESS == mdlSharedCell_toNormalCell2(&celledP, &(sharecell->el), modelRefP, TRUE))
if (celledP->h.elementRef == 0)
// 转化后的celledP 的elementRef 为 NULL ,有什么方法创建一个(临时)呢
}
......
之所有要用这个API方法mdlSharedCell_toNormalCell2,目的是想遍历sharecell 中的所有子elements,
原因是:sharecell element 找不到方法去遍历子elements, 只有通过API 转化为nomral element后才可以遍历,但出现上面提到的问题,转化后elementRef 为空
十分感谢
此调用是在Connect版本环境下调用
试试 MSElementDescr的Duplicate函数
MSElementDescrP dupCell = NULL;
if (SUCCESS == celledP->Duplicate(&dupCell))
if (dupCell->h.elementRef == 0)
// elementRef 还是一样为空
目前我还找不到任何方法去创建一个临时的elementRef
只有已经写入模型的元素才有ElementRef,你转成NormalCell之后,NormalCell并没有写入模型,所以没有ElementRef。不过你需要遍历NormalCell的子元素,并不需要ElementRef啊