See the top rated post in this thread. Click here

Results 1 to 7 of 7

Thread: Reset EnterpriseMenuFile via LISP?

  1. #1
    100 Club
    Join Date
    2008-06
    Location
    Rochester, NY
    Posts
    109
    Login to Give a bone
    0

    Default Reset EnterpriseMenuFile via LISP?

    Hello,

    With help on this forum and others, I've been able to control my corporate AutoCAD environment via the ACAD.lsp. Over the years in figuring this out, I've move our custom corporate tools out of the Enterprise CUI, and into just a partial CUI that I load in via the ACAD.lsp. I've done this because I was unable to completely understand how the Enterprise CUI file worked, and was able to get things to work as I needed with the Partial CUI.

    I would like to remove the Enterprise CUI from all of our options, and I would like to do this through our ACAD.lsp, but I can't figure out what the "vla-put-EnterpriseMenuFile" value needs to be to reset it back to being nothing. I've tried " ", "None", and ".", and when I launch ACAD, our old Enterprise CUi is still mapped. I'd like to resset this instead of just removing the file from the network, or replacing it with a blank CUI to eliminate any delays when launching AutoCAD.

    Thank you,

    Dave

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    2

    Default Re: Reset EnterpriseMenuFile via LISP?

    EnterpriseMenuFile ActiveX Property is read-only; instead you'll have to use SETENV function:

    Code:
    (setenv "EnterpriseMenuFile" ".")

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    100 Club
    Join Date
    2008-06
    Location
    Rochester, NY
    Posts
    109
    Login to Give a bone
    0

    Default Re: Reset EnterpriseMenuFile via LISP?

    That looks to have done it! Thank you BlackBox!

    I am a little confused though, as "vla-put-EnterpriseMenuFile" was how I defined it in the first place... How can this be if it was read-only?

    Thank you!

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Reset EnterpriseMenuFile via LISP?

    Apologies for any confusion (busy day) - when I saw that ENTERPRISEMENU sysvar was read-only, and the error calling vla-put-EnterpriseMenuFile, I presumed it to be read-only:

    Code:
    ** Error: Automation Error. Error setting preference property **
    I verified in the ActiveX Help that the Property itself is NOT read-only, which would suggest that it might have to do with Application vs Document context. I should really test it more to speak with confidence, as it's been years since I've messed with this. Haha

    Cheers

    - - - Updated - - -

    Also, I think you might find this thread (posts #2 & #11), to be informative should you again consider to use Enterprise CUI:

    http://forums.augi.com/showthread.ph...e-cui-Main-cui


    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  5. #5
    100 Club
    Join Date
    2008-06
    Location
    Rochester, NY
    Posts
    109
    Login to Give a bone
    0

    Default Re: Reset EnterpriseMenuFile via LISP?

    Thank you VERY much BlackBox! I appreciate the additional link on the Enterprise CUI too!

  6. #6
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Reset EnterpriseMenuFile via LISP?

    Not quite sure I understand where the benefit is in dynamically loading/unloading. While you can manipulate partial CUIx files under the Main, so can the user. Also, loading/unloading on the fly tends to cause some problems with workspaces as they are looking for certain content from those files.

    You can change the Enterprise CUIx file with LISP, and while you can't change the CUIx files partially loaded to it (by design) I would argue needing that is a good indicator to start breaking things down into separate AutoCAD profiles. Inside a profile, the Enterprise CUIx has, as partials, everything needed to support that profile. As an example, we have a profile set up for our electrical design team. There is a custom partial CUIx for 3D stuff, one for 2d/schematic stuff, and a few more that are common to most of our profiles including the core AutoCAD/Express tools/etc. There is no need to load other CUIx files on-the-fly as they aren't needed for what this profile is designed for.

  7. #7
    100 Club
    Join Date
    2008-06
    Location
    Rochester, NY
    Posts
    109
    Login to Give a bone
    0

    Default Re: Reset EnterpriseMenuFile via LISP?

    Hello dgorsman,

    I have my ACAD.lsp load the partial CUI every time ACAD is launched. The partial CUI contains a custom set of tools, a tool bar (with the tools), ribbon tab (with the tools), and menu pulldown (with the tools). The ACAD.lsp loads the tool bar in a consistent location, no matter the workspace or profile. With the partial CUI, I don't have to mess around to push it to everyone, it's in a locked location on the network, after I make any needed changes, I simply take the evaluation copy of the CUI I have and overwrite the network instance, then any launch afterwards will provide the updated tool set.

    We use AutoCAD, AutoCAD MEP, AutoCAD Civil 3D, and AutoCAD w/ Carlson here, it's a nightmare to manage profiles, and I haven't found a good way to do it... the only way I've seen is to put the command switch into AutoCAD shortcuts, but no matter how much I try, I can not get staff to consistently use the shortcuts to launch AutoCAD, so there goes my means of utilizing Profiles.... Using the ACAD.lsp to load the partial CUI at every launch doesn't require shortcut changes, staff can double-click on DWGs in Windows to launch ACAD if they want (even though I discourage), and I still get my corporate customizations to them.

    This may not be the best way to handle, but for my current understanding of how things work, it's been working for us pretty well. The only complaint I get is that it does make launching AutoCAD take a little longer, because I have it reload the CUI, then reload whatever the current workspace is to ensure the tools are displayed (even if the user deletes it in the previous session).

    I hope this helps explains the reason to my madness, I am always open to doing things better. Thank you for the interest.

    I can't remember the specific reason I bailed on the Enterprise CUI, but I remembering struggling with it for a while, then getting this route to work, and I've never looked back (even though I have wondered the significance/benefit of the Enterprise CUI)...

    Here is the portion of my ACAD.lsp that loads the partial CUI:
    Code:
    ;;  Load custom menus
    (defun Tools (/)
    (if (/= (menugroup "TOOLS") nil)
     (command "_MENUUNLOAD" "TOOLS")
     ); end if
    (if (/= (menugroup "TOOLS2017") nil)
     (command "_MENUUNLOAD" "TOOLS2017")
     ); end if
    (if (/= (menugroup "SLSMC") nil)
     (command "_MENUUNLOAD" "SLSMC")
     ); end if
    (if (/= (menugroup "TWTC-OSP-MENU") nil)
     (command "_MENUUNLOAD" "TWTC-OSP-MENU")
     ); end if
      (and
        (not (menugroup "TOOLS2017"))
        (findfile "path\\Tools2017.cuix")
        (command "_.menuload" "path\\Tools2017.cuix")
      ) ;_ and
      (and
        (menugroup "TOOLS2017")
        (menucmd "p30=+POP13")
      ) ;_ and
    ) ;_ defun
    (BATools)
    Last edited by BlackBox; 2018-02-05 at 09:49 PM. Reason: Additions; Please use [CODE] Tags

Similar Threads

  1. Lisp for doing Reset Scale List to metric
    By Daniel99 in forum AutoLISP
    Replies: 1
    Last Post: 2015-04-18, 06:55 AM
  2. Reset F3 and F8 keys
    By Coloradomrg in forum AutoCAD Customization
    Replies: 6
    Last Post: 2015-01-13, 02:48 PM
  3. Filed reset to ###
    By bgrinnell in forum AutoCAD Fields
    Replies: 1
    Last Post: 2012-01-20, 06:49 PM
  4. EnterpriseMenuFile
    By Capn in forum AutoLISP
    Replies: 1
    Last Post: 2007-11-07, 10:16 PM
  5. Rotation angle reset Lisp
    By BCrouse in forum AutoLISP
    Replies: 2
    Last Post: 2007-09-11, 10:00 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
  •