# How to identify / change between radius and diameter type dimension?

**URL:** <https://forums.sketchup.com/t/how-to-identify-change-between-radius-and-diameter-type-dimension/322207>\
**Category:** Ruby API\
**Created:** [April 5, 2025, 8:15pm UTC](https://forums.sketchup.com/t/how-to-identify-change-between-radius-and-diameter-type-dimension/322207 "2025-04-05T20:15:17Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [April 7, 2025, 12:21am UTC](https://forums.sketchup.com/t/how-to-identify-change-between-radius-and-diameter-type-dimension/322207/7 "2025-04-07T00:21:57Z")

</div>

Last night I checked for a send\_action automation integer, but realized that it is only going to be active (usable) when that specific context submenu is being displayed. (I.e., the command ID is generated “on-the-fly” when the context submenu is opened.)

The fastest way to toggle between the states, is to **select** a radial dimension, open the Preferences dialog, switch to the Shortcuts panel, then filter by `"Type"` and assign a shortcut to each type. (This cannot be done with an extension as it is a user preference.)

But once a shortcut is assigned and extension **can** send keystrokes to the system to fire a shortcut.

I’ve posted many times in this category how to use the WSH’s [`SendKeys`](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/8c6yea83(v=vs.84)?redirectedfrom=MSDN) method.

Here is one …

[Use the ruby code to simulate a mouse click on the sub-menu in menu - #7 by DanRathbun](https://forums.sketchup.com/t/use-the-ruby-code-to-simulate-a-mouse-click-on-the-sub-menu-in-menu/71348/7)

.. and another …

[How's possible to minimize an extension window? - #2 by DanRathbun](https://forums.sketchup.com/t/hows-possible-to-minimize-an-extension-window/266559/2)

For now, … if you are coding toolbar buttons, your extension would need to tell the user to assign shortcuts, and then you’d either have them enter the shortcuts into an [`inputbox`](https://ruby.sketchup.com/UI.html#inputbox-class_method) or see if you can snag it thusly …

```ruby
def find_dim_shortcut(type)
  shortcuts = Sketchup.get_shortcuts
  shortcut = shortcuts.find {|combo| combo =~ /Edit\/Item\/Type\/#{type}\Z/ }
  return nil unless shortcut
  keychord = shortcut.split("\t").first
end

```

Ie …

```ruby
dia = find_dim_shortcut('Diameter')
#=> "Ctrl+F12"

```

I as a test assigned “Diameter” to CTRL+F12.

So, for my machine to toggle to Diameter:

```ruby
shell.SendKeys("^{F12}")`

```

Once you get the keychords, depending upon platform you can convert them to what is needed for [`SendKeys`](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/windows-scripting/8c6yea83(v=vs.84)?redirectedfrom=MSDN) on Windows or perhaps an AppleScript command via [`system()`](https://docs.ruby-lang.org/en/3.2/Kernel.html#method-i-system). I remember that @john_drivenupthewall was very fond of using `cliclick` utility on Mac. There is also supposed to be a `sendkeys-macos` utility. Neither are likely to be natively installed. So AppleScript may be the best.

---

_[View the full topic](https://forums.sketchup.com/t/how-to-identify-change-between-radius-and-diameter-type-dimension/322207)._
