Results 1 to 15 of 28
Thread: Keystroke Macros
-
02-06-2008, 10:37 AM #1Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
Keystroke Macros
The below is information received from Rob Fisher (ChiefCanada.com), that I think most will find very useful. I followed this information, with some changes, and will post my results below.
The introduction of hotkey assignments for CA commands now allows us to create keystroke macros for automating tasks in CA. While mouse/keystroke macros were possible before X1.4, mouse position macros (recording of mouse x,y co-ordinates) are less than ideal if there is a change in window size/position or any toolbar editing.
A good example of automation would be switching to an electrical “environment” (for lack of a better word). To switch to this environment one would usually perform the following steps:
A. Switch active layerset to electrical
B. Switch current CAD layer to electrical
C. Switch text default layer to electrical or electrical labels
D. Switch dimension defaults layer to electrical
By invoking the above macro one could switch to the electrical environment with one hotkey or 1 mouse click, saving a bunch of clicks. Now how do we build this macro? Well there are a variety of methods. The easiest way is with a macro program . These programs include recorders so you don’t have to do any scripting (programming). The macro is assigned to a hotkey of your choice. I’m not a real fan of hotkeys that involve more than 1 key at a time so I use a gaming keyboard that has 18 programable keys on the left side. The keyboard (Logitech G15) also includes a recorder. I have also experimented with “Macro Toolbar” http://pitrinec.com/toolsworks.htm (shareware). This program allows macros to be recorded then assigned to a custom toolbar. I have placed this toolbar on the left side of my screen and have assigned not only CA macros but general macros and shortcuts as well. It does not interfere with CA and is no different than running any other program concurrently with CA. Autohotkey is another popular macro program which is open source and free and includes a macro recorder.
Now getting back to that macro,
The keystroke macro for this operation would look like:
A
1.Ctrl/Shft L (my hotkey for Layerset Management)
2. 6 Tabs (Tab to active layerset dropdown)
3. E (Select electrical)
4. Enter (OK)
B
1.Ctrl/Shft C (my hotkey for Current CAD Layer)
2. D (Default CAD Layer)
3. Enter (OK)
C
1.Ctrl/Shft D (my hotkey for Defaults)
2. Down (3 times)
3. T (text,callouts)
4. Right Arrow (Expand)
5. Down Arrow (Text)
6. Enter (Text Defaults)
7. Ctrl/Tab 3 times (Line Style Tab)
8. E (Electrical)
9. Enter
D
1. Ctrl/Shft A (hotkey dim def)
2. CTRL/TAB 3 TIMES (FONT TAB)
3. Tab
4. E (electrical layer)
5. EnterCliff
X6
Vista Home Premium SP-2
Gateway FX6800-01e
Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
7.00 GB RAM DDR 3........64-bit OS
NVIDIA GeForce GTS 250/PCIe/SSE2 1024 MB Memory
-
02-06-2008, 10:44 AM #2Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
Using the information received from Rob, the attached file shows a screen shot of where the Toolbars have been placed and the Macros (Icons) that have been recorded.
The first Toolbar (far left) represents the Layer Sets, that I wanted to display. These icons switch the Layer Set, without having to go through the dbx......... The second Toolbar represents the Defaults. When selecting one of these icons, the Layer Set changes, along with the Current Cad Layer, Dimensions, Text, Callout, and Marker Defaults......The third Toolbar represents icons that control On/Off for assigned layers, Lock/Unlock, and Views.......The 4th Toolbar represents switching to different Reference Sets.....By using the icons, it just a matter of selecting the icon, and the rest is automated.
Rob has some other good ideas in this area, but was over my head. When he can find time, maybe he will post these suggestions. My knowledge in this area is limited to 0, but I did manage to program 56 macros over the weekend and as far as I can tell, works great.
Macro.zipCliff
X6
Vista Home Premium SP-2
Gateway FX6800-01e
Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
7.00 GB RAM DDR 3........64-bit OS
NVIDIA GeForce GTS 250/PCIe/SSE2 1024 MB Memory
-
02-06-2008, 04:01 PM #3
Wow Cliff that sounds fantastic, thanks for sharing that. Just this type of feature has been suggested and encouraged strongly. I will definitely be giving this a try. Making sure I have all those defaults set right when working in each layerset (sometimes jumping around a lot in late-stage editing and/or plan check corrections) is a major source of errors and inconsistencies for me lately.
Bryce Engstrom: Architect, LEED AP
www.engstromarchitecture.com
Chief X6 Beta
Sketchup Pro 6, Free 8, Thea Render, Lumion
Chief to Kerkythea & Thea Render Converter
-
02-06-2008, 04:35 PM #4
That's exactly why we love teaching Chief with Rob, he is a kick *** trainer as well.
-
02-06-2008, 05:18 PM #5FrankL
- Join Date
- Nov 2007
- Location
- Westchester New York
- Posts
- 223
You guys are way out of my league! I'm going to have to retire to catch up! Great going.
-
02-06-2008, 06:59 PM #6Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
You're welcome Bryce. Rob did really good on this. Here is a link to the free Icon Editor, that I used in making the icons.
http://icofx.xhost.ro/Cliff
X6
Vista Home Premium SP-2
Gateway FX6800-01e
Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
7.00 GB RAM DDR 3........64-bit OS
NVIDIA GeForce GTS 250/PCIe/SSE2 1024 MB Memory
-
02-06-2008, 07:08 PM #7
Ha! Thanks Cliff! Reviewing it more, that was my very next question! You must be reading my mind, spooky....
Bryce Engstrom: Architect, LEED AP
www.engstromarchitecture.com
Chief X6 Beta
Sketchup Pro 6, Free 8, Thea Render, Lumion
Chief to Kerkythea & Thea Render Converter
-
02-06-2008, 07:13 PM #8Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
I was reading your mind Bryce. Kind of scary in there!!...If anyone wants the icons, I have them, but I figure they only make sense to me.
Cliff
X6
Vista Home Premium SP-2
Gateway FX6800-01e
Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
7.00 GB RAM DDR 3........64-bit OS
NVIDIA GeForce GTS 250/PCIe/SSE2 1024 MB Memory
-
02-07-2008, 07:54 AM #9Originally Posted by ambrozac
Thanks again, I am very excited about this. Figured this thread would catch fire. Guess it's just for the ultra design/CAD geeks.
Bryce Engstrom: Architect, LEED AP
www.engstromarchitecture.com
Chief X6 Beta
Sketchup Pro 6, Free 8, Thea Render, Lumion
Chief to Kerkythea & Thea Render Converter
-
02-07-2008, 08:24 AM #10
Bryce:
I'm interested, just no time to "play"
I'm wrapped up getting my website designed.
I'm still hoping for a scripting/macro capability like VBA
LewLew Buttery
Castle Golden Design - "We make dreams visible"
Lockport, NY
716-434-5051
www.castlegoldendesign.com
lbuttery at castlegoldendesign.com
CHIEF X5 (started with v9.5)
-
02-07-2008, 08:35 AM #11Registered User Promoted
- Join Date
- Dec 2003
- Posts
- 290
"Keystroke Macros"
Yes thanks for sharing.
My old software had a macro programing language which I dearly loved and is something that I've missed with CA (but quickly got over it).
I would actually prefer to script rather than record Keystroke or button clicks. It's time consuming but once done, modification seems easier to spot and implement. Is there a way to do the scripting? This is exciting, may need to dig out the drawing tablet. I wonder if CA still supports it.
Kelly
-
02-07-2008, 09:24 AM #12Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
Originally Posted by Kelly KCliff
X6
Vista Home Premium SP-2
Gateway FX6800-01e
Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
7.00 GB RAM DDR 3........64-bit OS
NVIDIA GeForce GTS 250/PCIe/SSE2 1024 MB Memory
-
02-07-2008, 03:25 PM #13Rob Fisher
- Join Date
- Nov 2004
- Location
- Medicine Hat, Alberta, Canada
- Posts
- 1,290
Here is some more info.
1. To control DBX’s with keystroke macros you must know how to manipulate the DBX'S with just the keyboard.
Eg : Tab – “Move to the next control in a Dbx”. I have attached a doc file outlining these various keyboard commands.
2. To select an entry in a dropdown box type the first letter of that item. In the example of the Default CAD layer a “D” will select the FIRST item starting with a “D”.
Windows system key combinations.doc
Kelly,You can use scripting with any program. Again there are third party programs using various scripting languages. I think the best way in the long run is to use a common language like vbscript and run it via windows scripting host. (a windows o/s file) That way users could share macros without the need for third party software. In this scenario it would be best if all the commands were initially assigned by CA so we would have a universal set of hotkey assignments. Individuals could still change these if they wished. Another advantage of using vbscript is that we could make subroutines (modules) for steps A,B,C,D above and build our macros by appending the subroutines that we require. One problem with sharing macros that deal with layers though is that everyone’s layers are different.
The "SendKeys" function in vbscript is used to send keystrokes to the Windows shell allowing you to click through dbx's or input text. If there is anyone familiar with vbscript on this forum I would like to talk to you. The problem is I am away to a training seminar until late next week, so I may not get back to you right away.Rob Fisher
X3, Win XP
Composite Hockey Stick
Former Oilers and Flames fan
-
02-07-2008, 04:41 PM #14Member-Cliff Cain
- Join Date
- Oct 2004
- Location
- Denton, TX
- Posts
- 4,311
-
02-07-2008, 07:09 PM #15
windows scripting host
FYI: this is Microsoft's windows replacement/enhancement for DOS .bat files.
FYI: .BAT files still work on windows
I have used both, .BAT more than .WSH
LewLew Buttery
Castle Golden Design - "We make dreams visible"
Lockport, NY
716-434-5051
www.castlegoldendesign.com
lbuttery at castlegoldendesign.com
CHIEF X5 (started with v9.5)