Hello all,
I tried asking this on a related post but that post is from 10 years ago so not sure anyone will answer so i decided to create a new one.
The config variable:
MS_PLT_DEFAULT_OUTPUT_FILENAME_EXPRESSION
System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile)
works well for one custom output file name definition. But can i create 2? say, custom1 custom 2?
MST only registers one "MS_PLT_DEFAULT_OUTPUT_FILENAME_EXPRESSION" before ti starts to merge it, but even when i type in say:
System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile); System.Path.GetFileNameWithoutExtension (PrintDefinition.SourceFile)& "_D"
for my second one where i want the same output file except to add "_D" at the end. It says it's invalid.
any help?
Hi,
an advice: Please use Insert > Insert code tool (with text formatting) to format configuration variables (and any code in general) properly. It helps to distinguish what is a plain text and what is "coding".
In my opinion it's not possible to define more values using MS_PLT_DEFAULT_OUTPUT_FILENAME_EXPRESSION configuration variable. I have not found any such reference and the variable name is singular, not plural, so I guess it's not a surprise.
My question is why do you use this variable? You can define as many as you need expressions in dgnlib and they will be displayed in Output File Name Expression dialog automatically:
Or you want to do something else?
You can find more information about expressions in dgnlib in this tutorial.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
The relevant document can be found here, particularly the "Named Expressions" subsection and its "To Create a Named Expression..." example.
docs.bentley.com/.../pub.xql
As Jan stated, you can create as many named expressions as you need. All those marked with the "Print Set" keyword (as depicted in the example) will appear in the Print Organizer output file name expression list.
There can only be one output file name expression for the print set, therefore there can only be one default. Specifying the contents of the expression in the configuration variable used to specify that default, as you described in your post, is a shortcut technique whose use is discouraged. Better to define the expression as a named expression in a .dgnlib, then (if desired) make that be the default by defining the configuration variable to the name of the expression (as opposed to the expression itself).
.