• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

When changing a DC attribute, the DC name is added with #1

Scheduled Pinned Locked Moved Dynamic Components
sketchup
14 Posts 7 Posters 11.7k Views
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.
  • J Offline
    Jim
    last edited by 27 Aug 2011, 08:39

    @tig said:

    copying them leaves them all stay instances of the same component and they can therefore be changed globally.

    This isn't universally true. Here's the Gridbeam Component which makes itself unique even when copied. In the case of the gridbeam component, it would be better to be able to have just one instance of any given length. As it is, every instance becomes unique even when the same length.

    Is there a better way to design this DC in order to make a single instance per length?

    Error 404 (Not Found)!!1

    favicon

    (sketchup.google.com)

    Hi

    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 27 Aug 2011, 09:36

      An update - if I make a single copy using the Move tool, I get a new Definition (and Instance obviously) appended by #1.

      If I use the Move tool to make a copy and enter x4 (for example,) the copied instances all use the original Definition.

      So here is a work-around: If I make a copy using the Move tool, then enter x1 for the number of copies, I also do not get a new Definition.

      I don't know why there is a difference between making a single copy using the Move tool and making a single copy by entering x1 after using the Move tool.

      As another work-around, I found using Copy&Paste (Ctrl-C, Ctrl-V) to copy the Instance does not create a new Definition.

      Hi

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 27 Aug 2011, 11:10

        Inserted DC instances get uniquified.
        I think that a single copy Move+Ctrl is regarded as the same as an insert, all other copying methods make duplicates of the instance so it's no longer unique.
        This snippet will make all selected instances unique...

        Sketchup.active_model.selection.to_a.each{|e|e.make_unique if e.class==Sketchup;;ComponentInstance and e.definition.instances[1]}
        

        Unlike the context-menu 'Make Unique' which works on a single instance OR makes multiple instances with the same uniquified definition ??
        BUT if the DC contains nested DCs then even though the host DC is now unique the contents will not be! so editing the contents of one unique DC will edit the contents of its 'sibling' unique DCs... To fix that we need a 'miner' to uniquify those nested ones too...

        def miner_uniquer(instance)
          instance.make_unique if instance.definition.instances[1]
          instance.definition.entities.to_a.each{|e|
            miner_uniquer(e) if e.class==Sketchup;;ComponentInstance and e.definition.instances[1]
          }
        end#def
        Sketchup.active_model.selection.to_a.each{|e|
          miner_uniquer(e) if e.class==Sketchup;;ComponentInstance
        }
        

        for example... πŸ˜„

        TIG

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by 28 Aug 2011, 13:25

          @tig said:

          Dynamic Components that are inserted are automatically made unique.

          This is also not "always" true - a component being made unique on insertion must depend on certain behaviors/configuration of the component or its sub-components.

          This simple circle DC, for example does not create unique definitions upon insertion.

          Error 404 (Not Found)!!1

          favicon

          (sketchup.google.com)

          Only when the options are changed does it become unique.

          Hi

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 28 Aug 2011, 13:51

            You are right - a DC that has no base attributes that change as it's inserted - like your simple circle - will not become unique unless an attribute is changed later on by the user, when presumably a DC observer spots it...
            A DC with an attribute set like X/Y/Z will become unique upon insertion of the first additional instance, but thereafter further additional instances are not made unique any more - which is very confusing... πŸ˜•

            TIG

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gridbeam Solutions
              last edited by 5 Sept 2011, 03:43

              Thank you so much TIG and Jim for explaining this. SketchUp's habit of making unique instances of identical components (but not ALL the time) was SO frustrating.

              A big part of what I'm doing is using models to generate parts lists for projects. Since the otherwise-identical components "bolt", "bolt#1", and "bolt#2" list separately in my cutlist plugin, unwanted unique instances were causing me some real problems.

              It seems to me that SketchUp's default behavior should be to make each instance of a component identical, so they can all be counted/edited as one. Make a component instance unique only if the user changes something about it. I'd at least like a setting for this, so I can force SketchUp to NOT make unique instances without the Move + x1 workaround.

              1 Reply Last reply Reply Quote 0
              • J Offline
                Jim
                last edited by 5 Sept 2011, 10:44

                Well, I found that when I use the Move tool and x1 to make a copy SketchUp does not create a new Definition. However, as soon as a Move either copy, a new Definition is then created. 😞

                Hi

                1 Reply Last reply Reply Quote 0
                • R Offline
                  randal.junior
                  last edited by 25 Aug 2016, 19:14

                  I have the same problem, but for me its worst.

                  I made a building design, and needed to put like 500 windows. I have made a DC so I can simply tell the the windows is open or close with a combobox. When I change the "state" of the window it creates a new instance with the #n.

                  In a very short time I will have 500 components in my model, turning impossible to get a list of quantities.
                  For me it loses all the purpose to have a DC if it not remains unique despite the internal state, like you see in AutoCAD dynamic blocks.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    hank
                    last edited by 8 Apr 2017, 18:01

                    Same here. That changing the properties of a DC makes a unique component that is "de-linked" from the original component defeats the whole purpose of using components in the first place! You might as well just use groups.

                    Has any figured out a workaround or anything on this? ...seems like this issue has been around a while.

                    1 Reply Last reply Reply Quote 0
                    • R Offline
                      RaduC
                      last edited by 22 Nov 2018, 03:29

                      More than one year after the last reply. I am assuming no one found a solution?

                      I just started using dynamic components and I was starting to be happy of the possibilities they allow, but now I came across the same problem you guys have (it's what lead me to this thread).

                      It is very frustrating that I cannot seem to identify a rule as to why and when SketchUp decides to make a unique component. For example I have a pipe and users can input the lenght. The component works perfect, no renaming no unique copies, no problems.. no matter what kind of copy/move operation I do.

                      Now I designed a component a bit more complex. It includes 3 groups and one sub-component. The position of that sub-component plus the size of the groups change according to what the user chooses (drop-down list)

                      If I just insert the component and move it/copy it NO new instances are created. But If I go to attributes and select the second configuration, right after I press APPLY, a new instance is created #1. Now, copying this new component does not create a #2, BUT if I dare to change one of these copies back to the first configuration, it creates a new instance.

                      This really ruins the whole purpose of having dynamic components....

                      At least if we had control over the renaming, for example appending at the end of the initial name, the label of the attribute changed.

                      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