Pen Tables - Text Substitution - Windows Short Path

Hi all,

Would it be possible for me to use a pen table, text substitution, named expression combination in order to text substitute the windows short path of the dgn location I am printing from?

If possible, I would like text substitution result to look something similar to:


I have limited space available for the path, in the border (dictated by client standards), and my companies standards make the path quite long.
To add an additional wrinkle, the files are located on a network drive.

Unfortunately, FileL ,  FileA , and FileSdo not give me the results I am looking for.
I am definitely open to alternative suggestions, but If possible I would like to avoid VBA to avoid software changes outside of MicroStation effecting functionality.

The closest answer I have come up with is to truncate the path using this named expression:

IIf (System.String.Length (PrintDefinition.SourceFile) > 70, System.String.Substring (PrintDefinition.SourceFile, System.String.Length (PrintDefinition.SourceFile) - 70, -1),PrintDefinition.SourceFile)

But the above has the drawbacks of loosing critical drive location information on the left end of the path.

Currently, we are using MicroStation V8i (SELECTseries 3) - Version

Thanks for your help in advance,


  • Hi Christopher,

    I think there is no way how to obtain old 8.3 DOS style path of active file in MicroStation. Even though your request makes sense, I guess nobody takes care about so old FAT style today.

    It's possible to create and use own Named Expression(s), so it would be possible to implement code that will return 8.3 style path. But C# development plus how to create NE knowledge is required :-(

    With regards,

  • Thanks for posting the link and Trying to help Roland. Unfortunately, this was one of the first pages that I looked through and there doesn't appear to be anything there about dos windows short paths.

    But, I very much appreciate your response!
    Have a great day!
  • Hey Jan,

    Thank you very much for your quick response. I was afraid that that might be the answer. I looked for several hours, and didn't have any luck :-(
    But I was hoping maybe i was just using the wrong search terms.

    So, if that is not an option perhaps you might have some advice for another method to fix my problem.

    The biggest issue I think, is that the text that I am replacing is center center justified, and based on the location of the tag, above a certain length it would go off the edge of the page(say 70 characters), and above an even longer length (say 150 characters) it would interfere with another standard stamp.

    But, I wonder, would there be a way to trick the alignment?
    Perhaps by adding trailing spaces in the named expression equal to the length of the path over 70? or inserting a space in a place far away?
    Or would there be a way to adjust the alignment/location of the tag we are replacing through the pen table, without modifying the border?

    I am still a novice where it comes to using named expression.

    Perhaps something like:
    IIf (System.String.Length (PrintDefinition.SourceFile) < =70, PrintDefinition.SourceFile, IIf (System.String.Length (PrintDefinition.SourceFile) > 150,"..." & System.String.Substring (PrintDefinition.SourceFile, System.String.Length (PrintDefinition.SourceFile) - 150, -1) & System.String.ADDACOMMANDTHATADDSCHARACTERMULTIPLETIMES(" ",(System.String.Length (PrintDefinition.SourceFile) - 220),-1),PrintDefinition.SourceFile & System.String.ADDACOMMANDTHATADDSCHARACTERMULTIPLETIMES(" ",(System.String.Length (PrintDefinition.SourceFile) - 70),-1))

    For my guess this command works like System.String.ADDACOMMANDTHATADDSCHARACTERMULTIPLETIMES("character or string you want inserted",number of times insert the character or string,position you want the character inserted where -1 inserts to the right)

    The idea of the above string only truncating when it would run over the stamp ( i.e. 150 characters), then adding trailing spaces to move the text to the left because of center justification of the text as needed( i.e. some number of spaces between 150 and 70)

    Any thoughts or ideas?

    Thanks again for your responses!

  • I suppose you have  tried smaller font to put the  full long path? 

    Seems a bit  strange that you have to do this as it  wont mean anything when the client  gets  the  files in cad because it will change when they store them elsewhere, but I  have a sneaky low down dirty fix  for your prints..



    or whatever its meant to be  (it cant start with c:\  right was just example)

    as text  in front  of   but not  part of  $FileS$

    The end result will look like what you want not  perfect but heck if it cant  be  done  what do they your masters expect...

    you do this only in the title  block ref file   so its  global and save a copy of the  xref title block in the same folder as these  drawings live  so it doesnt change the one  you use for all drawings using same company std  title  block elsewhere


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

    But was long time user V8iss10 ( dabbler CE  update 16 ( 

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