Ruby code to import component into model from custom HTML pop up box

I had the DC Options popup feature in my example. But after doing a forum search, I realize now that I had not publicly posted it back then (OCT of 2019.) I had only sent a “private labeled” edition (ie, where the toplevel “Example” module is properly renamed) via a PM to the user. I’ve made a few edits since then.

I never had a toggle command to switch off the DC Options popup. It was just on all the time (in this example) but I have other examples that have a similar toggle and can paste code from one of those I’m sure.

I’ll try to get it posted later today. (The lawn needs mowing this morn before it gets too hot. Supposed to be 92 today with the typical afternoon t-storms we get in FL in the summer.)

A bit of progress today. First, the toolbar launcher had to make friends with ‘if loaded’.


A definite move from not good to less un-good.

I rooted around and found some of your code. It may be what you were referring to. But if not, it’s still a handy little deal.

Maybe this thread ought to be continued elsewhere?

Had issues yesterday with my computer relocating the AppData path, so I did not get the example finished.

Hard to tell without a link. wait … I think this is the one of I was thinking of:
Dynamic Component Options window "Opened" when new drawing opened - #4 by DanRathbun

It has methods from other examples and yesterday I pasted from this to the menu example.

Yes, you linked the one I used. Previously I had tried using the code in this thread:
Close Component Option & Component Attribute windows using ruby script - Developers / Ruby API - SketchUp Community

… oh my, my examples are … everywhere! :wink:

Maybe something like this?: Ruby SketchUp API Examples - Developers / Ruby API - SketchUp Community

No. I was kidding. Having multiple posts (and partial posts at that) is not so good for maintenance.
I do have them (mostly) in one “Examples” folder locally.

As far as links to example posts go, I rather have such a list in my Ruby Resources collection. Probably in the Ideas categorical list, as that list is pinned to the top of this category.

You can find some of these by searching for “[Example]” or “[code]” prefixes.

RE, Dynamic Components snippets and examples I had mostly posted in it’s category as most were in answer to questions posted. BTW, I also have a Dynamic Components Resource list (that is no longer pinned.)

Deleted the post. Can’t seem to find a way to delete the topic.

Just thought I’d gather things up and post as I ferret around.

It takes the system a while to delete. A day or so. (It allows the sages & admins time to have a look in case it was something nefarious that needs disciplinary action.)

The only nefarious I’ve done is create a topic and then change the name to “Opps, can’t delete this topic”. But I also discovered that I can’t find a good place to collect ruby scripts. I like the Summary & Hide format option along with the syntax highlighting and ability to link to the context discussion available in posts here.

You haven’t. You’d know if you did. I mean something either nasty to get suspended (in the “dog house”) or legalistic to get booted from the forum permanently. (It has happened.)

The major issue with trying to put them all in one topic thread, is that newbs to the forum start discussions about various examples all in that one thread, instead of posting in the specific example thread or starting a new related topic. (The latter is kind of hidden. It’s the “+ New Topic” button on the bottom of the “Share Link” popup.)

Anyway, what happens is, we often wind up with concurrent intertwined discussions about different code issues which makes the discussion confusing.

I can compile a “cookbook” (I’ve even have the empty markup file) but I haven’t got to it yet as other help files take precedence.

Meanwhile, for your own use, you can bookmark any topics or posts and give the bookmarks a subject for later filtering or searching.

  • To bookmark a post click it’s button and you’ll see the bookmark button.
  • To bookmark an entire topic, go to the bottom (click the END key) and you’ll see the Bookmark button for the topic.

The boolmark icon looks like a gray edition of the red bookmark below:

  • :bookmark:

Then, later to browse or search your private stash of forum bookmarks, go to your avatar menu at the top right and you’ll see the bookmarks tab. To access the full listing, click the down arrow at the bottom of the menu list. (Hint: You can also create an internet shortcut aka browser bookmark to any of your private profile pages.)

The forum is not set to allow us to share our forum bookmarks from what I can see or the forum doesn’t have a bookmark sharing plugin installed. So for instance, I cannot share my booksmarks with anyone.

Just joking a bit. But dang that topic with no post does seem a suspect, almost criminal :slight_smile:

I did refrain from posting code because my code would just be bad examples to follow (causing confusing). And I get the idea of creating more threads that may move from definitive (the linked post) to less useful chatter (because I can’t answer most questions on the code or posts that I’d link).

I do bookmark some posts. I had also been saving links in an acknowledgement section as a comment at the bottom of ruby code. But that proved to be a poor way to go about it.

There was a “Create Wiki” option in the topic editing page. I didn’t want to further set in stone the very thing I was trying to delete but now that you point out some of the problems of creating a post with code snips and links it occurs to me that the Wiki option may allow turning off commenting. Of course you are creating resource wikis so it may seem that I am recreating the wheel. But I’m seeing people creating places (often, galleries) where they put their creations and maybe I should just make a spot like that but using a wiki. The reason I want to gather up the code is that I bump into stuff that I find useful and want to have it ‘at the ready’ as I try to understand it. I have to think this over for a while.

No, it does not. Evidence that at least two posts were added to the bottom of my Ruby Resource wiki thread, instead of either PMing me or starting a separate related topic to discuss some specific resource.

I might have mentioned this, but I will eventually clone the Ruby Resource lists here to one of my GitHub Pages.

Except that it’s their creations they are displaying.

And again, I already have some links to examples in the Ruby Resource wikis. They are currently (I think) in the Ideas list.

Maybe I should add a dedicated Examples and/or Snippets list ? The problem with the latter is that snippets are very numerous. And we would also wind up with snippets being shown out of context. I feel it is better to let the needy search the forum on the subject they are interested in.

For now, I suggest starting a “Snippets” folder on your local machine with a shortcut to it on the Desktop or taskbar, etc.

I have long had this. But it has gotten so large that I’ve begun making categorical subfolders.

Ah. It’s a double dangnabbit.

I do search around and collect. But it can be frustrating.

My feelings on the matter

what about bob i need i need - Search Videos