TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ScottMC on August 15, 2018, 11:50:24 PM
-
Hopes are I'll find more info or links to examples yet suggestions are appreciated as to the utilization of these acet commands. Turning off the 'shift to acquire' format for my use of 'OTRACK' would have to happen. I know it's just my lack of searching..
-
I have used these functions in odcl OnClicked events to enable multiple actions for a single control. But I think the functions can be used whenever you ask for user input. In BricsCAD these are built-in functions, but AutoCAD users will have to install the Express Tools.
(defun c:test ()
(getstring "\nPress Enter or Shif+Enter: ")
(if (acet-sys-shift-down) (princ "\nYou pressed Shif+Enter "))
(princ)
)
-
Lots of info here: Swamp Search
(https://goo.gl/ZU5E9D)
-
In testing the suggestion, here's the results:
Command: _appload SH+CMD.lsp successfully loaded.
Command: test
Press Enter or Shif+Enter: -> "Waited for me to press keys.."
; error: no function definition: ACET-SYS-SHIFT-DOWN -> Results
This is the current [acad-cepted] loaded code:
(defun c:test ()
(vl-load-com)
(arxunload "acetutil.arx")
(arxload "acetutil.arx")
(getstring "\nPress Enter or Shif+Enter: ")
(if (acet-sys-shift-down) (princ "\nYou pressed Shif+Enter "))
(princ)
)
So excited, this is going to be usable - in many ways! ?Do software companies
take/buy posted ideas off this site seeing as the team effort exhibited shows its
power so well? I'd rather the generosity used for the final effort of development,
design, production and efficiency etc. JMHO
-
Personally I would check and load the Express Tools somewhere else in the application. And I would not use (arxunload) directly followed by (arxload). Consider this instead:
(defun c:test ()
(if (not acet-sys-shift-down) (arxload "acetutil.arx"))
(getstring "\nPress Enter or Shif+Enter: ")
(if (acet-sys-shift-down) (princ "\nYou pressed Shif+Enter "))
(princ)
)
-
-
Yup it did conflict being loaded but efernal your checker solved that error. Now the challenge still exists for me.. I've never attempted to use the"Shif+Enter" in a command and it still shows the same error as above. This conflict has got me spilling the tool box to find out where it is.... and it's certainly GOOD to do as.. so many other treasures I wasn't looking for has been found as a result!
-
Works good with grread mouse button(s), and not with the keyboard ones (for grread) :
(defun C:test
( / g s b
) ; this technique doesn't work with KBD keys (and (= 3 (car g
)) (setq b
(+ (if (acet
-sys
-shift
-down
) 1 0) (if (acet
-sys
-control
-down
) 2 0))) ( (= 3 (logand 3 b
)) (princ "\nYou pressed Ctrl+Shift+LMB") ) ( (= 2 (logand 2 b
)) (princ "\nYou pressed Ctrl+LMB") ) ( (= 1 (logand 1 b
)) (princ "\nYou pressed Shift+LMB") ) ( (princ "\nYou pressed LMB") ) ); cond
); and
); while
); defun
-
With this error repeating, must be I'm missing something having looked at my command list (acet..) it does exist. Got to have something to do with the results[out] of the command [nil or "T"] and how to use that. Running A2k. Still interesting to learn with y'alls assist.. Tks :-D
Command: test
; error: no function definition: ACET-SYS-SHIFT-DOWN
; reset after error
Command:
-
With this error repeating, must be I'm missing something having looked at my command list (acet..) it does exist. Got to have something to do with the results[out] of the command [nil or "T"] and how to use that. Running A2k. Still interesting to learn with y'alls assist.. Tks :-D
Command: test
; error: no function definition: ACET-SYS-SHIFT-DOWN
; reset after error
Command:
Do you have Express Tools installed? If not, then you will always get this error.
-
From an earlier post http://www.theswamp.org/index.php?topic=48162.0 (http://www.theswamp.org/index.php?topic=48162.0) and test, seems my acetutil is loaded. Still the same error.. must be I'm trying to use this "ACET-SYS-SHIFT-****" in the wrong way. A similar "ACET-SYS-KEYSTATE KEYCODE" worked fine....
(defun expresstools
-p
( ) )
)
ALSO:
Command: (acet-reg-prodkey)
"Software\\Autodesk\\AutoCAD\\R15.0\\ACAD-1:409"
EDIT: Added code tags. - John
-
Maybe this helps:
(defun KGA_Sys_KeyStateGet_ShiftDown_P ()
(or
(minusp (acet-sys-keystate 160)) ; Left Shift.
(minusp (acet-sys-keystate 161)) ; Right Shift.
)
)
-
roy_043 you got it!! Major progress!! Now it's my part to get the program to use the results. :-D
Works well but requires a restart of the command to change to "Extend" Also noticed (grread) could
solve the [shift mouse right-click ] conflict..
(defun C:tt (/ sset) ;; Works to extend if, when done selecting, key: shift & right click/enter.
;; Removed a "key customization" in ***AUX2 which was used for a mouse
;; kbrd combo command [shift+right click/enter] Now shift right-click works
(setvar "cmdecho" 0)
(princ " \nTrim or Extend")
(setq sset (ssget))
(if (> 0 (acet-sys-keystate 160))
(progn
(command "extend" sset "") ;shift + right click/[enter]
)
(command "trim" sset "") ; right click/[enter]
)
(vl-load-com)
(setvar "cmdecho" 1)
)
Will a command be allowed to change using a "while" loop?