Is there a way to add comments in the Item Type Expressions?

I have tried some of the most common comment designators, but I am not seeing a way to add a comment to an expression. It would be helpful for some of the longer and more complicated expressions to have the ability to add notes as with any programming. 

Parents Reply Children
  • I will look into the named expressions a bit more and see if I can implement them and make the suggestion for the enhancement. 

    An example of one of the more complex expression is a long series of IF statements to generate a bid item based on other properties of the item type. Some are rather simple, but I have a few that require 8-10 statements (some nested) and it would be nice to add notes for the next user that needs to troubleshoot. I have a few items that that will likely get even more complicated than this. Not sure if this warrants it's own code, as I am also trying to keep it as simple as possible.

    iif(this.Type = "Null", "N/A", 
    iif(this.Type = "Pedestrian Signal", "TS-HEAD-PEDX", 
    
    "TS-HEAD" &
    
    iif(this.Visor = "True", "-VISR", "") & 
    iif(this.Backplate = "True", "-BAKP", "") &
    
    iif(System.String.Contains(this.Type, "3"), "-3V", iif(System.String.Contains(this.Type, "4"), "-4V", iif(System.String.Contains(this.Type, "5-Section Cluster"), "-5C", iif(System.String.Contains(this.Type, "5"), "-5V", "")))) &
    
    iif(System.String.Contains(this.Type, "-GL"), "L~", iif(System.String.Contains(this.Type, "-GR"), "R~", ""))
    
    ))


    OpenRoads Designer 2023 | MicroStation 2023 | ProjectWise 2023

  • Hi Jack,

    I will look into the named expressions a bit more and see if I can implement them and make the suggestion for the enhancement. 

    Probably I did not wrote it clearly enough: I mentioned Named Expressions as an example, how Symbol Providers (standard and custom ones) can be used and where descriptions are available.

    It's not possible to use Named Expressions in Item Types Expressions. Named Expressions and on the same level as Item Types: They are "end products" to serve specific purpose. And both they rely on Symbol Providers. But whereas Named Expressions allow to chose what Provider will be used (including own one), Item Types use only fixed ItemTypesHelper provider. So when anything more is required, ItemTypes (which are subset) should be abandoned in favor of EC classes (superset of ItemTypes). But it's not user-level tool.

    Not sure if this warrants it's own code, as I am also trying to keep it as simple as possible.

    I do not know context and requirements, but maybe to use lookup table(s) can help?

    To use such deeply nested conditions will be always bad and no description can change it will be very hard to maintain.

    Maybe to use another tool, better suited for this task, or to change the item type structure, so the mentioned lookup tables can be used, or...

    Regards,

      Jan