I really like the compose text algorithm, but I cannot figure out how to add a line break in the text. I have tried HTML (i.e. "<br>") and python/C++ (i.e. "\n") to no avail. Please help!

8 comments

  • Matthias Staengel

    Hi Adriaan,

    Good questions! Took me a while to get it up and running, but it can be implemented! Please have a look at this example project here --> Image Object Fusion. I am using html code to define breaks, colors and font type and I am updating the Results Panel based on the current status of the number of objects that have been analyzed. I think this is pretty cool to have! If I can do it, you can do it easily!

    "<br/>" OR "<br>" are actually working both. It is not very straight forward, but once you have set it up, it runs smoothly.

    Please let me know if this does the trick!

    Cheers,

    Matthias

  • Adriaan van Niekerk

    Thanks Matthias

    Sorry I was not clear in my question. I was using the show warning algorithm, not the results panel. And from what I can tell the HTML tags are not working there? Nevertheless, I think - as a workaround - I can rather use the results panel as demonstrated in the video (great video by the way!). So thanks for pointing me in the right direction!

    Cheers,

    Adriaan.

     

  • Matthias Staengel

    Hi Aadrian,

    Yes you will have to use the results panel if you want to use html. The "Show user warning" algorithm does not support html.

    Cheers,

    Matthias

  • Christian Weise

    Hello Adriaan and Matthias,

    Could the algorithm 'show html help' do the job? You can find an example here. The question is whether you want to change the content dynamically. 

    Cheers

    Christian

  • Adriaan van Niekerk

    Hi Christiaan, thanks for the suggestion. The 'show html help' algorithm will not work as the content needs to change dynamically. The use case is that the operator needs to manually set an object's value (elevation), but needs information on the current elevation as well as the surrounding minimum elevation in order to set a suitable value. Currently, we are using two separate 'show user warning' rules, which is a bit cumbersome.  It would have been nice to show the two values in one warning, with a line break in between. But we are currently testing Matthias' suggestion of using the results panel instead. So not a big deal! 

  • Matthias Staengel

    Hi Adriaan,

    I think I have something for you that you will love ;). At least I believe, this could be exactly what you are looking for. How about using "Cursor Tooltips"? We have an algorithm called "set cursor tooltip" which allows you to also display an object variable.

    Meaning it will give you that information as a cursor tooltip. You could for example simply calculate the difference between the mean elevation value of the object to the min mean value of the surrounding and display this here?! Have a look at the GIF (I guess I went a bit over the top with all the text in the tooltip... ;)).

    I am actually displaying 3 object variables in the tooltip.

    1. The mean elevation of the object
    2. The min mean elevation of the surrounding objects
    3. The difference between the two

    I am combining those in one variable (string) that I am defining in the algorithm  "set cursor tooltip" as the object variable (last parameter at the bottom right). This information will update automatically based on the cursors position.

    Please let me know if you need the Rule Set or further explanation. But I think this will end up as a weekly tip or even a small little video!

    Hope this helps?!

    Cheers,

    Matthias

  • Matthias Staengel

    Hi Adriaan,

    Last but not least, another option that came up is using the possibility to add text to the View. This also allows you to display feature values in a dynamic way.

    Have a look at this Brainwave explaining how this can be done in more detail.

    Cheers,

    Matthias

  • Adriaan van Niekerk

    Hi Matthias

    Yes, thanks, this will definitely work much better. I will try it out. 

    Regards,

    Adriaan.

     

Recent Discussions

Need more help?

Enter Knowledge Base Contact Support