Recently we posted about OkPy and its parent, the Orkestra add-in. I've been using OkPy for several days and have created a few add-ins with it, with zero coding. (I haven't even so much as looked at code.) Here I'll detail my add-ins and the prompts I used to create them. It's a good cross section, from a simple scripting task to a model scanner to interactive element selection, with some snazzy dialog box design and Excel interoperability thrown in for good measure.
A little about my programming background: I have about 30 years of development experience, though it has been almost exclusively with Bentley products, especially MicroStation (I know, boo, hiss!), and primarily with Visual Basic. A few months ago, I tried to create a Revit add-in the traditional way, with C#, but you need to configure Visual Studio to work with Revit and I couldn't find a modern reference for how to do that, so I didn't even get out of the starting block.
First, let's cover an add-in I named Hammer Sync. I wanted a tool that would sync, reload selected links, and sync again. Something I could kickoff and walk away from. This process is handy before exporting CAD files to make sure everything's up to date.
I used the following prompt to create the add-in:
Create a new project named Hammer Sync. In a dialog box, list "Synchronize Now", then all the Revit links in the active file in alphabetical order, and "Synchronize Now" again. To the left of each list item, place an icon appropriate for the task, synchronize for each Synchronize Now and reload for each link. To the far left of each list item, place a checkbox. At the bottom left of the dialog, place "Check None" and "Check All" buttons. If all checkboxes are ticked, lock the Check All button. If some checkboxes are unticked, unlock the Check All button. If no checkboxes are ticked, lock the Check None button. If some checkboxes are ticked, unlock the Check None button. If the user clicks Check None, untick all the checkboxes. If the user clicks Check All, tick all the checkboxes. To the right of the list, place an image of a steaming cup of coffee. At the bottom right of the dialog, place "Apply" and "Cancel" buttons. When the user clicks Apply, if the first Synchronize Now list item is checked, synchronize the model. Then, reload each link that is checked in list order. Finally, if the second Synchronize Now is checked, synchronize the model again. To the right of the list, when a list item is being processed, show a clock icon. When a list item is done processing, display a checkmark.
Now, to be fair, it took me four prompts to get this all included, which was fortuitous because that's the number of free prompts OkPy gives you per day. But my first prompt did the lion's share of the work. The others were just interface tweaks.
Let's see how OkPy works...
You open the OkPy agent through the Orkestra tab:


























