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.
_dgnfile
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?
Morning Jon.
I thinks the variable your after is $(_DGNDIR).
I would define a new variable in the csb/cfg that you can then report. Like below.
MS_ACTIVE_FILE_FOLDER=$(_DGNDIR)
Regards
Chris
AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead
Principal Engineer – Digital
OpenRoads Designer 10.10 | MicroStation CE 10.16 | ProjectWise CE 3.4 | ContextCapture | ProjectWise PowerShell 2.0 | Generative Components | OpenBridge Designer 10.10
Revit 2022 | Civil 3D 2022 | Recap 2022 | Infraworks 2022 | Dynamo | Navisworks Manage
PowerShell | Visual Studio | Office 365 | Power Automate | Teams | SharePoint | Visio
Speckle | BIMVision | Revizto | Solibri
Chris Andrew said:I thinks the variable your after is $(_DGNDIR)
Thanks, but that's not the answer. Perhaps I wasn't clear in my question.
Its name indicates that _DGNDIR obtains a path, not a file. _dgnfile obtains the full file name. I cited _dgnfile as an example that works in MicroStation whether or not ProjectWise (PW) is connected.
_DGNDIR
What I'm after is the PW logical path. That is, not the path to the DGN file that PW copies to your local C: drive when you check-out a document, but the logical organisation of folders and files in a project.
C:
Regards, Jon Summers LA Solutions
Ok. Closest i can get is using $(PW_WORKDIR) but that doesn't include the dms folder
Chris Andrew said:Closest i can get is using $(PW_WORKDIR) but that doesn't include the dms folder
Thanks, but not close enough. Consider this comment 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.
Could use Item Types and Expressions.
Chris Andrew said:use Item Types and Expressions
That is my goal. However, System.Path.GetFullPath(ActiveFile.FileName) provides the same information as the configuration variables mentioned above. That's the path of the active DGN file in a local folder, which is not what I want.
System.Path.GetFullPath(ActiveFile.FileName)
I'm looking for something fictional along the same lines: ProjectWise.Projects.GetPath(ActiveProject). But AFAIK that doesn't exist, which is why I seek a configuration variable to obtain that information.
ProjectWise.Projects.GetPath(ActiveProject)
Jon, thanks for checking into this as well.
Chris Andrew, this is the output I am looking for "pw:\\mt-pw.bentley.com:mt-pw-01\Documents\ProjectFolder\ProjectSub\300_CADD\.........\FileName.dgn"
Power InRoads v8i 08.11.09.615
Microstation CONNECT 10.16.02.34
Microstation v8i SS 10 08.11.09.919
ORD CONNECT 2021 R1 10.10.1.3
ProjectWise 10.0.3.453