sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Stumped

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 142 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      pc0158
      last edited by

      I'm struggling to understand Ruby scripting in Sketchup, and I'm frustrated by the lack of introductory tutorial material. As a practical matter, I can create a bunch of 3D text objects and orient them as I wish, but I can't figure out how to group them; topics like grouping just don't seem to be covered well anywhere that I've found.

      I guess I'm looking for a decent overview that includes terminology - grouping, components, etcetera - along with how to accomplish simple tasks like this. A discussion of local versus global coordinate systems might also be helpful; I'm not sure yet whether objects have their own coordinate frame or if everything must be done in global coordinates.

      I'd prefer written documentation with example code to videos, but at this point I'll settle for just about anything.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        I moved your post to a more appropriate place.
        There are several good threads here - e.g.
        http://forums.sketchucation.com/viewtopic.php?f=180&t=10142
        Also 'Automatic Sketchup' is a good general primer.
        http://www.autosketchup.com/

        On your particular subject...
        You have already go something like
        mytext=Sketchup.active_model.active_entities.add_3d_text(xxxxxxxxxxxxxx)
        where ' xxxxxxxxxxxxxx' represents the various arguments that you need to pass to the method...
        This then adds the 3d-text as 'raw geometry' into the current context [usually the model's entities].
        If you look at the API section on 'entities'
        https://developers.google.com/sketchup/docs/ourdoc/entities
        there are lots of ways to add things to ANY 'entities' collection...
        So to add a group to the model.entities use
        group=Sketchup.active_model.entities.add_group()
        Now you have a group in the model and can add things to that group's entities, instead of the model, thus...
        group.entities.add_3d_text(xxxxxxxxxxxxxx)
        Now the 3d-text's geometry is inside 'group'...
        You can add more things into it, or change its name, material, layer etc as you now have a reference to it ' group'... You can even add groups inside such new groups etc, as you desire...

        TIG

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement