This question was never truly answered over 5 years ago, so I am asking again.
I can select a text node in the Element Information dialog box and change the text node to View Independent. And then, the entire Text node retains its rotation as the view is rotated. But the code to build a text node specifically prevents one from assigning View Independence to a text node.
If you assign it to each element, then, they rotate about their origins but their origins, being View Dependent, continue to rotate and the result is what I call the Ferris Wheel effect. Like the benches on a Ferris Wheel, the text elements remain upright, but eventually, the upper line of text is below the lower line of text. And the angles in between, often result in the two pieces of text overlapping each other.
How is one supposed to create an element which is clearly supported by the software, in VB, that does what we need? A true View Independent Multi-line Text Node!
caddcop said:How is one supposed to create view-independent text node element which is clearly supported by the software, in VB
When we create a text node element with MDL we pass a TextParamWide parameter. TextParamWide.viewIndependent is a flag that, presumably, does what you think it should.
TextParamWide
TextParamWide.viewIndependent
VBA works in a quite different manner to MDL. You would need to wrap mdlTextNode_createWide() in VBA. Here's its VBA declaration from the MDL documention...
mdlTextNode_createWide()
Declare Function mdlTextNode_createWide Lib "stdmdlbltin.dll" ( _ ByVal out As Long , _ ByVal in_ As Long , _ ByRef userOrigin As Point3d , _ ByRef rotMatrix As Matrix3d , _ ByVal size As Long , _ ByVal txtParams As Long ) As Long
Where txtParams is the TextParamWide user-defined-type.
txtParams
Regards, Jon Summers LA Solutions
Jon,
You always seem to know far more about programming than I. I've attached the procedure source as text. This is one procedure in a special MVBA that is delivered with Open Roads. When a survey is processed, you can identify which figures should call up a VB procedure and pass arguments to it. The end result, is that it generates a Test Label containing text strings according to the specific directions. This is one I've customized to look for attributes attached to survey shots of trees. Currently, the attribute names it searches for are SZ, TY and NB. It reads their values and generates on, two or three line labels as a text node.
SHA_LabelTreeAttr.bas.txt
It is actually possible that even if we find a way to generate a VI Text Node, that Open Roads will strip it off as part of its placement. Open Roads creates its own application elements from MicroStation primitives and attaches attributes to them that it recognizes so that these elements appear to be custom Civil Objects. So a file processed in Open Roads Survey, if opened in MicroStation only, will simply identify these as text node, cells and 3D linestrings. But if opened with MicroStation with Open Roads activated, it will see survey Points, Survey Labels and Survey Figures.
So, if you could explain or show me an example of what parameters I need to pass to the function, I would be grateful.
Charles (Chuck) Rheault CADD Manager
MDOT State Highway Administration
caddcop said:if you could explain or show me an example of what parameters
It's hard. You must create a VBA user-defined-type (UDT) that mimics MDL's TextParamWide. However, that UDT contains some other UDTs, so you have to define them too. Each UDT is a VBA type but must be binary-compatible with the MDL prototype.
MDL's TextParamWide
One approach would be to write an MDL applet to apply IsViewIndependent to the VBA TextNodeElement as you create it. The simplest solution would be for Bentley to provide a MakeViewIndependent method for TextNodeElement .
IsViewIndependent
TextNodeElement
MakeViewIndependent
Other than creating an Idea/Enhancement (that should be done), I see that "ViewDependent" is one of the common element properties that may be accessible using the VBA PropertyHandler. Though I did not check to see if that specific property is R/O or R/W, maybe give that a quick try to see if it can be used to work-around the is current missing accessor.
HTH,Bob
It is Read Only for Text Nodes. I know as I tried a bunch of work-arounds - all within VB without trying to figure out MDL Wrapper Functions - which I have used at least once with Jon and a few others help.
BYW, creating a Note in VB results in an unassociated leader. By under contract go to VB guy just had to kludge together a work-around, where he literally inserts a previously created note in a cell, drops the cell and then replaces the text. Not very elegant but it worked.
Hi Chuck,
caddcop said:It is Read Only for Text Nodes.
my MicroStation V8i (SELECTseries 4) tells me View Dependent property is not read only and can be changed both manually and using PropertyHandler.
For me it seems it's the solution of your question.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I'm running PowerInRoads Ss4 (08.11.09.832) and this is from it's VBA Help:
Read/Write Boolean for TextElement.
Read-only Boolean for TextNodeElement.
Gets or sets a value indicating whether this object is view-independent.
And I'm pretty sure I tried setting it on a TextNodeElement and was told it was not allowed. But I can test again.
caddcop said: I'm pretty sure I tried setting it on a TextNodeElement and was told it was not allowed
The point Jan is making is that, if you look at the text node in the Element Properties dialog, you can modify it. So it's not read-only all the time — only in VBA's ViewDependent property.
ViewDependent
Jan suggests that you try VBA's PropertyHandler to perform your edit. There are examples in VBA help.
PropertyHandler
caddcop said:and this is from it's VBA Help
seriously, you believe everything in documentation?
One rule of development is to try it, documentation can be out-of-sync easily (and often in it is in real world).
Based on my 5 mins testing this text node setting can be changed both manually and using PropertyHandler.
Regards,