In attempting to better understand the IViewTransients interface, I've modified the ViewTransients example developed by Jon Summers. That example uses _DrawTransients() to draw several graphics on the view. I see that when the TransientHandler is initially added to the ViewManager, a RedrawElems struct is created and various params set. Finally, a call to DoRedraw() is used to initially invoke _DrawTransients(). Once inside the _DrawTransients() function, The DrawPurpose is checked and things are created using various IDrawGeom functions. I tried a simple test: based on the DrawPurpose, I wanted to change the color of a drawn item. So I used DrawLingString3d() with different colors. I expected the initial graphics to be drawn with the one color (DrawPurpose::TransientChanged) and as the cursor was moved (DrawPurpose::Pick) I expected the line to be redrawn with the other color. It wasn't. I *think* the transient stuff does not heal itself automatically. Does the initial display (DrawPurpose:TransientChanged) need to be "erased" in order for the same thing to be drawn again using a new color? If so, how do you perform the "erase"?
Bruce
IViewTransients are rendered into the scene just like persistent elements, they do not get drawn every frame which is why you need to use RedrawElems to force a heal outside of a full update of the view whenever you add or remove them. If you want something that changes with the cursor position and can be drawn every frame using IViewDecoration is more appropriate.
HTH
-B
I mentioned using RedrawElems with normal draw and erase to update a transient preview in your question about DgnElementSetTool...
https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/158273/connect-c-dgnelementsettool-and-dynamics-when-picking-multiple-elements
Yes - that reply is why I'm trying to understand how to use Transients. While I don't need the display to change with EVERY cursor movement, I would like to change it based on the cursor's position relative to a "selection". Specifically, the tool is picking two elements. If those two elements intersect, I wish to place a "jumper" symbol on one line and partially delete (clip) that line. The orientation of that jumper (to the left or to the right) would be dependent on the cursor's position relative to the element that is being "clipped". So, as the cursor moves across the line (prior to the acceptance datapoint) I would like the jumper's direction to follow (change).
I'll go back to my tool code and try some more. My initial efforts using a transient did not success so I implemented the more typical dynamics approach, redrawing each frame. I'll try the transient approach again and see if I have more success.
Bruce Reeves SRNS said:The orientation of that jumper (to the left or to the right) would be dependent on the cursor's position relative to the element
I don't think that you need a transient for that. Just create the jumper in your _Dynamics event and draw it.
Bruce Reeves SRNS said:I wish to place a "jumper" symbol on one line and partially delete (clip) that line
The partial delete might be a bit trickier. Do you want to hide the original line while you show its clipped results in _Dynamics?
Regards, Jon Summers LA Solutions
Jon Summers said:Just create the jumper in your _Dynamics event and draw it.
That's what I do currently. Just thought a transient may be more appropriate since it isn't required to change on every mouse movement - just when the cursor changes the side of the line....
A transient would be fine for this, but you couldn't change that transient if you also have dynamics active as healing is disabled during dynamics.
Plenty of tools, ex. "place cell", draw potentially large non-persistent geometry every frame. I'd just use dynamics, take the simple/straight-forward approach, introduce complication only as necessary.
If anyone knows who to use the old jumper.vba in the new Microstation Connect, I am interested to know how. Our site used it years ago in v7 but no one could figure out how to use it in V8i. It would be nice to have it again, as we use the step often on P&IDs. As of now, our site had to go back to manual drafting of chopping the line in to and adding arc at the crossover point.
Joshua Linscomb said:If anyone knows who to use the old jumper.vba
Please create a new post. This question is about C++.
Let us know your exact version of MicroStation CONNECT.
Most VBA macros work in CONNECT just as they did in earlier versions of MicroStation. Just copy the .mvba file to a location known by CONNECT (e.g. ..\Worksets\Standards\macros).
.mvba
..\Worksets\Standards\macros
Joshua Linscomb said:Our site used it years ago in v7 but no one could figure out how to use it in V8i
VBA didn't exist in MicroStation v7. It may have been a BASIC macro. V8 and CONNECT provide VBA; CONNECT does not support BASIC.