sketchucation logo sketchucation
    • Login
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    How to save a component definition

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 1.5k Views 3 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.
    • Al HartA Offline
      Al Hart
      last edited by

      How to create and save a component in an active SketchUp model.

      I would like to create a component with a Ruby file, (which I am able to do), and then save just the component definition to disk (which I don't know how to do).

      I'm sure I have asked this before, but I can't find a record of it on the SUC Forum.

      Any ideas? (And I don't want the user to have to save it by hand)

      Al Hart

      http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
      IRender nXt from Render Plus

      1 Reply Last reply Reply Quote 0
      • T Offline
        todd burch
        last edited by

        There are a couple methods to leverage here.

        Sketchup.active_model.save() will save a model to disk.

        Now, if you are on a Mac, Skechup.file_new() with create another instance of Sketchup. You'll get a second window, then you can switch around your high level qualifier to switch between views, build your component there, save it, whatever.

        Is this the type of info you were looking for?

        1 Reply Last reply Reply Quote 0
        • Al HartA Offline
          Al Hart
          last edited by

          No Todd,

          I want to create a SketchUp Component (say a furniture item), while the user is working on a larger layout, and then save the new component if a library so the next time the user needs it I don't have to create it again.

          We did find the SDK code which lets you write a .SKP file directly, and then load it as a component, so we will try that route.

          Al Hart

          http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
          IRender nXt from Render Plus

          1 Reply Last reply Reply Quote 0
          • Al HartA Offline
            Al Hart
            last edited by

            On a similar note, I thought there was a way to create an SKP file, using the SDK from
            outside of SketchUp. I even thought we had tried it once.

            But today I can't find it.

            Does anyone know if it is possible to create an SKP file in a stand
            alone program using the SDK.

            (We regularly do this by creating a .rb file and then reading it, but
            we would like to create a .SKP file directly.)

            Al Hart

            http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
            IRender nXt from Render Plus

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

              Or put another way - you want a method something like:

              ComponentDefinition.export

              or

              ComponentDefinition.save_as

              ...

              TIG

              1 Reply Last reply Reply Quote 0
              • Al HartA Offline
                Al Hart
                last edited by

                Yes.

                @tig said:

                Or put another way - you want a method something like:

                ComponentDefinition.export

                or

                ComponentDefinition.save_as

                ...

                Al Hart

                http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
                IRender nXt from Render Plus

                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