TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cparnell on November 10, 2005, 08:41:35 AM

Title: Object Snap keyboard overide
Post by: cparnell on November 10, 2005, 08:41:35 AM
A2K6

I'm in a mess, going back to A2K I have always assigned the number keys at the top of my keyboard to my object snaps.

["1"]_CEN
["2"]_ENDP
["3"]_INT
["4"]_MID
["5"]_NODE
["6"]_PERP
["7"]_QUA
["8"]_TAN
["9"]_nea
["0"]_appint

in my ACAD.mnu file. Doing this would allow me to override my osnap mode to use the OSnap assigned to this key. Now in A2K6, I have been unable to migrate these settings over to my main CUI file. I was told on the AutoDESK discussion forum that A2K6 will not allow anything to be assigned to the number keys at the top of the keyboard.

I am lost, using shift right click slows me down, and using icons slows me down. Is there any way to assign OSnaps to my number keys at the top of my keyboard like I am accustomed to?

I guess that I'm hoping that LISP will do the trick, but I just don't know much about LISP. Just about all I know is from a class that Robert Green taught at AUGI camp in Birmingham, AL a month or so ago.

I am LOST.
Title: Re: Object Snap keyboard overide
Post by: LE on November 10, 2005, 10:49:57 AM
Hi,

I don't have AutoCAD 2006.....

So is not there anymore the section ?:

***ACCELERATORS

Where you were able to place something like these ?:


["NUMPAD4"]_nea
["NUMPAD5"]_endp
["NUMPAD6"]_perp
["NUMPAD7"]_int
["NUMPAD8"]_mid
["NUMPAD9"]_qua
["NUMPAD1"]_nod
["NUMPAD2"]_cen
["NUMPAD3"]_ins
Title: Re: Object Snap keyboard overide
Post by: Chuck Gabriel on November 10, 2005, 10:57:02 AM
I hesitate to mention it, because the currently available version is somewhat broken, but HotKeys will allow you to create keyboard shortcuts like what you are looking for.

http://home.carolina.rr.com/hotkeys

I am told the 2004 version works in AutoCAD 2006.

Once it is installed and you have created a keys definition file with the editor, you will need to type KEYSCONFIG at the command line and use the browse button to select your keys definition file (that's the broken part).

Good luck.
Title: Re: Object Snap keyboard overide
Post by: Hangman on November 10, 2005, 01:56:41 PM
I had the guys here help me put together a lisp that'd do what your looking for.
Here it is if your interested.
Code: [Select]
;;Written by Hangman    August, 2005
;;
;;This is a Running OSnap Toggle macro lisp
;;
;;  1  ENDpoint
;;  2  MIDpoint
;;  3  CENter
;;  4  NODe
;;  5  QUAdrant
;;  6  INTersection
;;  7  INSertion
;;  8  PERpendicular
;;  9  NEArest
;;  0  OFF
;;
;;
;;

(DEFUN C:1 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 1)); on/off
  (princ)
)
;;
(DEFUN C:2 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 2)); on/off
  (princ)
)
;;
(DEFUN C:3 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 4)); on/off
  (princ)
)
;;
(DEFUN C:4 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 8)); on/off
  (princ)
)
;;
(DEFUN C:5 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 16)); on/off
  (princ)
)
;;
(DEFUN C:6 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 32)); on/off
  (princ)
)
;;
(DEFUN C:7 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 64)); on/off
  (princ)
)
;;
(DEFUN C:8 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 128)); on/off
  (princ)
)
;;
(DEFUN C:9 ()
  (SETVAR "OSMODE" (BOOLE 6 (GETVAR "OSMODE") 512)); on/off
  (princ)
)
;;
(DEFUN C:0 ()
  (SETVAR "OSMODE" 0); off
  (princ)
)
Title: Re: Object Snap keyboard overide
Post by: ELOQUINTET on November 10, 2005, 02:37:37 PM
have you looked at temporary override keys? i keep most of mine on all the time but use shift+i for insert and a couple others i use infrequently.
Title: Re: Object Snap keyboard overide
Post by: ELOQUINTET on November 10, 2005, 02:40:37 PM
hangman, does yours revert settings to previous after overriding?
Title: Re: Object Snap keyboard overide
Post by: cparnell on November 10, 2005, 04:58:37 PM
Hangman:

