PDA

View Full Version : 2014 Disable description keys through command or lisp?



barshnizza494659
2014-11-18, 01:31 PM
I was wondering if there is a way to access the settings tab in the toolspace to change a setting through an autocad command or even a lisp routine.

I am trying to set up some kind of shortcut to change the "enable description keys" setting to "false" instead of having to go to the settings tab, then "points", then "commands", then "create points", then "edit command settings", then "point creation", then "disable description keys". Thanks!

BlackBox
2014-11-18, 03:25 PM
I was wondering if there is a way to access the settings tab in the toolspace to change a setting through an autocad command or even a lisp routine.

I am trying to set up some kind of shortcut to change the "enable description keys" setting to "false" instead of having to go to the settings tab, then "points", then "commands", then "create points", then "edit command settings", then "point creation", then "disable description keys". Thanks!

Give this a try... Works here in C3D 2014 & 2015:



(vl-load-com)

(defun c:DisableDecriptionKeys
(/ *error* vrsn prod c3d c3ddoc disable value)

(defun *error* (msg)
(if c3ddoc
(vlax-release-object c3ddoc)
)
(if c3d
(vlax-release-object c3d)
)
(cond ((not msg)) ; Normal exit
((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit)
((princ (strcat "\n** Error: " msg " ** "))) ; Fatal error, display it
)
(princ)
)

(if
(and
(setq vrsn
(if vlax-user-product-key ; If 2013+
(vlax-user-product-key) ; Use new function
(vlax-product-key) ; Use legacy function
)
)
(setq prod
(cond
((vl-string-search "20.0" vrsn) "10.4") ; 2015
((vl-string-search "19.1" vrsn) "10.3") ; 2014
((vl-string-search "19.0" vrsn) "10.0") ; 2013
((vl-string-search "18.2" vrsn) "9.0") ; 2012
((vl-string-search "18.1" vrsn) "8.0") ; 2011
((vl-string-search "18.0" vrsn) "7.0") ; 2010
((vl-string-search "17.2" vrsn) "6.0") ; 2009
((vl-string-search "17.1" vrsn) "5.0") ; 2008
)
)
(setq c3d (vla-getinterfaceobject
(vlax-get-acad-object)
(strcat "AeccXUiLand.AeccApplication." prod)
)
)
(setq c3ddoc (vla-get-activedocument c3d))
(setq disable
(vlax-get-property
(vlax-get-property
(vlax-get-property
(vlax-get-property
(vlax-get-property c3ddoc 'Settings)
'PointCommandsSettings
)
'CreatePointsSettings
)
'PointCreationSettings
)
'DisableDecriptionKeys
)
)
)
(progn
(vlax-put-property
disable
'value
(setq value
(if (= :vlax-false (vlax-get-property disable 'value))
:vlax-true
:vlax-false
)
)
)
(prompt (strcat "\nDecription Keys: "
(if (= :vlax-true value)
"Disabled "
"Enabled "
)
)
)
)
(cond
(c3ddoc
(prompt
"\n** Unable to access \"DisableDecriptionKeys\" property ** "
)
)
(c3d (prompt "\n** Unable to access Civil Document object ** "))
(prod
(prompt
"\n** Unable to access \"AeccXUiLand.AeccApplication\" interface ** "
)
)
(vrsn
(prompt
"\n** Unsupported version of Civil 3D ** "
)
)
)
)
(*error* nil)
)

barshnizza494659
2014-11-18, 06:58 PM
This works flawlessly! It's exactly what I was looking for. Thanks!!

BlackBox
2014-11-18, 07:44 PM
This works flawlessly! It's exactly what I was looking for. Thanks!!

You're welcome; I'm happy to help. :beer: