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:

C:\PROGRA~2\MICROS~2\Office15\INFOPA~1\INFOPA~3\INFOPA~1\dgnnumber.dgn

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 08.11.09.459

Thanks for your help in advance,

Chris

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

    Jan
  • 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!

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

    put 

    C:\PROGRA~2\MICROS~2\Office15\INFOPA~1\INFOPA~3\INFOPA~1\

    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

    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 

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

    put 

    C:\PROGRA~2\MICROS~2\Office15\INFOPA~1\INFOPA~3\INFOPA~1\

    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

    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 

Children
  • Hey Lorys,

    Thank you very much for your suggestion.

    Unfortunately, they are pretty strict on font size.

    We did bat around changing our standard workflow to include a different configuration project by project rather than client by client.
    But since we are sometimes working of 5 or more different projects in a day, sometimes more we we're concerned that it would lead to too many unforced errors :-)
    We also thought about changing our local border files with a permanent path.
    And, in a pinch, I thank that is what we will do as a last resort.
    But that is so easy to mess up.
    And, since we do move the files around quite a bit, we would have to be very careful with the pcf and/or border files

    Also, I am so forgetful :-)
    So, I like to try to automate if I can. :-)

    I do plan on working with our client on a few minor changes that would make our life easier ( and there's), but the next update of the border and seed files is still a bit off for them.

    Thanks,

    Chris