Show dynamic component options from custom item ( shortcut )

Hello everyone! I’m new to Ruby programming… I’ve started a little “test” plugin to better understand how it all works. I had the idea to be able to open/display the dynamic component option dialog box directly from an item in my toolbar, I would like to make a kind of shortcut in my toolbar. I hope I was clear enough in my explanations aha
Thank you for your help.

The Dynamic Components extension already comes with a toolbar of it’s own that has the button you desire.

You can use Aerilius’ Toolbar Editor extension to create custom toolbars, and to add this button to a custom toolbar.


All this aside, the DC extension is closed source and it is not always easy knowing what other extension’s UI::Command objects are. It is an advanced concept in Ruby that must use reflection to find such information (if it can be found. Ie, there are ways to hide such things.)

Anyway I have already posted here in the past on how to do this with code snippets.
(Please learn how to search categories using the magnifying glass menu [upper right].)

See: Close Component Option & Component Attribute windows using ruby script

So, given the methods to actually do the opening or closing, you will need to use the UI::Toolbar class and UI::Command class to create the toolbar and buttons. (The button images will need to be a absolute path into the DC extension’s folder.)

Please change the module names (in the sample code) to something unique for yourself for the toplevel namespace module.

1 Like

Thanks for your reply ! :slight_smile: So it’s not so easy to make a shortcut of the option icon of the dynamic component in your own plugin? I would just like to add a shortcut item to “dynamic component option” in my own toolbar in my plugin

It is difficult finding out how, if you are a Ruby beginner. But as said, I already posted the information.

And I answered how in the post above.

Let us see if you can solve it given the information already posted.

Thank you very much! I will try to better analyze your answer above. :slight_smile: