So we are working on complete overhaul of our cadd system here and we have moved all of our user specific content into our users corporate Onedrive accounts. This is great as it keeps things backup and they can access it easily from any machine they are using Autocad on. The issue I've run into is how do we path that within the CUI file so that when we switch tool palettes it will load from the onedrive. We have tried using dedicated paths but because we require the path to be c:\users\username\onedrive it fails because it either reads the username literally and won't accept %username%.
The solution we found was using some code in the mnl to develop a UserToolPalettePath variable that uses the username and then push it through in the cui with this macro ^C^C(command "*_toolpalettepath" UserToolPalettePath);TOOLPALETTES;
This works but I'm curious if there is a better way.
Thanks
Dylan
***THE POST TITLE HAS BEEN EDITED FOR CLARITY***
Another (possible) way:
Better? (Maybe.)
Would you mind elaborating on this solution? I'm in the process of performing a similar task in my organization and mapping tool palettes (as well as templates) with %username% but obviously ACAD doesn't accept it. My experience with mnl files is limited at best, but this seems to be the best solution I have stumbled across yet
Hi Daniel,
So the coding we used in the cui file ^C^C(command "*_toolpalettepath" UserToolPalettePath);TOOLPALETTES;
The mnl coding was a little trickier to figure out but what we ended up with was
(setq username (getenv "username")
UserFolderPath (strcase (strcat "C:/Users/" username "/OneDrive/Autodesk/ACAD Custom 2022/"))
UserToolPalettePath (strcase (strcat "C:\\Users\\" username "\\OneDrive\\Autodesk\\ACAD Custom 2022\\Tool Palettes\\"))
)
So in this case the mnl file grabs your username from the computer you are on and then we built our folder paths around it. Once we had that we were able to use that and turn it into the variable of UserToolPalettePath and put that in the macro coding in the CUI.
Hope that helps.
Dylan
Can't find what you're looking for? Ask the community or share your knowledge.