Hello, beginner here. I'm looking for a modifier key combination that, when pressed, will force an ellipse back to be a circle. I know that I can go and set the width and height of the ellipse to be equal, but I want to streamline my work and do it with a keystroke if possible.
Was hoping you should see this thread and offer a neat solution, Eskimo.
Hello, everybody!Hello, taydin!
In any command module of Globalmacros.gms place:
Sub F3()'MsgBox "F3 PRESSED"ActiveShape.SizeHeight = ActiveShape.SizeWidthEnd SubSub CTRL_F3()ActiveShape.SizeWidth = ActiveShape.SizeHeightEnd Sub
Then In Customize menu assign F3 to run Sub F3 and Ctrl-F3 to run Sub CTRL_F3
Ready!
Improved variant: In this variant each pressing of F3 change ellipse to smal circle, big circle and ellipse again
With the macro, rectangles can be changed into small and large squares
Public Sub F3()flag = flag + 1If ActiveShape.SizeWidth <> ActiveShape.SizeHeight ThenActiveShape.ObjectData.Item("DsizeWidth") = Mid("a" & ActiveShape.SizeWidth * 25.4, 2)ActiveShape.ObjectData.Item("DsizeHeight") = Mid("a" & ActiveShape.SizeHeight * 25.4, 2)End If
If flag = 1 ThenActiveShape.SizeHeight = ActiveShape.SizeWidthEnd IfIf flag = 2 ThenActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4End IfIf flag = 3 ThenActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4flag = 0End IfEnd Sub
Hello, taydin, everybody again
One other improved solution. Each pressing of F3 change ellipse to small circle, one other pressing - to big circle. The third pressing - change circle to ellipse. The sizeWidth and sizeHeight of ellipse are stored hard in object data fields and can be used to restore ellipse.
With the macro, rectangles can be changed into small and large squar
Enjoi!
Public Sub F3()'MsgBox "F3 PRESSED"'ActiveShape.SizeHeight = ActiveShape.SizeWidthflag = flag + 1'On Error Resume Next'If ActiveShape.Type = 2 Then 'ELLIPSE'ActiveShape.SizeHeight = ActiveShape.SizeWidth'End IfIf ActiveShape.SizeWidth <> ActiveShape.SizeHeight ThenActiveShape.ObjectData.Item("DsizeWidth") = Mid("a" & ActiveShape.SizeWidth * 25.4, 2)ActiveShape.ObjectData.Item("DsizeHeight") = Mid("a" & ActiveShape.SizeHeight * 25.4, 2)End If
If flag = 1 ThenActiveShape.SizeHeight = ActiveShape.SizeWidthEnd IfIf flag = 2 ThenActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4End IfIf flag = 3 ThenActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4flag = 0End If'If flag = 4 Then'ActiveShape.SizeWidth = ActiveShape.ObjectData.Item("DsizeHeight") / 25.4'ActiveShape.SizeHeight = ActiveShape.ObjectData.Item("DsizeWidth") / 25.4'flag = 0'End If