Unknown said: If I add element descriptor before applying new symbology, it is displayed properly. I checked the code, there isn't something wrong about updating element descriptor using mdlElmdscr_xxx functions. I also tried to use mdlElmdscr_validate() but it doesn't solve the problem too.
So what does the code that "applies new symbology" look like...because that certainly sounds like the source of the problem since you say it's fine if you don't call it? If this element then displays on a full view update, it most likely means your code to set symbology has messed up the element's range somehow. You should also have problems locating this element.
Calls to any of the mdlElmdscr_display functions are ignored outside of dynamics...so you can stop wasting your time with that...
NOTE: mdlElmdscr_validate does nothing if the isValid bit is already set; depending on what is done with mdlModify_ functions and nested complex elements it's not always cleared on the outermost complex header. Also mdlElmdscr_validate only unions component element ranges to update the range of complex headers, it the component ranges are messed up, they won't be corrected.
Thank you so much Brien.
I commented all modification functions that are applied to element descriptor, but still element descriptor is not displayed after added to design file.
If element modification functions cause this problem then how can "Update View" command fix the element and make it visible? I think it is using the same logic to display element which mdlElmdscr_add() calls.
Kind regards,
Sedat AlisAEC Technology Inc.
Unknown said:mdlElmdscr_add (*cellDP);
Where do you get that cell descriptor? Is it copied from a cell library?
Regards, Jon Summers LA Solutions
Unknown said:If element modification functions cause this problem then how can "Update View" command fix the element and make it visible? I think it is using the same logic to display element which mdlElmdscr_add() calls.
If an element's range is wrong, the heal region from the add may not overlap the graphics so when we visit the dirty sub-rect to heal the view you don't see the graphics.. On a full update as long as the bad range overlaps the view you'll see what gets drawn even though it doesn't overlap the element's range.
Unknown said:I commented all modification functions that are applied to element descriptor, but still element descriptor is not displayed after added to design file.
I thought you said in your original post that the problem only happened if you called your modification methods? Going to need to see more code...
Hi Jon. Yes it is copied from a cell library using mdlCell_getElmdscr().
Unknown said:Yes it is copied from a cell library using mdlCell_getElmdscr()
A line of code is worth 1,000 words. We can guess that you are using mdlCell_getElmdscr, but we know not how you use it. Why not post a larger snippet of code that shows the fuller picture...
That way, we don't have to continue guessing how you use MDL.
Thank you Jon, you are right. At the moment, I can't localize the problem amoung thousands of lines. :)
I am modifying elements using mdlModify_elementDescr2() function. Modified element descriptors contain nested cells, so when I find a cell header inside element descriptor, I am getting a new cell from the library and returning MODIFY_STATUS_REPLACEDSCR status code from modify function. This was working fine under MicroStation v8 2004 Edition. I am not sure what was changed in MicroStation v8i SS2.
Unknown said:I am modifying elements using mdlModify_elementDescr2
Well, that moves us one step forwards.
How do you call that function? In particular, what are your MODIFY_REQUEST_XXX complex flags, and what are your MODIFY_XXX modify flags?
Private int modMatFunc( MSElementUnion *elP, // <=> element to be modified ChangeElm *user, // => user parameter DgnModelRefP fileNum, // => file # for current elem MSElementDescr *elmDscrP, // => element descr for elem MSElementDescr **newDscrPP, // <= if replacing entire descr ModifyElementSource elemSource // => The source for the element);
Unknown said:mdlModify_elementDescr2(cellDP, ACTIVEMODEL, MODIFY_REQUEST_HEADERS, modMatFunc, &cellStruct, 0 );
You should see a compiler error for that invocation. Assuming that cellDP is an MSElementDescr*, it should be:
mdlModify_elementDescr2(&cellDP, ACTIVEMODEL, MODIFY_REQUEST_HEADERS, modMatFunc, &cellStruct, 0 );