Author Topic: CUI right click menu override ...  (Read 3123 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
CUI right click menu override ...
« on: February 20, 2007, 06:21:36 PM »
Does anyone know how to over-ride the right click snap settings ??

I use the keyboard extensively, so when I am snaping to an endpoint, I right-click to get the menu, then hit the 'E' key for endpoint.
Makes things quick and easy.
So, I want to over-ride the "Mid be&tween 2 points" from 't' to "Mid bet&ween 2 points" to 'w', the "&Midpoint", 'M' to "Mi&dpoint" 'd', and the "No&de" 'd' to "N&ode" 'o'.
The problem I am having is that the ACAD.cui is a partial cui in our Enterprise cui file.  I can't edit that.

So can I over-ride it with my own Main cui file ??

Thanks.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Birdy

  • Guest
Re: CUI right click menu override ...
« Reply #1 on: February 20, 2007, 06:38:22 PM »
Never tried that.  Cant you drag those shortcuts into your Main cui and edit them there?
Dunno if it'll override the acad cui though.

Hangman

  • Swamp Rat
  • Posts: 566
Re: CUI right click menu override ...
« Reply #2 on: February 20, 2007, 06:46:41 PM »
Yeah, tried that one.  I was to the understanding that if the ACAD cui was a partial in the enterprise, anything in the main would over-ride it.  But so far, I'm not having any luck.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Birdy

  • Guest
Re: CUI right click menu override ...
« Reply #3 on: February 20, 2007, 06:53:05 PM »
Ours is set up that way, and only today has anyone asked about it.  So I'm interested in a solution as well.

If I stumble upon  it, I'll post-up.

Hangman

  • Swamp Rat
  • Posts: 566
Re: CUI right click menu override ...
« Reply #4 on: April 27, 2007, 02:23:57 PM »
So, I believe I have found the solution to this little dilemma if anyone is interested.

I have a DEFAULT USERS.CUI file on the server for those users who don't have a custom one of their own.  Those that do have a customized CUI file usually have that on their own machine.
The Enterprise.CUI is on the server.

I have several partial CUI's in the Enterprise, one of those being ACAD.CUI

Take everything in the shortcut menu out of the ACAD.CUI and transfer it over to the DEFAULT USERS.CUI.  So anyone with the DEFAULT USERS.CUI set in the Main Customization files path will still have the default shortcut menu.
Then, in your own customized CUI file, edit the shortcut menu as you please.  This customized CUI file will be in your Main Customization files path rather than the DEFAULT USERS.CUI.

That's all there was to it.
I'll stop back by if you have further questions regarding this.
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DaveW

  • Guest
Re: CUI right click menu override ...
« Reply #5 on: April 27, 2007, 06:55:48 PM »
So, I believe I have found the solution to this little dilemma if anyone is interested.

I have a DEFAULT USERS.CUI file on the server for those users who don't have a custom one of their own.  Those that do have a customized CUI file usually have that on their own machine.
The Enterprise.CUI is on the server.

I have several partial CUI's in the Enterprise, one of those being ACAD.CUI

Take everything in the shortcut menu out of the ACAD.CUI and transfer it over to the DEFAULT USERS.CUI.  So anyone with the DEFAULT USERS.CUI set in the Main Customization files path will still have the default shortcut menu.
Then, in your own customized CUI file, edit the shortcut menu as you please.  This customized CUI file will be in your Main Customization files path rather than the DEFAULT USERS.CUI.

That's all there was to it.
I'll stop back by if you have further questions regarding this.


There is another way to change what the right-click menu says by modifying it in a real time in memory with VBA.
I do not know if it will allow to modify the keys, but if it does, that would be much better then editing any file on the machine.

Code: [Select]
Public Sub AddMenu()

    Dim openMacro As String


    Dim FileSubMenu As AcadPopupMenu
    Dim menu As AcadPopupMenu
    Dim newMenu As AcadPopupMenu
    Dim MySubMenu As AcadPopupMenu   
    Dim newMenuItem As AcadPopupMenuItem
    Dim MynewMenuItem As AcadPopupMenuItem
   
    On Error Resume Next
   
    Set menu = ThisDrawing.Application.MenuBar.Item("ContextEdit")
   
    If menu.Name = vbNullString Then
        Set menu = ThisDrawing.Application.MenuBar.Item("Context menu for edit mode")
    End If
       
    If menu.Name = vbNullString Then
        Set menu = ThisDrawing.Application.MenuBar.Item("Edit Menu")
    End If
 
    openMacro = Chr(3) & Chr(3) & "SomeCommandName" & Chr(32)
    Set newMenuItem = menu.AddMenuItem(2, "Some sort of program info (SomeCommandName)", openMacro)
    newMenuItem.HelpString = "Run My Software"
   
    Set MySubMenu = menu.AddSubMenu(3, "The flyout menu at this location is 3")
    openMacro = Chr(3) & Chr(3) & "some command name" & Chr(32)
   Set MynewMenuItem = MySubMenu.AddMenuItem(menu.Count + 1, " another Some sort of program info  (SomeCommandName)", openMacro)
           
    Set newMenuItem = Nothing
   
End Sub

Private Sub AcadDocument_BeginRightClick(ByVal PickPoint As Variant)
    AddMenu
End Sub


The code above is for the right-click context sensitve menu. In 2006 - 2008, it is called "Edit Menu" in the cui.
You will need to find out what the menu name is you want and add it there.
If the index number is the same, it will replace whats there. You may have to add code to also delete the old one partially or totally to get what you what.

NYacad

  • Guest
Re: CUI right click menu override ...
« Reply #6 on: May 03, 2007, 09:11:33 PM »
Quick OSNAP changing is so important (time-saving), that it deserves Hot Keys assignment. For instance, End Point: F5; Center: F4; MidPoint: F11 etc. (you can add F12, as well as F6 and F7). It was easy in AutoCAD<2006. It is tricky in AutoCAD>=2006 (see sample for F5 = end point):
http://www.nyacad.com/ArticlesImages/F5_Endpoint.png

P.S. Hot keys help you keep busy two hands. So you will be able to work (no wrist problem) in AutoCAD at the age of 90.

Alex Borodulin
http://www.nyacad.com