Poll

Does anyone have a program which uses acet-sys-ctrl-down??

Yes
3 (37.5%)
No
5 (62.5%)

Total Members Voted: 8

Author Topic: Like to utilize the acet-sys-shift/control-down commands  (Read 4196 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 191
Like to utilize the acet-sys-shift/control-down commands
« 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..

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #1 on: August 16, 2018, 04:25:10 AM »
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.
Code: [Select]
(defun c:test ()
  (getstring "\nPress Enter or Shif+Enter: ")
  (if (acet-sys-shift-down) (princ "\nYou pressed Shif+Enter "))
  (princ)
)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #2 on: August 16, 2018, 10:13:47 AM »
Lots of info here:  Swamp Search
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ScottMC

  • Newt
  • Posts: 191
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #3 on: August 16, 2018, 12:14:06 PM »
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:

Code: [Select]
(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
« Last Edit: August 16, 2018, 12:34:28 PM by ScottMC »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #4 on: August 16, 2018, 03:39:52 PM »
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:
Code: [Select]
(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)
)

efernal

  • Bull Frog
  • Posts: 206
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #5 on: August 16, 2018, 06:27:43 PM »
Code - Auto/Visual Lisp: [Select]
  1. ;; or
  2. (if (not (member "acetutil.arx" (arx)))(arxload "acetutil.arx"))
  3.  
e.fernal

ScottMC

  • Newt
  • Posts: 191
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #6 on: August 16, 2018, 07:29:46 PM »
Code - Auto/Visual Lisp: [Select]
  1. ;; or
  2. (if (not (member "acetutil.arx" (arx)))(arxload "acetutil.arx"))
  3.  

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!
« Last Edit: August 16, 2018, 08:38:57 PM by ScottMC »

Grrr1337

  • Swamp Rat
  • Posts: 812
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #7 on: August 17, 2018, 04:07:19 AM »
Works good with grread mouse button(s), and not with the keyboard ones (for grread) :

Code - Auto/Visual Lisp: [Select]
  1. (defun C:test ( / g s b ) ; this technique doesn't work with KBD keys
  2.   ('((x)(or (member x (arx))(arxload x))) "acetutil.arx")
  3.   (while (not s) (setq g (grread))
  4.     (and (or (= 25 (car g))(equal '(2 13) g)) (setq s t))
  5.     (and (= 3 (car g)) (setq b (+ (if (acet-sys-shift-down) 1 0) (if (acet-sys-control-down) 2 0)))
  6.       (cond
  7.         ( (= 3 (logand 3 b)) (princ "\nYou pressed Ctrl+Shift+LMB") )
  8.         ( (= 2 (logand 2 b)) (princ "\nYou pressed Ctrl+LMB") )
  9.         ( (= 1 (logand 1 b)) (princ "\nYou pressed Shift+LMB") )
  10.         ( (princ "\nYou pressed LMB") )
  11.       ); cond
  12.     ); and
  13.   ); while
  14.   (princ)
  15. ); defun
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)
vevo.bg

ScottMC

  • Newt
  • Posts: 191
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #8 on: August 17, 2018, 10:50:03 PM »
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:

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #9 on: August 22, 2018, 01:05:29 PM »
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.

ScottMC

  • Newt
  • Posts: 191
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #10 on: August 22, 2018, 09:28:50 PM »
From an earlier post 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....

Code - Auto/Visual Lisp: [Select]
  1. (defun expresstools-p ( )
  2.     (or
  3.         (member "acetutil.arx" (arx))
  4.         (and (findfile "acetutil.arx") (arxload "acetutil.arx" nil))
  5.     )
  6. )

ALSO:
Code: [Select]
Command: (acet-reg-prodkey)
"Software\\Autodesk\\AutoCAD\\R15.0\\ACAD-1:409"


EDIT: Added code tags. - John
« Last Edit: August 23, 2018, 09:05:23 AM by John Kaul (Se7en) »

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #11 on: August 23, 2018, 04:13:55 AM »
Maybe this helps:
Code: [Select]
(defun KGA_Sys_KeyStateGet_ShiftDown_P ()
  (or
    (minusp (acet-sys-keystate 160)) ; Left Shift.
    (minusp (acet-sys-keystate 161)) ; Right Shift.
  )
)

ScottMC

  • Newt
  • Posts: 191
Re: Like to utilize the acet-sys-shift/control-down commands
« Reply #12 on: August 25, 2018, 10:40:53 PM »
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..
Code: [Select]
(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?
« Last Edit: September 02, 2018, 03:39:10 PM by ScottMC »