[v8i VBA] Create View Independent TextNode

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!    

Parents
  • 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.

    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...

    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.

     
    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

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • 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.

    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 .

     
    Regards, Jon Summers
    LA Solutions

  • 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



Reply Children