TheSwamp

Code Red => ARX Programming => Topic started by: hmspe on March 07, 2010, 04:37:10 PM

Title: Hotkeys for Bricscad?
Post by: hmspe on March 07, 2010, 04:37:10 PM
Has anyone compiled Chuck Gabriel's Hotkeys for Bricscad V10?  If not, can someone provide pointers one what needs to be done to convert the code so it would work in Bricscad? 
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 08, 2010, 12:31:26 AM
It probably wouldn't be that hard to do with this http://www.theswamp.org/index.php?topic=29100.0

I never implemented an IExtensionApplication, so you would need to type a command to load things up.

Another method would be to translate Chucks code to C++/CLI and build a mixed managed/unmanaged BRX  :-)
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on March 08, 2010, 11:40:40 AM
Daniel,

Thanks for the pointers.  This will be a stretch for me -- my last programming class was C++ for DOS, and I'm not even close to wrapping my head around any of the .NET languages.  My hope here is to work around a problem with GRREAD [the arrow keys return the same values as %, &, (, and ;] until Bricsys gets it fixed.  Ultimately I want to implement an in-place editor for multi-line text expanding on what's in the thread "Text Command Lisp" by CAB started on October 14, 2008.  The lisp side I can handle.  The .NET side, not so much.

Martin
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 08, 2010, 08:22:09 PM
I'll take a look at it in the next couple of days. I've been using this http://www.autohotkey.com/  it works really well
Title: Re: Hotkeys for Bricscad?
Post by: Kerry on March 08, 2010, 08:36:05 PM

Daniel,
How does autoHotKey behave using the ALT key ... does it interfere with menu mneumonics ??

ie can you use say ALT+E for _ENDP ??
or say ALT+M for _MID ??

I'm a long time user of Chucks HotKeys and not being reliant on binary compatibility every 3 years is a big plus with .NET.
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on March 08, 2010, 08:55:34 PM
Thanks for the endorsement Kerry.

I don't really have anything to add to the discussion, but I would be more than happy to provide anything I can to help the process along.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 08, 2010, 09:29:53 PM
works just fine, would be the script
!E::SEND _ENDP{enter}

Autohotkey also has its own scripting language, and is able to compile .EXE that run independently
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on March 08, 2010, 09:33:08 PM
Daniel,

Thanks for looking at this.  I considered AutoHotKeys but in reading through the documentation I didn't come up with an easy and fast way to toggle the conversions on and off in a lisp routine.  For example, for the GRREAD fix the substitution needs to be only for the duration of the GRREAD. 

Martin
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 08, 2010, 09:43:27 PM
Daniel,

Thanks for looking at this.  I considered AutoHotKeys but in reading through the documentation I didn't come up with an easy and fast way to toggle the conversions on and off in a lisp routine.  For example, for the GRREAD fix the substitution needs to be only for the duration of the GRREAD.  

Martin

Sorry, I'm not sure how Autokotkeys will work in your situation. The reason I use it is because it works in all applications, not just CAD.   I do recommend you give it a try though.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 09, 2010, 04:07:04 AM
a couple of samples

Code: [Select]
;ALT + XXX
!E::send _ENDP{enter}
!M::send _MID{enter}
!C::send _CEN{enter}

;Windows Key + XXX
#e::send (entget(car(entsel)))

;string replacment
::]cdb::AcDbDatabase *pDatabase = acdbHostApplicationServices()->workingDatabase();
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 09, 2010, 04:09:49 AM
need more keys ?

^#e::send control + windows key + E
#!e::send windows key + ALT + E
^!e::send control + ALT + E
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on March 09, 2010, 04:50:23 AM
Syntax highlight and intellisense for notepad++ (and others)
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on March 09, 2010, 11:47:16 PM
After reading through the AutoHotKeys documentation I think it might be possible to set an environment variable at the start of the lisp function to match the current window title, then match the environment variable with WinGetTitle in AHK to control whether AHK substitutes for the keys.  Reset the environment variable at the end of the function.  Not sure what to do if the user changes tabs in the middle of the lisp function.  The next step is to see if it works at all....
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on May 17, 2010, 11:31:33 AM
Follow-up:  AutoHotKeys is not a good solution.  The problem is with MDI.  Getting AHK turned off when changing layout tabs is not a clean process.  The keyboard hook really needs to be thread based, not global.

Chuck, if you are still monitoring this is the original non-managed code still available anywhere?  All the links I've found are dead.

If any of the programmers here are willing to either compile Hotkeys for Bricscad or to edit the code so that it will link to Bricscad I'd still appreciate it. 

Martin
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 17, 2010, 01:56:24 PM
Chuck, if you are still monitoring this is the original non-managed code still available anywhere?  All the links I've found are dead.

Here you go.
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on May 17, 2010, 05:29:37 PM
Thank you.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on May 18, 2010, 03:53:25 AM
Chuck, did you write all that?
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 18, 2010, 07:59:12 AM
Chuck, did you write all that?

