Author Topic: Replacing DesignCAD's pointrelative hotkey (using autohotkey  (Read 1765 times)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Replacing DesignCAD's pointrelative hotkey (using autohotkey
« on: November 29, 2014, 02:01:23 AM »
Some of you know I dislike the point relative dialog that pops up when you hit the ' key.  It is heavily overloaded and does everything else including the good old fashion point relative.

So I've been experimenting with Autohotkey to intercept that ' key and make it behave like the old version.  If you remember the DOS version of point relative,  you'll know what I'm aiming for.  Hence I created an Autohotkey executable.  You double click it once.  It is a form of a "service" program and just hangs around in the Windows background.  It only kicks in for DesignCAD and then only when you hit the ' key.

In the movie, I start drawing a line from the red cube.  I start the line command, and gravity snap to the top right corner, then I hit the ' key and:

x direction offset I want to go 5'-4",  I enter 5'4
y direction offset I want to go 2'-3", I enter ,2'3
z direction offset I want to go 16'-3", I enter ,,16'3

A movie - Demonstrating drawing a line using individual point relative single line offsets
Reminder: When the movie is playing, if it is going too fast, you can left click in the movie area to start/stop the action.  Also the slider to rewind.


If you want to experiment, here is the autohotkey file.
The prel.exe file.  Should work with all version of DesignCAD

Note, in your custom.ini file located in the DesignCAD program directory, you need to have the alias for the point relative command already there, but if it isn't, you need to put it back.  Make it look like the graphic.


A not so obvious comment about what I'm trying to do.  The command line input dialog will pop up fairly close to the last position of the cursor.  So it is following you around.  Hopefully that way it isn't halfway across the screen.  If you know where the cursor is, you know where the dialog will occur.
« Last Edit: November 29, 2014, 02:13:22 AM by prl »

Bob P

  • Hero Member
  • *****
  • Posts: 1140
    • Era Replica Automobiles
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #1 on: November 29, 2014, 04:05:14 AM »
Since I am a Command-line (touch-tying) jockey, I edited the custom.ini file to also include
PR=ID_POINT_RELATIVE
so that I can do a similar thing "natively" at the command line. i.e.
<spacebar> pr 5,5,,

It's all what you like.  DC works in so many wonderful ways.  8)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #2 on: November 29, 2014, 04:33:02 AM »
DC works in so many wonderful ways.  8)

The hidden beauty of DesignCAD.  I was doing it your way too.  But that's now too long for me.

You do (and I use to):

<spacebar>, type pr   then start entering offset data

My latest fiddle experiment:

'  and I start entering offset data . . . . .  (I have intercepted the DesignCAD ' hotkey), in otherwords a single keystroke, the original DesignCAD ' hotkey.  I know, everyone is rolling their eyes,  . . . . . but I just saved typing three keystrokes (hitting the spacebar and typing pr ).  Money in the bank.  Well not really.

Bob P

  • Hero Member
  • *****
  • Posts: 1140
    • Era Replica Automobiles
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #3 on: November 29, 2014, 05:19:34 AM »
prl,

