Select location menu
Hi,
is it possible to disable the select location menu from popping up ?
ty
Comments
-
If you mean the PromptMenu:
If you want to manually disable this menu you can use the setting command. Just search for PromptMenu.
But it is not possible to do this with a lisp-program.
You can change the setting in the registry via lisp, but BC will not use this setting and on exit will reset it to it's old value.0 -
I always keep PROMPTMENU set to 0 but just checking I find getvar / setvar from Lisp work with PROMPTMENU variable and are preseved between Bricscad sessions (v10.2.13) if that helps.
0 -
Roy, how do you change a registry setting using lisp? That would be great, but I've never heard of it.
0 -
Hi Anthony. Here is a little example I made last year when I was playing with registry access. Also note if you want to save info specific to your app you can use setcfg and getcfg.
;;=============================================================================
;; Set the path for file open and save dialogs. Validation of the path
;; input existence is not done here.
(defun nss:set_dwg_open_save_path ( path )
;;=============================================================================
(nss:set_reg_recent_path "Dwg" path)
)
;;=============================================================================
;;=============================================================================
;; Get the path for file open and save dialogs.
(defun nss:get_dwg_open_save_path (/)
;;=============================================================================
(nss:get_reg_recent_path "Dwg")
)
;;=============================================================================
;;=============================================================================
(defun nss:set_default_path (path)
;;=============================================================================
(nss:set_reg_recent_path "Default" path)
)
;;=============================================================================
;;=============================================================================
;; Set the path for block insert dialogs and xref relative paths. Validation
;; of the path input existence is not done here.
(defun nss:set_insert_path ( path )
;;=============================================================================
(nss:set_reg_recent_path "Insert" path)
)
;;=============================================================================
;;=============================================================================
;; Get the path for block insert dialogs and xref relative paths.
(defun nss:get_insert_path (/)
;;=============================================================================
(nss:get_reg_recent_path "Insert")
)
;;=============================================================================
;;=============================================================================
;; Set the path in the Recent Paths part of the profile. Validation of the
;; path input existence is not done here.
(defun nss:set_reg_recent_path ( path_type path / app
pkey
recent_paths_key_name
)
;;=============================================================================
(if (and path_type path (/= path_type "") (/= path ""))
(progn
;; get the registry product key
(setq pkey (vlax-product-key))
;; create the string path to the "Recent Paths" key
;; in the current profile
(setq recent_paths_key_name
(strcat
"HKEY_CURRENT_USER\\"
pkey
"\\Profiles\\"
(getvar "CPROFILE")
"\\Recent Paths\\"))
;; set the path in Recent Paths to see if it is used
;; for the Open dialog
(setq res (vl-catch-all-apply
'vl-registry-write (list recent_paths_key_name path_type path)))
(if (vl-catch-all-error-p res)
(print (strcat "ERROR: setting value in recent path\n"
vl-catch-all-error-message res))
(prin1)
)
)
)
)
;;=============================================================================
;;=============================================================================
(defun nss:get_reg_recent_path ( path_type / app
pkey
recent_paths_key_name
)
;;=============================================================================
;; Get the path in the Recent Paths part of the profile.
;;=============================================================================
(if (and path_type (/= path_type ""))
(progn
;; get the registry product key
(setq pkey (vlax-product-key))
;; create the string path to the "Recent Paths" key
;; in the current profile
(setq recent_paths_key_name
(strcat
"HKEY_CURRENT_USER\\"
pkey
"\\Profiles\\"
(getvar "CPROFILE")
"\\Recent Paths"))
;; get the path from Recent Paths
(setq res
(vl-catch-all-apply
'vl-registry-read
(list recent_paths_key_name path_type)))
(if (vl-catch-all-error-p res)
(print (strcat "ERROR: Getting value in recent path\n"
vl-catch-all-error-message res))
res
)
)
)
)
;;=============================================================================
;;=============================================================================
(defun C:TEST ( / )
;;=============================================================================
(nss:set_dwg_open_save_path "C:\\")
)
;;=============================================================================0 -
@Greg:
Thanks for the information on using getvar/setvar for the promptmenu. I didn't know you could do this and, a month ago, have even filed a support request asking for this capability! I feel a little silly now...@Anthony
Another registry example:
http://www.bricsys.nl/common/support/forumthread.jsp?id=110620 -
In v9, the PromptMenu setting is listed as a preference, and (setvar "promptmenu" 0 or 1) doesn't work.
In v8, the PromptMenu setting is listed as registry-stored, but for some reason (setvar "promptmenu" 0 or 1) does work.
Thanks for the info on setting preferences with Vlisp. I don't understand nss, and can't find any reference to it with a Google search. Vlisp seems a very secretive language. I always wonder how anyone knows how to use it. The asmitools page linked to in that other forum thread is gone now.0 -
Anthony, sorry for the confusion. The nss: is just a prefix I use on most of my functions to reduce liklihood of name collisions. I usually remove the prefix before posting just to make the code easier to read.
0 -
Alternative links for Lisp reference info (just as ASMI these seems to be html-versions of AutoCAD help file):
http://www.kxcad.net/autodesk/autocad/AutoLISP_Developers_Guide/index.htm
http://www.kxcad.net/autodesk/autocad/AutoLISP_Reference_Guide/index.htm
http://www.kxcad.net/autodesk/autocad/AutoLISP_Tutorial/index.htm
0