Thank you very much for your help, it is greatly appreciated.
I tried your routine and loaded it via appload. However when I press the number keys with out a command active, it turnes that OSnap off. When I start a command like pline, pressing 1 gives me unit in length.

Eloquintet:

I have tried using the temporary override keys. I realize that you have to hold shift+e and hold them to get end point to work, but I have only had them work on occasion. Many times I get EEEEEEEEEEEEEEEEEEEEEEEEEE's across my screen.

LE:

The only thing that I have been able to get the A2K6 CUI to accept for a command to override OSnaps is SHIFT+ something. Acutally SHIFT+1 is SHIFT+!.

Chuck:

I will look into your suggestion.

Thanks for your help guys, any other ideas.
Code: [Select]
Code: [Select]
Code: [Select]
Title: Re: Object Snap keyboard overide
Post by: ELOQUINTET on November 11, 2005, 12:25:59 PM
i've experienced that too from time to time. maybe the override only works in certain situations. so you really want to toggle the said osnap off not on, right?
Title: Re: Object Snap keyboard overide
Post by: cparnell on November 11, 2005, 12:49:26 PM
We have purchased out first AutoDESK Subscription, so I contacted them in regards to this problem. I attached some of the responce from AutoDESK.
Why in the world would they keep the number keys from being used. For me being right handed it is the ideal place, plus they are close to the Esc key.

