VbScrip macro: How to get Project directory

Professional Windows® software to communicate with CAN and CAN FD busses and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
se_akr
Posts: 10
Joined: Mon 11. Jul 2022, 11:46

VbScrip macro: How to get Project directory

Post by se_akr » Thu 1. Sep 2022, 15:44

Hello,

I'd like to print my project directory on a Message Box. Something like

Code: Select all

MsgBox ProjectPath
How can I get this directory on my script ?
I succeed to print the path for active document, but not the project

Thanks in advance for your help

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: How to get Project directory

Post by M.Maidhof » Thu 1. Sep 2022, 17:43

Hi,

which software/tool are you talking about? Please tell us name and used version.

regards

Michael

se_akr
Posts: 10
Joined: Mon 11. Jul 2022, 11:46

Re: How to get Project directory

Post by se_akr » Fri 2. Sep 2022, 07:33

Hello,

PCAN-Explorer 6 with Instruments Panel.

Just have a window which print the path of the project after clicking on a button. I need MsgBox, but I don't know how to get the path

Best regards

K.Wolf
Software Development
Software Development
Posts: 141
Joined: Wed 22. Sep 2010, 15:37

Re: How to get Project directory

Post by K.Wolf » Fri 2. Sep 2022, 10:44

Hi,
if you only want the directory name, there are two possibilities:

Code: Select all

MsgBox ActiveProject.Path
Or:

Code: Select all

MsgBox Documents.TranslateFileName("$(PrjDir)")
To also include the project file name:

Code: Select all

MsgBox ActiveProject.FullName
Or:

Code: Select all

MsgBox Documents.TranslateFileName("$(PrjPath)")

se_akr
Posts: 10
Joined: Mon 11. Jul 2022, 11:46

Re: How to get Project directory

Post by se_akr » Fri 2. Sep 2022, 11:11

MsgBox ActiveProject.Path is perfect

Thank you !

Best regards

Post Reply