sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Help with recursive component?

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    15 Posts 4 Posters 2.5k Views 4 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.
    • thomthomT Offline
      thomthom
      last edited by

      @al hart said:

      Only one Component appears in the SketchUp Components in Model window.

      I'll have to Expand the component browser view to see all the components. When you import a model, all it's sub-components are marked as "internal" and hidden by default in SU.

      ComponentWindow.png

      @al hart said:

      When I Click on the main Component in the Component Window, I get the message "Cannot Create a recursively defined model or component"

      I presume the component probably is recursive.

      Sound like, and looks like from your screenshot, that you're trying to insert the component into itself. It's not the component being recursive - it's your actions that try to make one.
      In your screenshot - if you exit the current context you should be able to insert the component you picked from the browser.

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

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

        Thanks ThomThom. I guess I can learn something new every day.

        Is this "expand" thing new, or have I just missed it for the past few years. (I thought the Components window always showed all the sub-components as well)

        I see that the recursive message cam because I clicked on a component while I was already editing the same component.

        But at least I can find Component #41 now - which is what I was trying to locate.

        Thanks again...

        Al Hart

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

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          @al hart said:

          Is this "expand" thing new, or have I just missed it for the past few years.

          Been in SketchUp as far as I've used it ... 5/6.

          You can also access the property via the API: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/#8220internal8221-components

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

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

            The Outliner is a far more efficient way of finding nested components/groups, right clicking over the selected item in the Outliner offers all of the usual context-menu items.
            Using View > Component Edit > Hide rest of model etc lets you see what's what too...Capture.PNGA little better component naming would be helpful too 😒

            TIG

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

              @tig said:

              The Outliner is a far more efficient way of finding nested components/groups, right clicking over the selected item in the Outliner offers all of the usual context-menu items.
              Using View > Component Edit > Hide rest of model etc lets you see what's what too...
              A little better component naming would be helpful too 😒

              Thanks TIG - A client grabbed this from the 3D warehouse and marked the whole thing as a light - which was making way too many individual light sources. (Not just the rice paper, but also all of the hardware in the light)

              I told him he should re-insert the rice paper as a single surface, (it is 26 separate surfaces in the 3D Warehouse model), and then make it into a single light for faster processing. But without the outliner, (which I did not think to use), or the expand function, it was hard to see just what was going on.

              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

                It could certainly be made from far less geometry and sub-parts - it's a light-fitting, who's ever going to be so close to see it's inner workings - a prime example of over-detailing an object 😒

                TIG

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

                  @unknownuser said:

                  When you import a model, all it's sub-components are marked as "internal" and hidden by default in SU.

                  I see there is an internal? to check for an internal component in Ruby.

                  Is there any way to mark a component being used as a sub-component as internal when I am creating a component with ruby?

                  Al Hart

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

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @al hart said:

                    Is there any way to mark a component being used as a sub-component as internal when I am creating a component with ruby?

                    Unfortunatly no. I've requested this, as it'd be very useful for organizing a model.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

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

                      ... ☀
                      BUT provided the sub-components are only used inside a main-component [i.e. they have no instances in their own right] you could try this way...
                      Save the main-component externally [use the 'TEMP' folder etc], rename the original and any sub-components as 'scrap'.
                      https://developers.google.com/sketchup/docs/ourdoc/componentdefinition#save_as
                      Keep track of any instances of the main-component's definition.
                      Reload the TEMP skp back into the model - it should take it's 'original name' [rename it otherwise].
                      https://developers.google.com/sketchup/docs/ourdoc/definitionlist#load
                      Erase the TEMP SKP to tidy up [ File.delete(tempskp)].
                      Set every original main-component instance.definition=newdefn to use this newly imported replacement.
                      The newly imported component now has its own 'internal' sub-components.
                      At the close of play do a ' .clear!' on each of the unused ['scrap'] main-component and sub-componnet definition.entities in turn - when the model.start...commit_operation block closes they then are auto-deleted as empty definitions.
                      Now any 'internal' wholly sub-components are no longer listed in the unExpanded Component Browser > Model panel.
                      They will appear in the Outliner as before...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • GaieusG Offline
                        Gaieus
                        last edited by

                        The other day I put together a little tutorial about internal and external components: http://www.sketchucation.com/resources/tutorials/36-intermediate/115-internal-external-components

                        Gai...

                        1 Reply Last reply Reply Quote 0
                        • thomthomT Offline
                          thomthom
                          last edited by

                          @gaieus said:

                          The other day I put together a little tutorial about internal and external components: http://www.sketchucation.com/resources/tutorials/36-intermediate/115-internal-external-components

                          👍 👍

                          Thomas Thomassen — SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 Reply Last reply Reply Quote 0
                          • GaieusG Offline
                            Gaieus
                            last edited by

                            This "recursively defined model or component" is not in that tut but from the "preamble" What is a component, it is obvious that you cannot place a file into itself.

                            Gai...

                            1 Reply Last reply Reply Quote 0
                            • thomthomT Offline
                              thomthom
                              last edited by

                              Only thing about the article - at the end, about scaling - it seem to suggest that you scale a model to a match the incorrect scale of an imported component? Or did I misinterpret that?

                              Thomas Thomassen — SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • GaieusG Offline
                                Gaieus
                                last edited by

                                I did not mean to say that there. I'll revisit and see if there is anything to misunderstand, thanks.

                                Gai...

                                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