Is your (exe'd) Autohotkey macro more than just sending "prel"?  I ask because I already run AHK on startup.  I've got about 50 shortcut keys for various programs.

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #4 on: November 29, 2014, 05:47:54 AM »
Is your (exe'd) Autohotkey macro more than just sending "prel"? 

Yes, the subtle differences are 1.)  it is activated by the DesignCAD ' keystroke, 2.) then it sends the spacebar, then it types prel and adds a few spaces, 3.) then it takes that DesignCAD command dialog which is always at the top of the window and moves it to where the cursor is when you hit the DesignCAD hot key and lets you add the offset data, and the biggie 4.) it doesn't execute again when the user enters the ' key for anything else in DesignCAD.  No recursion onto itself.  Remember I'm intercepting the ' key which is also used for 5'4 etc. 

You can run it separately for now.  If it actually works and others tell me it isn't causing keyboard conflicts, I'll release the code and you can add it to your master *.ahk file that loads at  startup.   
« Last Edit: November 29, 2014, 05:51:02 AM by prl »

Dr PR

  • Hero Member
  • *****
  • Posts: 5398
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #5 on: November 29, 2014, 08:44:44 AM »
To each his own ...

But did you ever stop to think how much time, and how many keystrokes, you have to waste to get to where you occasionally save a single keystroke?

I cut my teeth on macro assemblers (wrote macros to make Microsoft's M-80 assembler generate 68000 assembly language, etc.), but I quit wasting time on macros long ago. As soon as I would write a set of macros for Word, Prodesign, whatever, the programmers would change the macro language and all of the effort I expended to create the macros was wasted. I was spending more time rewriting the macros than I was using the programs!

To give credit where credit is due, the DesignCAD macro language has been very stable for at least 15 years. But it isn't fixed, unchanging. Every now and then DT posts a note that something has changed and macros that use that something need to be rewritten.

If you enjoy writing, rewriting and rewriting macros go right ahead. Personally, I don't have enough time to get all of my work done as it is, without wasting time writing macros.

Phil
DesignCAD user since 1987

Bob P

  • Hero Member
  • *****
  • Posts: 1140
    • Era Replica Automobiles
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #6 on: November 29, 2014, 09:39:09 AM »
Phil,

I can't speak for prl, but the macros that I have had to change, I can count on one hand. I guess I'm lucky.  On the other hand, I have saved countless hours using the macros.  The program would be much less powerful without them.

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #7 on: November 29, 2014, 10:57:58 AM »
I'll let the put-down about what constitutes a waste of time pass.

Regarding this topic, it isn't a DesignCAD macro.  It is a system hook implemented by Autohotkey.  Yes it is a preference of mine that DesignCAD behave a certain way.  So I search for ways to do that.  My hobby.  And for me the pointrelative command is the most heavily used command in the entire collection of DesignCAD hotkeys.  Every other thing I do is setting a point here or there.  Having to look up at the screen and tab through that GUI dialog was never going to work for me.
« Last Edit: November 29, 2014, 12:12:01 PM by prl »

Dr PR

  • Hero Member
  • *****
  • Posts: 5398
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #8 on: November 29, 2014, 12:57:06 PM »
prl,

Sorry, I didn't mean it as a put-down. I meant it seriously. How many keystrokes do you expend creating macros as opposed to how many keystrokes you eventually save using them?

I am big on reducing the amount of energy required to get work done (for example, I use a trackball instead of a mouse). But there is a break-even point where it is more trouble to try to change things than it is to just use them as is. I use a mix of hot keys, mouse clicks, custom toolbars and the occasional macro with DesignCAD and my work flow is pretty fast.

In your case, with the Point Relative function and the way you work, tabbing through all the selections in the dialog would be tedious (why doesn't it just start with the cursor in the X value - that would make it easier for all of us?). But your real purpose is to eliminate the dialog and just get it to work from the command line. So it isn't so much saving keystrokes as it is trying to get everything to work from the command line.

And I do understand the "hobby" aspect of getting a program to do things the original programmers didn't provide. It is one of DesignCAD's major features that we can customize it to fit our work patterns.

Phil
DesignCAD user since 1987

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #9 on: November 29, 2014, 03:04:46 PM »
Phil, I understand what you're saying. Technically we should all toss our DesignCAD programs in the trash because there are much more robust and reliable programs out there.  But I never just simply accept poorly implemented features in DesignCAD.  If something doesn't suit me, especially if I can do something about it, I'll change it.  Same goes for missing and perpetually broken things.




samdavo

  • Hero Member
  • *****
  • Posts: 2587
  • the trick is knowin...^ > v < - which way's up?
Re: Replacing DesignCAD's pointrelative hotkey (using autohotkey
« Reply #10 on: November 30, 2014, 02:47:54 PM »
prl
First time I read that, I thought you said "same goes for the missus"  :)