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

Parents
  • 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. 

  • Unknown said:
    The problem with that is being able to re-number sheets when they need to change due to added or removed sheets. I'm using the Sheet number field because they can easily and quickly be re-numbered using the Project Explorer.

    Can you demonstrate how to do that in project explorer?

    Lorys

    Started msnt work 1990 - Retired  Nov 2022 ( oh boy am I old )

    But was long time user V8iss10 (8.11.09.919) dabbler CE  update 16 (10.16.00.80) 

    MicroStation user since 1990 Melbourne Australia.
    click link to PM me 

  • Back at this again too see if I can figure out why the the PrintDefinition.SheetNumber expression won't work for me. Any ideas what I can try or what I might have wrong? No matter what I have tried it always just shows "0". Even if I simplify it and make the default print definition name expression simply "PrintDefinition.SheetNumber" all I get returned is "0" regardless of what is set in the Sheet Number field of the model properties. 

  • I still can't get the print organizer to pull sheet numbers and a new wrinkle is I would like to to pull the Sheet Names as well and it won't do that either. It pulls the model name instead of the sheet name. In other words PrintDefinition.MasterModelName and PrintDefinition.SheetName both return the same value from the Model Name field even when I know they aren't the same in each field. 

  • With Ryan's help we have found the cause of the problem. The Sheet Model property "Display Sheet Boundary" had been turned off which makes the Sheet Model a Design Model therefore "Sheet Number" or Sheet Name" are not available to retrieve through the named expression.

    Answer Verified By: Ryan Mann 

Reply Children
  • I do verify this as the answer to why it wasn't working for me. However I will say that I don't agree with the designed functionality which requires that boundary to be turned on for a sheet model to retain its "sheet" status. The model has been designated as a sheet model in the model properties and I see no reason why it should be dependent on that shape. The Sheet Name and Number fields exist whether that boundary is turned on or off so why not let the Print Organizer find them when it loads anything from a model designated as a Sheet Model?