Yep.  Are you adding points or taking them away? :-)
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on May 18, 2010, 08:25:41 AM
Adding! As always, your coding is exceptional   8-)
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 18, 2010, 09:12:44 AM
Thanks.  Right back atcha.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on May 18, 2010, 09:43:15 AM
Would you mind if I port this to BRX / Bricscad? I think I would need to setup a new project and I may need to ask you a question or two.
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 18, 2010, 10:13:02 AM
I think that would be great.  Ask away.  I'll do my best.
Title: Re: Hotkeys for Bricscad?
Post by: LE3 on May 18, 2010, 12:24:13 PM
Adding! As always, your coding is exceptional   8-)
Do not know why Chuck is not working for any of the big software companies... he writes excellent code! - cheers.
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 18, 2010, 12:36:14 PM
Thanks Luis, but Chuck doesn't have the right pieces of paper, for starters.  It certainly isn't for lack of trying. 
I start work on my BS in Computer Science next Monday, though.
Title: Re: Hotkeys for Bricscad?
Post by: LE3 on May 18, 2010, 12:49:25 PM
Thanks Luis, but Chuck doesn't have the right pieces of paper, for starters.  It certainly isn't for lack of trying.  
I start work on my BS in Computer Science next Monday, though.
Excellent move, go for it!

Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on May 19, 2010, 12:55:57 PM
Beta 1 for Bricscad V10 

@ Chuck, All I really needed to do was convert the project to Unicode and add a line for demand loading. 
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 19, 2010, 01:49:23 PM
Beta 1 for Bricscad V10 

@ Chuck, All I really needed to do was convert the project to Unicode and add a line for demand loading. 


Awesome.
Title: Re: Hotkeys for Bricscad?
Post by: Daniel Eiszele on May 19, 2010, 07:31:43 PM
Just in case anyone else was looking and couldn't find them.  I pulled these out of the source code.  Does anyone know if there is a command to list the functions available in an arx file?

Commands are:

Keyson - Turns hotkeys on.
Keysoff - Turns hotkeys off.
KeysToggle - Off to On; On to Off
Keys Config - Shows Configuration Dialog
GetKeys - Lists current key mappings and commands they are bound to.
EditKeys - Loads the Hotkeys editor (Currently doesn't exist?????) 

By the way, great program Chuck.  This is one of those didn't know I needed it till I had it programs.  And thanks Daniel for doing the compilation for Bricscad.
Title: Re: Hotkeys for Bricscad?
Post by: Kerry on May 19, 2010, 10:22:56 PM

From memory, the EditKeys was a COM program, not ARX.


Daniel, with the version I compiled I added an initialise function that printed the command names to the screen ... was going to write a KeysHelp routine but never got around to it.
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 19, 2010, 10:23:24 PM
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on May 19, 2010, 10:37:48 PM
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.



That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...
Title: Re: Hotkeys for Bricscad?
Post by: Chuck Gabriel on May 19, 2010, 11:47:36 PM
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.



That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...


Here it is.
Title: Re: Hotkeys for Bricscad?
Post by: Kerry on May 20, 2010, 12:26:45 AM

That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...


Piccys and the file ...

Title: Re: Hotkeys for Bricscad?
Post by: hmspe on June 30, 2012, 12:04:27 PM
Picking up an old thread.  I thought I'd try compiling this version of HotKeys for Bricscad 12.  I'm using Visual C++ Express Edition, which I know very little about.  My last experience with C++ was in DOS about 18 years ago.  Working in VS is a lot different from the Borland IDE.  In any case, I get the following when I try a build:

1>Compiling...
1>StdAfx.cpp
1>t:\2012 work\063012 hotkeys\hotkeys\hotkeys\source\StdAfx.h(29) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.30729
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>BSCMAKE: error BK1506 : cannot open file '.\Release\HookProcedures.sbr': No such file or directory
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BRX10)

I think a lot of the problem is that I don't know where or how to point to the SDK.  Is there a tutorial that tells, on a very basic level, how to set up and compile an existing project for BRX?  Everything I've found so far assumes that "compile with the new SDK" is all the instruction anyone would need.  I need something more like a step by step.  Any help on getting started would be greatly appreciated.  If someone is willing to do a build for BC12 that would be good, too.   

Thanks.
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on June 30, 2012, 10:36:32 PM
Apparently afxwin.h is not included in the Visual C++ Express Edition.  I guess my question needs to change to ask whether it is necessary here, and if not how to remove any references.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on July 11, 2012, 11:39:57 PM
heres a new build for V12  :-)
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on July 12, 2012, 01:44:46 PM
Thanks.
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on February 03, 2016, 06:10:15 PM
I was trying to compile this for Bricscad v16.2 and a fatal error C1189 -- "#error:  MFC does not support NTDDI_VERSION less than NTDDI_WINXP.  Please change the definition of NTDDI_VERSION in your project properties or precompiled header."

I'm still in over my head when it comes to .arx programming.  Can anyone provide pointers on what to look for and where?  "NTDDI_VERSION" does not show up in any of the source. 

Thanks.
Title: Re: Hotkeys for Bricscad?
Post by: It's Alive! on February 03, 2016, 07:50:44 PM
For BricsCADv16 32 and 64 bit, I only tested that they load (x64) anyway  :crazy2:
Title: Re: Hotkeys for Bricscad?
Post by: hmspe on February 03, 2016, 10:23:51 PM
Thanks.