Auto Sheet Numbering Format

I realize there a several similar questions with answers on this subject, but none that have gotten me exactly what I am looking for.  I am using text substitution with a pen table to generate sheet numbers when plotting from print organizer and I need the sheet number to have a three digit format with some preceding characters that are constant on each sheet.  I can get the preceding characters to come in with no issue and the sheet number, but not in the three digit format, for example, I need the sheet number to show as "001" and it is coming out as "1".  Is there a way to change this format?

  • It depends on whether the source of your "sheet number" is an integer or a string value.  String values cannot be easily reformatted, but numeric values can be.

    I assume you are using "_DOCSET_CURRENTSETDOC_" as the replacement symbol in your pen table text substitution.  That's a numeric value and is the same thing as "PrintDefinition.SetPrintDefNumber" in the more formal named expression language.  You can see examples of custom numeric formatting of PrintDefinition.SetPrintDefNumber in the default expressions available in Print Organizer.

    https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v15/en/GUID-A879C79A-3E86-6759-87D7-05545279B659.html describes how to use a named expression (technically, just the 'expression' since it's defined inline) in conjunction with pen table text substitution.

    This value as a pen table text substitution replacement string yields the print definition index within the print set as a 3-digit, zero-prefixed string, i.e. "001":

    <expr?expr=System.String.Format ("{0:D3}", PrintDefinition.SetPrintDefNumber)>

    "D2" instead of  "D3" would give you "01", etc.

    If you are using the "PrintDefinition.SheetNumber" symbol in CONNECT Edition, unfortunately that's an alphanumeric string property (despite the name) not an integer value.  So the String.Format expression cannot be used to give it a different representation.  You would need to explicitly change the value in the sheet model from "1" to "001".

          
    .

    Answer Verified By: Brandon McAdams 

  • Thank you, that worked great.  Generated exactly what I needed.