Hi,
In our company, we are now using onedrive to store our CAD projects
We are facing a problem with the path for the reference files
If I attach a reference path it uses my Windows user directory :
C:\user\[MYWindowsLogin]\OneDrive-Of-My-Company\Project Folders\Shared Project\ReferenceFile.dgn
So, when a collegue opens the file, obviously the reference file is not found because his windows login is different.
Using relative paths does not help. Not sure that MS_RFDIR can help either because we have a lot of project directories
Any ideas ?
Many thanks
OneDrive creates Windows Environment variables that point to the OneDrive folder of the current user. You can use environment variables as regular variables in MicroStation.
So setting MS_RFDIR to:
MS_RFDIR = $(OneDrive)/Project Folders/Shared Project/ add additional paths with the > operator: MS_RFDIR > $(OneDrive)/Project Folders/Shared Project/other_ref_dir/ Note: slashes should be forward slashes in configuration files.
Kevin van Haaren said:OneDrive creates Windows Environment variables that point to the OneDrive folder of the current user
Apparently we can use other environment variables with OneDrive.
Quoting from that article: The answer is to use %OneDriveCommercial% as the generic prefix to share paths among people using the same corporate OneDrive.
%OneDriveCommercial%
Regards, Jon Summers LA Solutions
I believe %OneDrive% is the generic and %OneDriveCommercial% only exists if you're using OneDrive for business. The article you link to mentions %OneDriveConsumer% is the regular user OneDrive version. I have commercial version installed and have both %OneDrive% and %OneDriveCommercial% (pointing to the same path). I assume all products create the %OneDrive%
if you want a more fail safe way:
%undef ustnOneDrive %if !defined (ustnOneDrive) && defined (OneDrive) && ($(OneDrive) != "") && exists ($(OneDrive)) ustnOneDrive=$(OneDrive)/ %endif %if !defined (ustnOneDrive) && defined (OneDriveCommercial) && ($(OneDriveCommercial) != "") && exists ($(OneDriveCommercial)) ustnOneDrive=$(OneDriveCommercial)/ %endif %if !defined (ustnOneDrive) && defined (OneDriveConsumer) && ($(OneDriveConsumer) != "") && exists ($(OneDriveConsumer)) ustnOneDrive=$(OneDriveConsumer)/ %endif %if !defined (ustnOneDrive) %error Unable to locate Microsoft OneDrive environment variable %endif MS_RFDIR = $(ustnOneDrive)Project Folders/Shared Project/ MS_RFDIR > $(ustnOneDrive)Project Folders/Shared Project/other_ref_dir/
I couldn't find any documentation at Microsoft as to which environment variables are created when.
Many thanks Kevin
What is annoying with this solution is that every user need to edit the MS_RFDIR variable each time a new project is created to add the new path
A more convenient way would be to use a variable in the reference path:
$(OneDrive)/Project Folders/Shared Project/other_ref_dir/referenceFile.dgn
But I don't succed to do this.
Even this old trick does not seem to work anymore: https://communities.bentley.com/products/microstation/w/askinga/521/attaching-reference-file-with-a-config-variable
Rémy
Rémy Weill said:A more convenient way would be to use a variable in the reference path: $(OneDrive)/Project Folders/Shared Project/other_ref_dir/referenceFile.dgn But I don't succed to do this
But I don't succed to do this
Please post the statement in your configuration file that sets MS_RFDIR.
MS_RFDIR
You could try something like this in your configuration file...
SHARED_PROJECT = $(OneDrive)/Project Folders/Shared Project/ MS_RFDIR = $(SHARED_PROJECT)other_ref_dir/
If you want to add more folders...
SHARED_PROJECT = $(OneDrive)/Project Folders/Shared Project/ MS_RFDIR = $(SHARED_PROJECT)other_ref_dir/ MS_RFDIR > $(SHARED_PROJECT)other_ref_dir2/
Thanks Jon,
Unfortunatly that doesn't help :
Rémy Weill said:What is annoying with this solution is that every user need to edit the MS_RFDIR variable each time a new project is created to add the new path