8 Replies Latest reply on Jan 31, 2018 6:51 AM by Leonardo Pinhel

    Set Configuration of Part for All Configurations of Parent Assembly

    John Alexander

           I'm not sure if there is a way of doing this outside of the API. This is a tool that I am considering developing but wanted to check if anyone has any non-macro solutions before I start on it.


      The problem is as follows: I have a library fastener with several configurations defining the length of the fastener. I insert this part into an assembly that has several configurations. After inserting the fastener, I realize that it needs to be a different length. I open the fastener's Component Properties, select the configuration that I would like to change it to and apply - but neglect to select "all configurations" in the dropdown menu. By default, I've changed the fastener in only the current configuration of the parent assembly.


      Imagine I've done this 30+ times for fasteners of several different lengths. I want to be able to select all of the fasteners and apply their current configuration to "all configurations" of the active document. The only option that I am aware of is to select each fastener individually, open the Component Properties menu, and select "all configurations" in the dropdown menu. I cant' select all of the fasteners because they do not have common configurations.


      I appreciate any feedback.




      John Alexander

        • Re: Set Configuration of Part for All Configurations of Parent Assembly
          David Hinners

          You can do this via design table if the assembly is not too complex.  You just need to let SolidWorks Auto-create the file for you and make sure you select the configuration of all the parts you are concerned with as an item to add to the design table. Then, you can edit the table and just copy entries from your good configuration to all the others.

          • Re: Set Configuration of Part for All Configurations of Parent Assembly
            Amen Allah Jlili

            If your assembly file has a design table, you can add the configuration of your fastener as a custom property in the design table. Every instance of the fastener will have to be added seperately.  The custom property would be something like "$configuration@Fasterner<x>" where X is the instance of the fastener in the assembly. After validating your design table, you can update all the fasteners' configurations across all assembly configuration quicker by updating the Excel design table.


            Considering that all assembly configurations will have the same configurations of fasternes, do one configuration (one line in the design table) by picking what instance and what's its corresponding configuration and then simply drag the selected cells (there's a black plus sign in the lower right hand when you select the cells) downwards so that the rest of configurations of the assembly will receive the same configuration of the fasteners.


            You can use the custom prop "$State@Fastener<X>" to determine what fastener is to be shown or suppressed in any configuration.


            I hope I understood your question and that my answer is clear.

            • Re: Set Configuration of Part for All Configurations of Parent Assembly
              John Alexander

              I appreciate the feedback. Upon re-encountering this task (assigning configurations to fasteners again), I tried using the design table suggestions. It just isn't convenient enough for large assemblies.


              I've started working on a macro that will perform the task as described in my original post.


              I've gotten as far as building a list of selected components and a list of their configuration names in the current configuration of the active model document (assembly). The plan is to apply this configuration name to those components in all other configurations of the assembly. Here is where I'm running into trouble. I don't want the macro to activate every configuration of the active assembly document. This would take prohibitively long on a large assembly. It would still be useful if I have to work that way but I would rather manipulate the component's configurations in a way similar to the configure component tool:



              The trouble is, I can't find a method that will allow for this. It appears that IComponent2 objects are configuration-dependent meaning the same "part" in an assembly will have different IComponent2 references depending on which configuration is active when they are accessed. I'm wondering if there is a broader scope for manipulating these configuration properties.


              I thought I found a solution when I came across the IAssembly::CompConfigProperties4 method but it appears that I have misunderstood the description. One of the parameters isn't clear to me what it does "UseNamedRefConfig". Fortunately, the documentation also reports that it isn't used.


              Does anyone have a suggestion or am I doomed to activate every configuration in my model?

              • Re: Set Configuration of Part for All Configurations of Parent Assembly
                Leonardo Pinhel

                All the solutions are workaround to an idiot workflow made by the programmers, there MUST BE AN WAY to set for default change configurations to all configurations. I NEVER in all my years using SW, sinde 1995, ever, needed it other way, It is rare for a project to need to change the configuration of an component on only one configuration, compared to the main stream industry. Bolts and screws are solid example on that.

                The problem is that SW things that 10 people complaining about something, speaks for 100000000 people that are satisfied the way it is, thud stay silence.