See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: Enterprise CUI with workspace

  1. #1
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    8
    Login to Give a bone
    0

    Default Enterprise CUI with workspace

    I'm looking for a way to setup a workspace/profile so whenever a user opens AutoCAD all the menu's, toolbars, etc. are setup and displayed.

    I've created a profile that will set all the support folders that's triggered by the shortcut with a profile switch.

    But I have no idea how to setup the workspace. Can someone PLEASE help me with this?

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,166
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    Assuming you are using a shortcut to start AutoCAD, you can add the /w switch with the desired workspace name to the shortcut.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,525
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    The workspace and profile are independent of each other, but both are required to control the system. As Opie mentioned, you can start AutoCAD with the /w switch in the shortcut. That loads a workspace if they have it in their current CUIX file, which you can specify in the profile. To load the profile at startup, use the /P switch to specify a profile. You can just use a profile name if its already loaded, or specify a path to an *.arg file. You may also choose to use an Enterprise CUI.
    C:> ED WORKING....


    LinkedIn

  4. #4
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    8
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    So will the workspace switch in the shortcut import the cui like it does for the profile?

  5. #5
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,525
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    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
    Last edited by Ed Jobe; 2024-06-13 at 04:07 PM.
    C:> ED WORKING....


    LinkedIn

  6. #6
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    8
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    I have a enterprise cui that I'm using, the problem I'm having is I have to set at every users machine and load the partial cui. This wasn't an issue in the past because everyone was in one location, but the company I work for recently bought another engineering firm in England so you can see my dilemma. I want the users to be able to customize their workspace however they want.

    I've never had to start from scratch, so I'm not familiar with the correct way to do what I'm inquiring about.

    My end goal is to have it so I dont have to do anything but have them copy the shortcut to their desktop and when AutoCAD launches, the enterprise cui menu's, toolbars, etc are loaded.

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,525
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    Do you all have a common network? or are they on a separate network in England?
    C:> ED WORKING....


    LinkedIn

  8. #8
    Member
    Join Date
    2012-03
    Location
    Houston, TX
    Posts
    8
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    We are going to have a common network.

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,525
    Login to Give a bone
    0

    Default Re: Enterprise CUI with workspace

    Once you get a common network, you could copy an acad.lsp file to their pc's and load whatever menu's you want. You can do whatever setup you need using lisp or scripts. The lisp can load partial menus from the network if they are not already loaded.
    C:> ED WORKING....


    LinkedIn

  10. #10
    Active Member
    Join Date
    2001-12
    Location
    Pittsburgh, PA
    Posts
    76
    Login to Give a bone
    1

    Default Re: Enterprise CUI with workspace

    A setup that we use is we have an Enterprise cui that we place all the menus, toolbars, & ribbon items created. And on everyone's profile they link to that cui for the Enterprise and they have their own cui under the main. This way anytime anything gets updated under the Enterprise cui, they will see the changes anytime they open AutoCAD. And with them having their own cui, they can make their own changes.

    Hope that helps.

Similar Threads

  1. 2014: Adding a Workspace CUI to the Workspace Drop Down List
    By larryh.72251 in forum AutoCAD CUI Menus
    Replies: 1
    Last Post: 2014-10-02, 05:39 PM
  2. Replies: 1
    Last Post: 2012-08-02, 02:39 PM
  3. Enterprise.cui + Main.cui
    By Pierre P in forum AutoCAD CUI Menus
    Replies: 11
    Last Post: 2012-03-16, 12:51 PM
  4. Replies: 1
    Last Post: 2011-11-21, 07:44 PM
  5. Replies: 1
    Last Post: 2006-09-20, 09:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •