Skip to Main Content
Need Support? Let’s guide you to the right answer or agent.
Status Shipped
Categories 2D Drawing
Created by Guest
Created on Jan 27, 2021

Use Named Expression in a Text Field

If a text field could use a named expression as the source of its data, all kinds of annotation would be enabled.

  • Guest
    Reply
    |
    Mar 22, 2024

    I would like the scale of a drawing title block cell to be reported by text embedded in the cell. If I scale the border/title block up 12x to fit around my geometry, I would like the text to read "1:12" in the scale text. I know that you can reference the X and Y scale of a 2D cell and reference that, though the multiple decimal places are unwanted.

  • Guest
    Reply
    |
    May 17, 2023

    Can a text-type variable also be used in a text field?

  • Guest
    Reply
    |
    May 11, 2021

    Hi Jon, you can now run a Named Expression in an Item Type expression, you need to copy and paste the expression itself and not just the name in the property's Expression field or use the Expression Builder to write it. There are some limitations with Select elements operator thats will not work.

    I know you have lots of experience with our item types and expressions but for any other users that may stumble upon this thread and wish to know amore about these technology, I have added some links to initial learning articles here below:


    https://communities.bentley.com/products/microstation/b/microstation_blog/posts/ec-expressions-in-item-types---new-in-microstation-connect-edition-update-12

    https://communities.bentley.com/products/microstation/b/microstation_blog/posts/new-in-microstation-connect-edition-update-15---public-technology-preview-expression-builder


  • Guest
    Reply
    |
    May 11, 2021

    Reginald Wallace over 3 years ago

    Enhancement #895076 has been filed on this issue.

    Regards,

    Regie

    Reginald Wallace over 3 years ago

    Hi Jon,

    For clarification here, are you looking for element properties through a named expression to appear?

    Can you provide a user case that shows an example of what you are looking to show in the text field?

    Regards,

    Regie

    Jon Summers over 3 years ago in reply to Reginald Wallace

    The idea came to me because of a question posted on the MicroStation Forum. Suppose you want to include just the year in a text field. You might want to use a Named Expression to parse the year from the full date (e.g. June 18 20182018), then place the result in the text field.

    Reginald Wallace over 3 years ago

    Hi All,

    For those of you who have voted on this idea, could you provide an example of what you like to see named expression be able to do in a text field?

    Jon, provided me with an example regarding system date property. We are looking for additional scenarios to broaden this capability for this type of functionality.

    Regards,

    Regie

    Samir Haque over 3 years ago

    Hello all, We are looking for more use cases for this feature. What would you use it for? A Text Field can show the value of a Element, Model, File, and other objects (placeholder cell, etc.).

    For example, you may wish to show a Sheet Number only if you are in a 2D Sheet or report the value of a variable.

    What else would you use it for?

    Thanks, Samir

    Jon Summers over 3 years ago in reply to Samir Haque

    The OP wanted to parse the year from a full date. That is, for 04-Jul-18 he would like to see 2018 in the text field.

    AndrevR over 3 years ago in reply to Samir Haque

    Indeed, report the value of a variable is where I want to use it for.

    Regards, Andre

    Reginald Wallace over 2 years ago in reply to AndrevR

    Hi All,

    We are still looking for additional cases as was mentioned previously by Samir. I am compiling a list now so please provide any other properties you would like to see in text fields via item types.

    Regards,

    Regie

    Jon Summers over 2 years ago in reply to Reginald Wallace

    > We are still looking for additional cases

    GeoGraphic coordinates

    Krister Surell over 2 years ago in reply to Jon Summers

    Another useful thing would be to display the calculated slope based on the element angle.

    But I guess there are any number of uses for this.

    /Krister

    Reginald Wallace over 2 years ago in reply to AndrevR

    Hi Andre,

    Are you looking get the value of specific variables such as. MS_GUIDGNLIBLIST. What about parametric variables?

    Regards,

    Regie

    Reginald Wallace over 2 years ago in reply to Jon Summers

    Jon,

    I know there are some efforts to pull in LAT/LON data into an expression. Could you explain of scenario of how you would use this? Are you just trying identify the coordinate of a specific point, object or even the coordinate origin of a file?

    Regards,

    Regie

    Reginald Wallace over 2 years ago in reply to Krister Surell

    Hi Krister,

    Thanks for the suggestion. Could you give me an example of where you would need this calculated? The suggestions for examples to all the suggestion made by community members give us a better idea of how to implement these expressions so as to provide them in annotations in a file. Thanks again.

    Regards,

    Regie

    Jon Summers over 2 years ago

    MicroStation CONNECT Update 12 has this:

    (Technology Preview) Expressions You can now define and attach an expression to an element's item type. The corresponding value of the expression will display in the element's Properties dialog. Expressions can represent business data which otherwise cannot be graphically represented for an element. Expressions have specific syntax definitions based on their type like arithmetic, concatenation, condition, comparison and so on.

    Is this Bentley's response to my suggestion? If so, I'm pleased to see it. But I see that Bentley staff continue to ask questions about use cases, so maybe Expressions are not the answer to this Idea.

    Reginald Wallace over 2 years ago in reply to Jon Summers

    Hi Jon,

    Thanks for asking. I think we are looking at an alternative to text fields. The questions are intended to find out the exact needs of communities members to see if this method will be useful. We are looking at using EC expressions in item types which would give the same annotative feel as text fields but would be different from the initial request that you made.


    Regards,

    Regie