Note: No guarantees w/ this method either written or implied. I suggest trying this method out w/ a copy of your map before using it on the real thing.
I've written an AutoHotKey script that helps me to make rotationally symmetric maps. If there is a better way to do this without using autohotkey, then let me know.
I think the neat thing about this script is that it figures out where the currently selected objects are and derives new numbers based on those numbers. Possibly this can be applied to other situations.
This is what it does:
1. figures out where your currently selected objects are (by looking at text in the status bar),
2. copies those value onto the clipboard,
3. brings up the paste special dialog,
4. enters x and y offsets from the original and rotates the object 180 degrees.
I understand that in general it is nice to do a full half side of the map, and then rotate the whole thing 180 degrees, however, sometimes I like this approach for touch ups.
So, in order to do this yourself at home, install http://www.autohotkey.com/
then create a file, with a .ahk extension and paste in this text:
Then run the ahk file to activate the hot key/script. Note that this will load the script in to memory and only needs to be run once (until you restart the computer or close the script). I start it up as soon as I start up my first Hammer session.
Select the object that you want to copy.
If you have a number of objects that you want to handle at the same time, you probably have to group them. And actually there are some subtleties (bugs?) here with hammer. Among other issues, it seems you can't group brushes w/ non brushes (or even if you can, it doesn't work as I expect with paste special).
Then press control-shift-M.
This brings up the paste special dialog and plugs in the important numeric values. It doesn't touch the checkboxes. I'm sure that can be done w/ autohotkey, but I haven't put any effort in to figuring that out. You need that first checkbox (start at center of original) checked in order for this to work.
And then after the paste special dialog is up, with all the new values, press enter to actually do the pasting. That could be automated as well, by adding the following line to the script:
However, I'm leaving that out for now and until such time, if ever, I enhance the script to make sure those checkboxes are checked.
And if you include the above line, you might also add the following (control shift e) to move the 3d display to center on the new object:
One more thing, the script brings up the Paste Special dialog by using automated mouse clicks. It is possible that due to some display settings, that the click coordinates are not correct for your display, so these might need adjusting. If this is causing problems for you, there is a utility that comes w/ autohotkey called AutoIt3 Window Spy that can help you figure out the correct coordinates. If you do change the script, you need to right click on the icon in the system tray and select "Reload This Script", in order for it to pick up your changes.
Happy to hear any feedback anyone might have regarding this.
I've written an AutoHotKey script that helps me to make rotationally symmetric maps. If there is a better way to do this without using autohotkey, then let me know.
I think the neat thing about this script is that it figures out where the currently selected objects are and derives new numbers based on those numbers. Possibly this can be applied to other situations.
This is what it does:
1. figures out where your currently selected objects are (by looking at text in the status bar),
2. copies those value onto the clipboard,
3. brings up the paste special dialog,
4. enters x and y offsets from the original and rotates the object 180 degrees.
I understand that in general it is nice to do a full half side of the map, and then rotate the whole thing 180 degrees, however, sometimes I like this approach for touch ups.
So, in order to do this yourself at home, install http://www.autohotkey.com/
then create a file, with a .ahk extension and paste in this text:
Code:
^+m:: ;control shift m
; copy the selected object
SendInput ^c
; get the status bar text that has the selected object coordinates (A means the active window)
StatusBarGetText, SB, 4, A
; Find the first numbers (the x coordinate) and the second numbers (y coordinate) after the left parenthesis
RegExMatch(SB,"\((-?[0-9]+) (-?[0-9]+)", pattern)
X := pattern1
Y := pattern2
; At this point X and Y have the coordinates of the selected objects.
; Note that Paste Special pastes using offsets from the original
; So, 0-X would offset the new copy at the origin, and 0-X-X puts the new copy on the other side of the origin.
X := 0-X-X
Y := 0-Y-Y
; this makes the mouse click the edit menu (possibly you'll have to fiddle w/ these numbers?)
click 78, 39
; this makes the mouse click the paste special menu item (possibly you'll have to fiddle w/ these numbers?)
click 137, 247
; plug in the values
SendInput 1
SendInput {tab}{tab}{tab}
SendInput %X%{tab}{tab}%Y%{tab}{tab}0{tab}{tab}
SendInput 0{tab}0{tab}180
Then run the ahk file to activate the hot key/script. Note that this will load the script in to memory and only needs to be run once (until you restart the computer or close the script). I start it up as soon as I start up my first Hammer session.
Select the object that you want to copy.
If you have a number of objects that you want to handle at the same time, you probably have to group them. And actually there are some subtleties (bugs?) here with hammer. Among other issues, it seems you can't group brushes w/ non brushes (or even if you can, it doesn't work as I expect with paste special).
Then press control-shift-M.
This brings up the paste special dialog and plugs in the important numeric values. It doesn't touch the checkboxes. I'm sure that can be done w/ autohotkey, but I haven't put any effort in to figuring that out. You need that first checkbox (start at center of original) checked in order for this to work.
And then after the paste special dialog is up, with all the new values, press enter to actually do the pasting. That could be automated as well, by adding the following line to the script:
Code:
SendInput {Enter}
However, I'm leaving that out for now and until such time, if ever, I enhance the script to make sure those checkboxes are checked.
And if you include the above line, you might also add the following (control shift e) to move the 3d display to center on the new object:
Code:
SendInput ^+e
One more thing, the script brings up the Paste Special dialog by using automated mouse clicks. It is possible that due to some display settings, that the click coordinates are not correct for your display, so these might need adjusting. If this is causing problems for you, there is a utility that comes w/ autohotkey called AutoIt3 Window Spy that can help you figure out the correct coordinates. If you do change the script, you need to right click on the icon in the system tray and select "Reload This Script", in order for it to pick up your changes.
Happy to hear any feedback anyone might have regarding this.
Last edited: