I am trying to set up a named expression that picks up the model name and adds the word DRAFT to the end, when plotting to pdf. I want it to look something like this - 12345-01-Floor+Plans-DRAFT.pdf.
I have worked pout the model name bit but not how to add DRAFT.
Any help would be appreciated.
Hi Stuart,
stuartw said:I am trying to set up a named expression
it would be nice to follow the best practices and to specify not only the used product and it's exact version, but also where you want to use the expression.
The expression can by used at several different places in MicroStation, but with different set of symbols providers available, so the answer can be different.
stuartw said:when plotting to pdf
So I assume your want to define output file name in Print Organizer ?
stuartw said:I have worked pout the model name bit but not how to add DRAFT.
As described in this chapter in MicroStation help, to merge (concatenate) string, the operator & (ampersand) can be used:
PrintDefinition.MasterModelName & "-DRAFT"
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Jan,
Using MicroStation CONNECT U16.
Thanks for your help. I must be ding this wrong. Just create a new named Expression with what I though my be the correct syntax and have added to my pltcfg file. Printing to pdf gives me "Invalid Expression".
Any ideas?
stuartw said:Just create a new named Expression with what I though my be the correct syntax
I do not know why answer from Andrew Edge is not displayed (but was sent to my mailbox), but as he mentioned, right parenthesis is missing in your expression.
stuartw said:Printing to pdf gives me "Invalid Expression".
One reason can be the missing parenthesis, another one can be, because I am not sure whether supporter, a space in the named expression name (should work fine, but you never know... ;-).
Regards,
I am going to have to admit defeat with this one. Tried all sorts but no luck with any option so far. My latest attempt is - System.String.Format (System.Path.GetFileNameWithoutExtension (PrintDefinition.MasterModelName) & ("-" "DRAFT"))
Any help with this would be appreciated.
Hi,
stuartw said:My latest attempt is
Why to create something so complicated for a simple thing?
stuartw said:Any help with this would be appreciated.
This work for me (of course, the named expression must be saved in "known DGNLIB", like Personal.dgnlib)
When "Test model" in a DGN file is opened and printed, the offered PDF file name is "Test model-DRAFT.pdf".