Justify a TextNodeElement?

Simple question, how do I set the justification of a TextNodeElement? The attribute for the node is read-only (anyone know why?) and justifying each text element inside the node does not produce the desired justification on the entire node. Any assistance would be wonderful. Thanks in advance.
  • Use "Change Text Attributes" in the text tool box!

    Easy!

    Frank

    Regards

    Frank

    since 1985: GIS, CAD, Engineering (Civil)  Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads,  HHK Geograf, IBr DAVID] :  Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML]
    [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"
    Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)

  • Frank:
    Use "Change Text Attributes" in the text tool box!

    If the answer is that easy, why did CleverBeans post to the VBA Forum?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Jon Summers:
    Frank:
    Use "Change Text Attributes" in the text tool box!

    If the answer is that easy, why did CleverBeans post to the VBA Forum?

    Regards, Jon Summers
    LA Solutions

    Good Morning Jon,

    Sorry, I've still have sleep in my eyes ;-)

    So, give me some time to see what I can do!

    Frank

    Regards

    Frank

    since 1985: GIS, CAD, Engineering (Civil)  Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads,  HHK Geograf, IBr DAVID] :  Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML]
    [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"
    Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)

  • What about:NodeJustification Property

    Read/Write MsdTextJustification.


    Syntax

    object.NodeJustification [= MsdTextJustification]

    The NodeJustification property syntax has these parts:

    Part Description
    object A valid object.
    MsdTextJustification An MsdTextJustification expression.


    Version

    08.00.01

    I saw that justification Properties ist read only for Textnodes

     

    Frank

     

     

    Regards

    Frank

    since 1985: GIS, CAD, Engineering (Civil)  Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads,  HHK Geograf, IBr DAVID] :  Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML]
    [direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"
    Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)

  • Well I got a procedure for this working using key-ins, it's a wall of text. Is there an easy way to post the code so that it's readable in this forum?
  • Cleverbeans:
    Is there an easy way to post the code so that it's readable in this forum?

    DanPaul recommends this site for formatting source code as HTML.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Another option would be to put it in an ASCII text file and attach that to a post.

      

  • Jon Summers:
    Cleverbeans:
    Is there an easy way to post the code so that it's readable in this forum?

    DanPaul recommends this site for formatting source code as HTML.

    Regards, Jon Summers
    LA Solutions

    It it's good HTMLer recommended to me by ben.doherty

    Something like that could be a part of message editor here on Communities, at least for C++/MDL and VBA... 

  • Well rather then spam my work I'll give a sample. Basic plan was to get the current setttings of the justify dialog box, then change it to correctly justify the text, then change the settings back. From there just send info to the CadInputQueue. I pulled most of the information from macro recorder and it works fine as long as I only justify the text. Taking the "nice to the user" parts out here's the core. Public Sub TextNodeJust(txtNode As TextNodeElement, txtJust As MsdTextJustification) Dim curJustToggle As Variant Dim curJust As Variant CadInputQueue.SendCommand "MODIFY TEXT " curJustToggle = GetCExpressionValue("tcb->msToolSettings.changeText.just") curJust = GetCExpressionValue("tcb->textStyle.just") SetCExpressionValue "tcb->msToolSettings.changeText.just", 1, "MODIFY" SetCExpressionValue "tcb->textStyle.just", txtJust, "MODIFY" CadInputQueue.SendDataPoint MidPoint3d(txtNode.Range.Low, txtNode.Range.High) CommandState.StartDefaultCommand SetCExpressionValue "tcb->msToolSettings.changeText.just", curJustToggle, "MODIFY" SetCExpressionValue "tcb->textStyle.just", txtJust, "MODIFY" End Sub This however has led to a new problem. If I attempt to move the text using the element.move or element.rewrite method after justifying it the justification doesn't keep and it reverts to it's previous state. Moreso, the element's range does not update after the justification leading to incorrect behavior. I tried the procedure at the LA Solutions MVBA tips and tricks page for recalculating ranges (link below) but it didn't have the desired effect. I've tried to move both inside the procedure and outside, but as long as it's part of the same action it fails, however if I run one procedure, let it finish then run another manually the range updates. Link -> http://www.la-solutions.co.uk/content/MVBA/MVBA-Tips.htm#ElementRange As always thank you for helping, and any feedback is gratefully received.
  • Anybody find a solution to the original issue here?  I used Cleverbeans' routine from his 7/23 post, but I still have the issue of incorrect justification.

     The really odd thing is that even if the place text dialog displays the correct justification before the macro is run, it will not justify text correctly unless I first manually change to another justification, back to the correct justification, and then run the macro.  It's as if MicroStation VBA has it's own cached justification (at least for text nodes) that needs to be forceably updated before it changes.

    I am using the following three lines of code to try and set justification before I plot text (using VBA also), and it does not work unless the manual change is done first.

    SetCExpressionValue "tcb->msToolSettings.changeText.just", 2, "MODIFY"
    SetCExpressionValue "tcb->textStyle.just", msdTextJustificationLeftBottom, "MODIFY"
    ActiveSettings.TextStyle.Justification = msdTextJustificationLeftBottom

    Note that after this I am plotting text using text nodes (not text elements). I am justifying each element in the node after creation.  But the above error still occurs.