Where I work had an enterprise cuix in use which made things more difficult to edit and maintian. I simply don't care for this style with separate workspaces. In my opinion they are not neccessary. A partial is easier and more diverse, but I didn't want to dramatically change the way the company did their shortcut links, and arg profiles (which specified the enterprise settings). So, this code lets the profile be made the old enterprise way and then removes it all.
For testing I made it user specific gate at the beginning. This way I can have testers recreate their profiles and repeat the steps trying to break it.
They had a shortcut and profile for every scenario, so I had to watch and fix each as they happened.
Then remove the enterprise settings, unload the enterprise cuix menu, and load the partial cuiix menu all without the user noticing the change.
The ribbon tab was called the same and it was instantanious so without command line notificaion they would not notice.
They probably wont read the command line anyway.
I added this to an acad.lsp so that it would run at each new AutoCAD session.
(if (member (strcase (getvar "LOGINNAME")) '("******")) ;only specific users for testing
(progn
(princ (strcat "\nEnterprise to Partial menu convert for: " (getvar "LOGINNAME")));debug
(setq Profiles
(list
"ACAD_24"
"CADWORX_EQUIPMENT_24"
"CADWORX_EQUIPMENT_24_MAP3D"
"CADWORX_PID_24"
"CADWORX_PID_24_MAP3D"
"CADWORX_PLANT_24"
"CADWORX_PLANT_24_MAP3D"
"CADWORX_PLANT_W_STRUCTURE_24"
"CADWORX_STRUCTURE_24"
"CADWORX_STRUCTURE_24_MAP3D"
"MAP3D_24"
"PLANT3D_24"
)
);setq
(if (member (strcase (getvar "CPROFILE")) ET-Profiles) ;Does profile name exist
(progn
(setq regKey (strcat "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD\\R24.3\\ACAD-7101:409\\Profiles\\" (getvar "CPROFILE") "\\General Configuration"))
;(princ (strcat "\nDEBUG: Regkey: " regKey));debug
(setq removed '())
(foreach value
'("MenuFile"
"ISAVEPERCENT"
"EnterpriseMenuFile"
"IconFilePath")
(if (vl-registry-read regKey value)
(progn
(vl-registry-delete regKey value)
;(princ (strcat "Debug: " value ": " (vl-registry-read regKey value)));debug
(setq removed (cons value removed))
);progn
);if
);foreach
(if removed
(progn
(if (not (null (menugroup "ACAD_2024"))) (command "_.CUIUNLOAD" "ACAD_2024"));; Unload enterprise menu group
(if (null (menugroup "2024")) (command "_.CUILOAD" "C:\\cad_settings_2024\\acad\\cui\\2024.cuix")) ;; Load same CUIX as partial
(princ (strcat "\nProfile Cleanup: Removed " (vl-string-right-trim ", " (apply 'strcat (mapcar '(lambda (x) (strcat x ", ")) (reverse removed))))))
(princ (strcat "\n"(getvar "CPROFILE") ": Enterprise values deleted")) ;Let the user know
);progn
(princ "\nProfile Cleanup: No action required.")
);if
);progn
);if
);progn
);if