Hi,
I have problem when using mdlElement_display(). I have attached code snippet on this mail. I am trying to display line element in the dgn but not displaying. The following code works in Microstation V7 very well but not working in Microstation V8 XM Edition.I don't know problem where occurs will you please help me.
Code Snippet :
int draw_line(DPoint3d pnt[])
{
if(mdlLine_create(&line_elm,NULL,pnt)!= SUCCESS)
{ print_error(MS_CREATE_ERROR, "", TRUE); return FALSE; }
mdlElement_display(&line_elm, NORMALDRAW);
return TRUE;
}
Thanks & Regards,
V.Sathish.
You did not answer Jon's question, though:
Have you tried using, as already suggested, mdlElement_add to be sure that you create a valid line?
Dear Jon,
Thanks very much for replying.
Without mdlElement_add function working in Microstation V7 environment.
V.Sathish
sathish: I am really sorry say still line element not displaying after adding mdlTransient_addElement function.
Regards, Jon Summers LA Solutions
I am really sorry say still line element not displaying after adding mdlTransient_addElement function. Updated code attached on this mail.
It's not clear that you have attempted to implement the transient code provided by Mark.
void Draw_TerminalLine(void) { mdlState_startPrimitive (get_Draw_TerminalLine_point, get_Draw_TerminalLine_reset, 0, 0); } /*-----------------------------------------------------------------------------------------------*/ static void get_Draw_TerminalLine_point(Dpoint3d *ppt,int view) { MSElement el; DPoint3d dpPnt[2]; DgnModelRefP modelRef ; dpPnt[0].x = dpPnt[0].y = 10.0; dpPnt[1].x = dpPnt[1].y = 20.0; dpPnt[0].z = dpPnt[1].z = 0.0; mdlLine_create( &el, NULL, dpPnt ); mdlElement_display( &el, NORMALDRAW); exit(0); }
Your code creates a line element, displays it, then exits. You have (i) not added the line element to the model, and (ii) you have not attempted to create a transient element. There is nothing to display.
Hi all,
From still i will not get the solution for displaying element. I have attached zip file on this mail. This mdl project line displaying in V7 version but not in V8 XM Edition. Please modify this attached code give to me. Without using "mdlElement_add" function.
Give me a solution.
sathish: mdlElement_add function without using I want to display the line element. We construct a temporary line finally we call mdlLinestring_create function. So please tell me without using mdlelment_add function.
I know that you want to display the element temporarily. However, you have told us that you can't persuade the transient functions to do what you want. I asked you to use mdlElement_add in order to be certain that you really are creating a line element and that the line appears in the right place.
None of us can see what you are doing, or how MicroStation behaves with your MDL code. If you want help in diagnosing your problem, then you have to cooperate.
Attached is some sample code that uses the transient element descriptor.
HTH,
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
sathish: Dear Jon, Still line element not highlighting. ... msTransientElmP = mdlTransient_addElement (msTransientElmP, &line_elm, 0, 0x00ff, DRAW_MODE_Normal, 1, 1, 1);
Still line element not highlighting. ... msTransientElmP = mdlTransient_addElement (msTransientElmP, &line_elm, 0, 0x00ff, DRAW_MODE_Normal, 1, 1, 1);
Why should it highlighting? You are creating transient as normal draw not hilite.
Dear jon,
mdlElement_add function without using i want to display the line element. Because Our functionality we construct a temporary line finally we call mdlLinestring_create function. So please tell me without using mdlelment_add function.