Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    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. Enter
    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

  2. #2
    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.zip
    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

  3. #3
    Join Date
    Mar 2006
    Location
    Arroyo Grande, CA
    Posts
    5,312
    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

  4. #4
    Join Date
    Jun 2001
    Location
    Houston,Texas
    Posts
    10,154
    That's exactly why we love teaching Chief with Rob, he is a kick *** trainer as well.

  5. #5
    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.

  6. #6
    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

  7. #7
    Join Date
    Mar 2006
    Location
    Arroyo Grande, CA
    Posts
    5,312
    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

  8. #8
    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

  9. #9
    Join Date
    Mar 2006
    Location
    Arroyo Grande, CA
    Posts
    5,312
    Quote Originally Posted by ambrozac
    Kind of scary in there!!...
    Oh yeah, you don't know the half of it.

    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

  10. #10
    Join Date
    Apr 2004
    Location
    LOCKPORT NY
    Posts
    18,655
    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

    Lew
    Lew 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)

  11. #11
    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

  12. #12
    Join Date
    Oct 2004
    Location
    Denton, TX
    Posts
    4,311
    Quote Originally Posted by Kelly K
    "Keystroke Macros"

    Yes thanks for sharing......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?Kelly
    You're welcome Kelly....This is where Rob will need to comment. I know nothing about macros, or scripting, other than the macros were easy to record and works good. Rob knows about scripting, but is busy at the moment. I'm sure he will comment, when he can find the time.
    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

  13. #13
    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

  14. #14
    Join Date
    Oct 2004
    Location
    Denton, TX
    Posts
    4,311
    Here is another use. You can place different Wall Types on an icon and start drawing.

    Click image for larger version. 

Name:	Walls.jpg 
Views:	327 
Size:	27.5 KB 
ID:	21401
    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

  15. #15
    Join Date
    Apr 2004
    Location
    LOCKPORT NY
    Posts
    18,655
    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


    Lew
    Lew 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)

 

 

Posting Permissions

  • Login or Register to post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •