Generate sheet number with Rendition

The nice feature of Create Renditions is you can print in the background. 

The challenge is, is it possible to have Renditions generate a sheet number or reference from an Excel file for a master sheet number list based on the dgn filename? For example, ab003.dgn will have sheet no. 3 and cd006 will have sheet number 6, respectively. In the past, when printing using Print Organizer with text-string, it would be easier to do this. 

Microstation v8i SS4, ver 08.11.09.829

  • I believe this is possible, but with caveats especially if your rendition server is hosted by Bentley.

    With Print Organizer, I assume you were using a VBA macro to read an Excel file and set environment variables (i.e. $SHEET) that were then used as input values for pen table and/or design script text substitution?

    If this is the approach, then with a Bentley-hosted rendition server, the first obstacle is that MS Office will not be installed on the server. So your VBA macro would need to use an XLS reading module that did not require Excel to be present.

    The second obstacle is that iCS for PDF by default will not download any executable content inside a managed workspace onto the rendition server. This includes VBA macros. This means to use VBA macros with iCS for PDF in the same manner as Print Organizer, the VBA macro(s) must be copied manually into the appropriate MicroStation/PowerPlatform location on the rendition server(s) by a server admin. For a Bentley-hosted server, that would require an extended conversation starting with a support ticket.

    The third obstacle is that (I believe) the current version of InterPlot Organizer available on Bentley Software Downloads does not initialize the MicroStation engine's VBA subsystem -- something Print Organizer must do explicitly with its worker process. I know that in more recent builds, InterPlot Organizer does initialize this subsystem when using a CONNECT Edition MicroStation/PowerPlatform engine. Probably not for MS V8i, though. The necessary build of InterPlot Organizer could be obtained if necessary by working through Bentley Support.

    So if using MS CONNECT Edition as the processing engine and the latest InterPlot Organizer, you could set the MS_PLT_RUNVBAAUTOLOADPROJECTS configuration variable to include the name of your custom VBA macro installed in the correct location on the iCS for PDF server(s), the same technique used by Print Organizer, and that macro would be auto-loaded by iplotorg.exe's worker process when creating renditions. The macro would do its thing when the DGN was loaded, setting the environment variables that would be later picked up by the pen table or design script at print time.

    If you remove Excel from your problem description, as well as any need for a VBA macro, then the solution is simpler. Simple character processing, such as extracting a substring from a fixed location in the DGN file name, can be accomplished using a MicroStation Named Expression. The named expression can be defined in a .dgnlib that can be included in the DGN's managed workspace. The InterPlot design script "characters" assignment keyword supports the embedded "<expr?name=...>" syntax the same as Print Organizer allowing great flexibility in print text substitution.

          
    .

  • Thanks Andrew!

    Sorry, I should clarify that the sheetnumber doesn't really follow the filename. For example, cd006.dgn sheet number is 10. Hence, the usual method I know from Print Organizer is this file will be item no. 10 in the list of files. With the text string $SHEET, Microstation recognizes this sheet as sheet no. 10. 

  • The question to understand your workflow is, how does $SHEET get its value?  As far as I know, that's not a standard MicroStation variable; I assume it's the result of some form of customization.  Inside the DGN, is that $SHEET a normal text element or a tag, item set, or something like that?  Furthermore, what precisely replaces $SHEET with different text?  A design script or pen table?  Does it happen at print time or when the DGN is opened?

    Does the correct print text substitution rely on the position of the sheet inside of a PSET file?  In other words, if you printed the same model from the single-print dialog outside of Print Organizer, or in a different PSET by itself, would you get the same replacement string?

    Print Organizer does offer quite a few expression symbols related to the location of the print definition in the PSET or within a subfolder.  More than InterPlot Organizer, unfortunately, which is less capable in that regard.  When printing an InterPlot Plot Set (IPS) file, either interactively or through rendition service, InterPlot Organizer does offer the following two design script "characters" keywords:

    page_number

                Sequence number of the plot in the document set while in Organizer. (Example: 1)

    total_pages

                Total number of plots in the document set while in Organizer. (Example: 5)

    So "if (characters .eq "$SHEET") then characters = page_number" would replace $SHEET text with "10" if the plot was the 10th row in the IPS file.  For a simple workflow, that might be good enough.  But would only work if creating renditions from IPS files.  It would not work the same way if creating renditions from individual DGN documents.

    If the $SHEET value is generated in some other manner, perhaps from the DGN sheet model's "sheet number" property, which for some people might originate from a WorkSet sheet index, then that's a different matter.  Or from a VBA macro, which is significantly more complicated to support with iCS for PDF but still possible as I described earlier.

          
    .