How do I get sheet numbers into the files names on my prints using print organizer?

I'm trying to setup a named expression to, among other things, pull the sheet number from the plotted model and it's not working for me. I'm using the PrintDefinition.SheetNumber symbol but it only returns a value of "0" regardless of what number is set in the sheet number field of the model. Am I missing something or not understanding what that symbol is supposed to do? 

PrintDefinition.ParentFolderName&
IIf(System.String.Length(PrintDefinition.ParentFolderName)=1,System.String.Format ("{0:D3}", PrintDefinition.SheetNumber),System.String.Format ("{0:D2}", PrintDefinition.SheetNumber))
&"-"&System.Path.GetFileNameWithoutExtension(PrintDefinition.SourceFile)

Here is the expression I have setup. It is using the parent folder name for a prefix and then setting the number of places for the sheet number based on if that prefix is only one letter or more. I just can't get it to actually pull the number from the sheet number in the model. If I use ActiveModel.SheetNumber it will find the number, but then it puts the same sheet number from the active model on all the names instead of the number that goes with the corresponding model. 

I'm using V8i SS4 version. 8.11.09.829

  • Your expression worked as expected for me. By chance are you seeing the zero sheet number in the Named Expression dialog "Test" field? If so, that's expected. For technical reasons, to improve performance and MicroStation startup time, the Named Expression dialog is not linked to the printing system and 'live' data is not accessible. The PrintSet and PrintDefinition symbols evaluate to "[<symbol name>]" for string types and zero for numeric types. The Named Expression dialog Test button can be used to validate the syntax of the expression.

    If you are seeing the zero sheet numbers in the Print Organizer Output File Names / Preview window (or in the output file names themselves), then the cause is likely outdated information in the print definition. When using fixed print definitions, when the print definition is created Print Organizer queries everything it needs from the DGN (view geometry, model/sheet info, etc.) and stores it in the print definition embedded in the PSET. That allows operations such as changing the print size and scale, switching views, etc. to be performed without requiring a time-consumating DGN reload in the background process. All of the values in the PrintDefinition symbol set are taken from this cached data. If you have changed the sheet number in the DGN model properties after creating the print definition, then PrintDefinition.SheetNumber will continue to evaluate to the old value. The solution is to run the "Update from design file" command from the Properties / Advanced dialog, or apply a print style where 'Update from design file' is checked.

    In MS V8i, that's the only option because the ActiveFile symbols cannot be used in the Print Organizer file name expression for you reason you observed. In MS CONNECT Edition, the construction of the Print Organizer output file name has changed such that the ActiveFile symbols can be used. This renders the PrintDefinition.SheetNumber symbol obsolete for the most part.

          
    .

  • I must have something set wrong then. It doesn't work for me. All it will show in the print organizer is a "0" no matter what I do. I have done like you said to Update from design file and even tried creating a new pset. These sheets should be 0001,0002 & 0003 based on the numbers in my sheet properties. I can get it to work if I use PrintDefinition.FolderPrintDefNumber, but that relies on having all of the sheets in the folder. That may work most of the time and I will use it for cross sections where all of the sheets are in one model, but I'd rather have it pull the stored sheet number from the other models if I can figure out how to make it work. 

  • There is a difference between the print definition names (which are seen in the Print Organizer tree view and you've depicted in your screenshot) and the output file names. They are controlled by different expressions with separate Print Organizer menu items.

    Performing an "Update from design" action is all that is required to get the new sheet number from the DGN into the Print Organizer output file name, because the file name is constructed just prior to printing. The print definition name (which is also used as the bookmark name in a multi-page PDF) is not normally recalculated after the print definition is created. However, you can force the print definition name to be rebuilt by first performing an Properties (or print style) "update from design" (to get the current DGN sheet number into the print defintion cached data), followed by "Edit / Rename by Expression" with all the print definitions selected.

          
    .

  • I put the same expression into the the Output File Names, made PDF's and get the same result as what is displayed in the Print Organizer.  

  • Are you using variable print definitions? If so, the PrintDefinition.SheetNumber symbol will not evaluate properly in V8i as there is no design state cache in the print definition to draw from. Fixed print definitions are required for that workflow in V8i. In CONNECT Edition, the symbol evaluates as expected using either fixed or variable print definitions.

          
    .