Hi, complete newby here so apologies for my ignorance, but is it possible to bring in specific components within Ruby Code.?

Hi, complete newby here so apologies for my ignorance…

but is it possible to bring in specific components within Ruby Code.?

And what is the best path do you think for learning to code with Ruby for Sketchup.

Any courses or books… I have looked but find the information a bit overwhelming, too many books, links video tutorials to choose from etc. Can someone that has learned to code in sketchup narrow it down to maybe 2 or 3 courses books etc, that they found most useful.

Cheers.

Yes it is possible. I personally was new to ruby code having only dealt with dynamic components, but over time i have been able to grasp the ruby language with sketchup to automate certain tasks.

@DanRathbun has a link to ruby resources that is a great place to start.
Also this forum is a great way to see other users examples and isssues/solutions and seeing how they work.

1 Like

Learning Ruby (and Sketchup Ruby API) is a very complex process. There are no such a “2-3 courses” to learn - unless you are super intelligent…
You have to find your own way, how to learn.
My advise:

  1. Click over on these articles, and read it back and forth. Try the examples.
    https://developer.sketchup.com/developers/welcome
    https://developer.sketchup.com/article-series/sketchup-entity-overview
    https://developer.sketchup.com/article-series/traversing-sketchup-model
    Read it back and forth. Try the examples, practice!
    Don’t miss the links in it. Read those too!
    Read it back and forth. Use the references below in parallel.

  2. Always keep open this: https://ruby.sketchup.com/
    Don’t miss the links in the start page.
    Get familiar how to use it. Seriously. Don’t be ashamed that you spend quite a few days (weeks) with it on how to search for Classes, Methods, Files.

  3. Keep a reference to latest doc of Ruby documentation what SU Ruby API uses. Currently it is: https://ruby-doc.org/2.7.7/

  4. Use the forum search to find other advises, for example there is an excellent references collection by @DanRathbun Ruby Learning Resources [WikiLists]

  5. Check the extensions/plugins from others, if it is not encrypted you may learn from there a lot.

3 Likes

An other advise:

If you have a question, try naming your topic that is relevant to your problem.
The above example shows how not to ask.

I suggest you to edit your post and choose better topic name. Like “How can I write a Ruby code”, “I want to learn Ruby API”, “Is there any good resources to learn Ruby API”…

2 Likes

For example …

This question could be in a topic of it’s own entitled:

  • How to bring in specific components with Ruby code?

This has likely been answered already in this category, but I’ll point you toward the API method that will do this. If you know the filepath to the specific component file:

1 Like

Thanks for the help guys, it really is appreciated.
Dezmo, I will read the articles as recommended, thanks you for taking the time to compile this starter pack for me. I have seen the collection that was put together by DanRathun, it’s amazing, and comprehensive, I was just being lazy and trying to fast track my learning process. I do have a goal and an extension I’d like to develop in mind, so really want to get going with development, but with no programming experience behind me, it will be a journey no doubt. I’m an expert with sketchup, and have a solid idea of what the extension will do logically and how I want it layed out ect. So… wish me luck… :slight_smile:

Thank you Dan, that answered my main question perfectly.

Hopefully sometime in the near future my questions will be more nuanced as I go deeper down that rabbit hole.

Once again, appreciate the help, have a great week guys.

1 Like