Jump to content

Recommended Posts

Posted

How does one successfully implement "!." with Submenu items to indicate which item is currently active (checked/depressed)?

 

Example:

 

I have a dynamic title block, which has visibility states. I have created commands within a partial CUI (soon to be ported to CUIx) which change the visibility state of said title block... this is working fine.

 

Where I have trouble is stepping through the Submenu items and modifying what I'm calling the 'Status' of the item (which on is currently representative of the title blocks visibility state), by adding the "!." to the Submenu item as a prefix.

 

I've made several attempts, here is my latest:

 

(defun FOO (arg / )
 (vlax-for pop  (vla-get-menus
                  (vla-item
                    (vla-get-menugroups (vlax-get-acad-object))
                    "FOO_CUI"))
   (vlax-for menu  pop
     (if (= "FOO_MENU" (vla-get-caption menu))
       (vlax-for cmd  (vla-get-submenu menu)
         (if (= arg (vla-get-caption cmd))
           (vla-put-label cmd (strcat "!." (vla-get-label cmd)))
           (vla-put-label
             cmd
             (vl-string-subst "" "!." (vla-get-label cmd))))))))
 (princ))

 

This successfully adds the "!." to the Submenu item's label, but not in the same manor as if done from with the CUI Editor... Perhaps I am chasing the wrong method, or property?

 

Here is my reference for the "!." prefix:

 

You create submenus in much the same way that you create a menu.

The following table describes the non-alphanumeric characters that can be used in the Customize User Interface (CUI) Editor. Non-alphanumeric characters not listed are reserved for future use as special menu characters.

 

Special characters for submenus

 

...

 

!.

 

Marks a command with a check mark or if an icon is displayed for the menu item it appears sunken.

 

!.Layer...

 

...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...