Thanks for all of the input.
Title: Re: Object Snap keyboard overide
Post by: ELOQUINTET on November 14, 2005, 09:51:30 AM
old habits are hard to change. i've gotten used to using a combo of control right click and keyboard overrides
Title: Re: Object Snap keyboard overide
Post by: Sdoman on November 14, 2005, 03:07:44 PM
I program my osnaps into a keypad that sits next to my standard keyboard.  If you are interested, check out Xkeys.com (http://www.xkeys.com/xkeys/xkdesk.php). 

(http://www.xkeys.com/pigraphics/grxkeys/xd576.jpg)

Title: Re: Object Snap keyboard overide
Post by: cparnell on November 14, 2005, 03:10:17 PM
sdoman:

Thanks for the input. I'll have to look into that.
Title: Re: Object Snap keyboard overide
Post by: Sdoman on November 14, 2005, 03:13:53 PM
sdoman:

Thanks for the input. I'll have to look into that.

Why that's a PUN!  :lol:

My Xkeys has spoiled me rotten.  I can't run AutoCAD without it
Title: Re: Object Snap keyboard overide
Post by: cparnell on November 14, 2005, 03:16:40 PM
I know what you mean. I am lost with out my number keys.
For some reason, the OSanps don't seem to operate as well as in the past versions.
Title: Re: Object Snap keyboard overide
Post by: Sdoman on November 14, 2005, 03:25:36 PM
I know what you mean. I am lost with out my number keys.
For some reason, the OSanps don't seem to operate as well as in the past versions.

I purchased my Xkeys five or six years ago.  Best $99 I ever spent towards my career (the price hasn't changed).  Got mine at Fry's electronics.

Don't know what you mean about Osnaps not operating as well.  They work fine here, in fact better then in prior versions.
Title: Re: Object Snap keyboard overide
Post by: cparnell on November 14, 2005, 05:18:19 PM
We have a USB Keypad here at work.
I have an article by Lee Ambrosius named, "Customizing the User Interface Through the CUI Editor". I tried the, Creating Nonstandard Shortcut Keys on Page 18 but have been unable to get the keypad to work for OSanps. When I try to load the MNS file per the article, I get this MNU/MNS Conversion failed warning box. Since you have been able to get your XKeys to work, do you have any idea what I might be doing wrong?
I attached a .DOC file of a screen capture of the failed warning box and my ShortcutKeys.mns, ( I had to save my mns file to txt file to post) file as well as a PDF of Lee's article.

The keypad does work as far as being able to type in numbers.

Any help would be greatly appreiciated.
Thanks.
Title: Re: Object Snap keyboard overide
Post by: MP on November 14, 2005, 05:31:35 PM
Hate to be a stick in the mud, but I must ask, has Lee given persmission to distribute that pdf?
Title: Re: Object Snap keyboard overide
Post by: ELOQUINTET on November 14, 2005, 05:35:12 PM
i have the nostromo which i use more now for excel than autocad as i'm more in the habit of typing. i've tried it for acad but it just doesn't catch on. i would like to use it but can never memorize the keypad for all 4 modes. found it easier in the end to type m return :lmao:
Title: Re: Object Snap keyboard overide
Post by: MikePerry on November 14, 2005, 05:39:06 PM
Hate to be a stick in the mud, but I must ask, has Lee given persmission to distribute that pdf?
Hi

Might also want to check with Autodesk...

White Papers - Customization and Migration (http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=5543397)

Have a good one, Mike
Title: Re: Object Snap keyboard overide
Post by: cparnell on November 14, 2005, 05:39:21 PM
Not to me. I took it that since I received it from an AutoDESK subscription support request that it was open to any one. Is that not correct? The ariticle has the AutoDESK logo on it, so I as well took it that it was AutoDESK property. I tried to ask the previous question on Lee's HyperPics forum but it is apparently down for upgrading.
My appoligies to Lee it I should not have posted it.
Title: Re: Object Snap keyboard overide
Post by: MP on November 14, 2005, 05:47:40 PM
Hi Charles, generally speaking, imo it's best to err on the side of conservatism in these matters.

Rather than posting a copy of an article try to post a link to the orginal source. Failing that, make a genuine effort to contact the author of the article to ask permission. This was demonstrated just recently by Chuck if you search around.

The bottom line is checking for permission first is the right thing to do AND we don't wish to bring any troubles to the swamp (or Mr. Thomas).

Peace (just trying to be a good neighbor).

:)
Title: Re: Object Snap keyboard overide
Post by: Bob Wahr on November 14, 2005, 06:02:17 PM
Speaking of bottom lines, looking at the bottom line of the article, It's Autodesk, not the author who holds the copyright to that whitepaper.  Whether or not AD would like it posted, I can't answer but it seems like it's their call.
Title: Re: Object Snap keyboard overide
Post by: Sdoman on November 15, 2005, 08:11:35 AM
<clip> Since you have been able to get your XKeys to work, do you have any idea what I might be doing wrong? </clip>

I need to clarify something:

The Xkeys pad doesn't need to be programmed via the AutoCAD menu because it is a record and playback keystrokes device.  If you can type something into your standard keyboard, like an osnap, then you can record it to the Xkeys pad and play it back by hitting one button.  When you make a recording, it is stored in a memory chip inside the keypad.

There isn't a need for a device driver or some other software residing on the computer to run the pad.  The Xkeys and the standard keyboard devices are connected together via a 'Y' connector provided by the mfg.  So the computer receives input from both devices on the same cable.

Hence, the keypad does not respond to or read the AutoCAD menu (or any menu).  It only respond to the push of a button.  It is only a keystroke storage device, which can't distinguish which application is running any better then the standard keyboard..

So to get back to your request, I can't help you with your menu issue since I don't use the menu in that way and don't know how to solve your problem.  Last time I customize my AutoCAD menu for osnaps on the function keys was back in the DOS days and we had to use the DOS prompt command to pipe ANSI characters to something or ruther, I forget.