@jim said:
It's not you. Dynamic Component programming is basically undocumented. All you can do is look at other peoples examples. Not to mention there are a number of bugs that occur even if you are doing everything correctly. Overall, it's a frustrating experience.
Amen! But let's separate Ruby from Dynamic Components. Although the DC mechanism is implemented in (encrypted) Ruby, developing DC's does not involve Ruby per se. It is done via a set of GUI panels without any Ruby source file coding at all!
Someone with more insight than me could correct this, but I have the impression that the DC's were a pet project of a single person who left the development team some time ago and Trimble has not seen fit to devote anyone to maintenance of DCs since. Personally, I found the lack of documentation so severe and the myriad quirks and bugs so frustrating that I long ago gave up even attempting to develop DCs!
For a long time the documentation of the Ruby API has also been deficient, full of errors and sloppy or lazy examples. At least the Trimble team is giving attention to this aspect, including a new YARD-based technique for generating the API docs and a GitHub repository where people can propose corrections.
My own Ruby API coding efforts are motivated by two things:
Sometimes I find a seemingly simple operation that core SketchUp simply doesn't provide and that other existing plugins don't implement the way I would prefer (typically because they throw in extra stuff I didn't want. I prefer KISS). So I write my own.
I'm also fascinated by the defective models that people bring to this and the official SketchUp forum asking for help. I write Ruby analysis tools for my own use to probe into the model structure and understand what went wrong. Sometimes these tools help me to repair a broken model, and sometimes they help me to identify bugs in SketchUp itself. But they always help me to gain a deeper understanding of how SketchUp works.