No, and neither does /p import a profile. If the profile doesn't exist, it will create a new one from the defaults using the supplied name. Only specifying the path to an arg file imports the profile. The /w switch doesn't accept paths to cui files. From help: "Designates which workspace in the loaded CUIx files should be restored on startup." If you load a partial cui, it loads each time you run acad with the profile that stores the path to the partial cui. You only have to load the cui once. after that, you just specify which workspace stored in the cui to use. To make sure that everyone has the cui loaded, I use .NET code that is autoloaded at startup. It checks for the partial cui and loads it from the network if its not present.
If you don't want to do something custom like I did, then using an enterprise cui is the easiest way. Put it on a network share that only you have write rights to so that others can't mess it up. If you only have one workspace in the cui and set the enterprise cui as the main cui, then you don't even need to specify a workspace. The downside to this is that users won't be able to customize their interface, not even to add a partial cui.
Code:
IsMenuLoaded = False
Try
IsMenuLoaded = CheckCui(My.Settings.CuiName, My.Settings.CuiPath, My.Settings.PopMenuName)
If IsMenuLoaded = False Then
ed.WriteMessage(vbCrLf & My.Settings.CuiName & " menu load failed." & vbCrLf)
Else
ed.WriteMessage(vbCrLf & My.Settings.CuiName & " menu load complete." & vbCrLf)
End If
Catch ex As System.Exception
ed.WriteMessage("TID menu load failed.")
taLog.Insert(strUser, Now(), "TID menu load failed: " & ex.Message)
taLog.Update(dtLog)
Finally
ed.WriteMessage("TID_.Startup complete.")
End Try
Friend Function CheckCui(ByVal CuiName As String, ByVal CuiPath As String, ByVal PopUpName As String) As Boolean
'PopUpName parameter is formatted as csv as taken from the Name field in the cuix. No spaces.
'example: "Menu&1,Menu&2"
'Check current workspace for TID cui's.
'Use COM Interop, as doc is not available during startup.
Dim app As AcadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication
Dim mgs As AcadMenuGroups = app.MenuGroups
Dim mg As AcadMenuGroup
Dim MyMg As AcadMenuGroup
Dim IsMenuLoaded As Boolean = False
Dim ary As String() = PopUpName.Split(",")
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
Try
'We need to iterate the collection.
'Attempting to assign causes unrecoverable error.
For Each mg In mgs
If mg.Name = CuiName.ToString Then
MyMg = mg
IsMenuLoaded = True
End If
Next
If IsMenuLoaded = False Then
mg = mgs.Load(CuiPath.ToString)
'Now, make sure the menu is displayed.
For Each Str As String In ary
mg.Menus.InsertMenuInMenuBar(Str, app.MenuBar.Count + 1)
Next
End If
Catch ex As Autodesk.AutoCAD.Runtime.Exception
'MsgBox("CheckCui failed with error: " & ex.Message)
CheckCui = False
Finally
CheckCui = True
End Try
End Function