News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

AutoHotKey and DesignCAD

Started by prl, July 07, 2014, 04:21:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prl

The recent discussion of DcPr (DesignCAD point relative), prompted me to play around with AutoHotKey a bit more.  I was looking for a way to override the point relative hotkey ' while still using the same key location.  In other words, the DesignCAD hotkey for point relative is the same, but is is intercepted at the OS level by AutoHotKey and I do some tricks with it.

So initially,
1. I have AutoHotKey move the native DesignCAD command line to the middle of the screen, (personally I never liked it up top), and

2. I have it readied for the point relative command waiting for x,y,z data.

Seems to work, but I call it an experiment because the sticking point will be not to have the autohotkey fire when you don't intend the ' key to be point relative but simply '.   Right now, the first time it intercepts the ' key, it will no longer intercept that key until the user presses "enter".

An AutoHotKey DesignCAD Point Relative Override Flash Movie

In the movie, I start the line command and

x direction 5'-4"
y direction 3'-3"
z direction 8'-9.5"
x direction 5'-3"

Then I measure the various line portions to verify the point relative command entered what I intended.
Then I move the cube.

Sample file attached.

Also, here is the AutoHotKey code.  Phil will like the name of the file. 

;Program:  DcPr.ank  (DesignCAD Point Relative)

MsgBox 0,, Jul 7 2014 - a DcPR experiment,2

;**********************************
; DesignCAD
;**********************************

;substitute space prel space
#IfWinActive DesignCAD 3D MAX
    '::
      SendInput, {SPACE}
      SendInput, prel{SPACE}
      wingetpos x,y,w,h,DesignCAD 3D MAX
      x := x + w/2
      y := y + h/2
      w := w - w/3
      h := 40
      w := 400
      sleep, 40
      winmove,ahk_class #32770,,%x%,%y%,%w%,%h%
      KeyWait,{ENTER},D
   Return
;**********************************


And the compiled program is in the zip file in case someone else wants to help me evaluate/debug this approach.

prl

#1
Okay, initial quirks already discovered.

User hits command line, and starts typing something that has a ' in it.  So I need to account for that.  I'm guessing this also happens with any command or multiline text where the ' key is used.

Trying to account for all these ' "triggers" is why traditionally I have used the ` key (the one to the left of the 1 key, below the escape key, left on keyboard).  In my world, that ` key serves no purpose in DesignCAD.

prl

Well, I think I've answered my own question.  I would need AutoHotKey to intercept the DesignCAD windows message that is fired when the ' key is pressed as a hotkey and not the low level keyboard message.  And since I can't get that message, I can't distinguish how the ' key is being used.

So, an interesting experiment but looks to be I'm forced to stick with the ` key, as before

I'll keep this topic up in case someone else knows of other hooks or message intercepting tricks.

Lar

I know absolutely nothing about AutoHotKey but whenever ' is not being used as a command, (ie, it's being used in a sentence) a text field would be active. Can't AHK detect this and ignore it as a command? So, instead of hijacking the 'Point Relative Command' message it yields to the 'Text Field Now Active' message.

Lar

samdavo

prl,
considering the dialog I have with most of my relatives, what's the point?
Sorry - I meant to say good luck in your quest to tame the apostrophe - must be a possible trophy in that you'd think?.
I'm off to catch some zz's.
cheers

prl

 8)  Part of my endless quest to hunt down and kill overloaded DesignCAD dialogs,  . . . .  and keep the hotkeys native.

Dr PR

#6
prl,

I know you like those "flash movies" but I find them VERY frustrating. The buttons at the bottom don't work to stop the video or go back to see something again. So you have to let the thing run to the end and start over.

Maybe it's my browser (IE). I'll try it with Firefox and see if that works.

Well, in Firefox the start/stop buttons work, but there is no way to "rewind" and replay just a portion.

Phil
DesignCAD user since 1987

prl

Quote from: Dr PR on July 07, 2014, 07:29:37 AM
I know you like those "flash movies" but I find them VERY frustrating.

Phil, I switched to flash (from the screen executables).  Movies are for users benefit, not mine.  Just trying to "show", rather than expound. 

I'll see if I can find some other flash controls that allow for partial rewind.  Start, stop, restart from beginning should already be working.

Dr PR

I agree that a (moving) picture is worth a lot more than a thousand words.

Phil
DesignCAD user since 1987

prl

#9
Strange that the rewind control isn't easily found.  A big Adobe Flash secret.

A comparison of a quick sample movie I made in terms of file size (all the same clip).

Avi - 20 mb
Avi zipped = 3.6 mb
Screen2exe = 356 kb
swf = 500 kb

To get the rewind, at this point, only avi and Screen2exe.  I switched to Flash since some folks didn't like running downloaded executables.  And for some reason, screen2exe (3.6), doesn't work on Minstrel's machine.  Not sure about others, they didn't say. 

So I said, hey, go with browser flash, they all have web browsers.

I'll look a little more this evening.


Rob S

Any way to convert this .swf to .flv format?

Those use flash player, and you can move the indicator on the progress bar to any point in the movie you want.

For some reason, your .swf player appears to display a progress bar, but no indicator to show the position of the movie
User since forever

prl

#11
This should be better.  Full rewind and/or position is added.

An AutoHotKey DesignCAD Point Relative Override Flash Movie

Note you can left click on the film to pause/play it. 

Rob S

OK, now how do you make those, can it be done with free or open-source programs?
User since forever

prl

Both types are made with freeware.

The first type with CamStudio.  The second one I just added was made with BB FlashBack Express  http://www.bbsoftware.co.uk/BBFlashBack_FreePlayer.aspx



samdavo

Quote from: prl on July 07, 2014, 08:02:21 PM
Both types are made with freeware.
well said Jimmy, ach aye.
Something to try on the weekend :)