MicroStation has many configuration variables that an Admin uses to define the operating parameters of a CAD session. Some variables are defined in configuration files, some variables are dynamic and change during a MicroStation session as a user opens and closes DGN files.
An example of a MicroStation dynamic variable is _dgnfile, which contains the file path of the active DGN file. You can see its value in MicroStation using key-in EXPAND ECHO $(_dgnfile). The path is displayed in MicroStation's Message Center.
EXPAND ECHO $(_dgnfile)
Consider this question from the MicroStation Forum by mwlong: We need the PW path. If a subconsultant looks at a pdf file and would like to reference that file to one of their files they will have issues locating the file on PW. I've run into this many times. Even looking at our own files. If we have the PW path displayed it aids others in locating the files so you don't need to track down the person who knows where the files are located.
Is there an analogous PW configuration variable that contains the PW logical path to the active document?
The original question was for putting the path on a PDF. I know of 2 ways to accomplish this. The question here is how to get the path inside of MicroStation itself, I know of zero ways to accomplish this.
For text substitution you have to use a design script to do it. You can stack a design script alongside your normal MicroStation pen table and both will apply.
Method 1 only works when you use Renditions inside of ProjectWise. Renditions defines a whole bunch of environment variables that can be used in design scripts (and only design scripts, these are not MicroStation variables or OS environment variables).
if (type eq text) then
if (characters eq '*$method1$*') then
; This works for renditions only, uses environment variables set by ICS server
; RENDSVC_DATASOURCE => integrationserver:datasrouce
; RENDSVC_FULLFILEPATHNAME => Everything after the \Documents\ part of the URL
envr_variable = "RENDSVC_DATASOURCE"
characters = "pw:\\" + envr_value + "\Documents\"
envr_variable = "RENDSVC_FULLFILEPATHNAME"
characters = characters + envr_value
Method 2 works in MicroStation (v8i and connect) Print (presumably Print Organizer, but I did not test) and Renditions.
if (type eq text) then
if (characters eq '*$method2$*') then
; This works for MicroStation print, print organizer and renditions
; pw_file_url_type sets how the URL is formatted.
pw_file_url_type = pw_location_visual
characters = PW_MASTER_FILE_URL
If Method 2 works in regular print AND renditions why did I mention Method 1?
This is what the 2 methods produce for me in my test:
And every variable Renditions sets should be set as variables, or as Item types, in MicroStation itself by ProjectWise integration. They are all super useful beyond text substituion.