13 Replies Latest reply on Jan 25, 2018 3:01 PM by Chris Appleby

    How to list all the configurations of an assembly in a Solidworks drawing parametrically?

    pradeep nirer

      Hi,

       

      I have an assembly file with multiple configurations in it and all the configurations are created manually without using the design table.

      Now I am creating one drawing to detail all the configurations.

      My problem is, I have 7 configurations and each configuration assigned with one part number of 12 digit, in the BOM I am not able list the all the configuration number while indicating the quantity as configuration number is lengthy. So I want to call the all the configuration numbers and indicate a short name for it and then this short name I will use in BOM table to indicate the BOM quantity.

      Bit Confusing but if you see the image attached you can understand.

        • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
          John Stoltzfus

          All possible by creating a "New" BOM template and additional custom properties

          • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
            Deepak Gupta

            The best would be to add another configuration specific property and assign the value/number there.

             

            Now insert a general table in drawing where you can list both config part number and assigned short number. And In BOM, change the column property to new short value property.

            • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
              pradeep nirer

              Thank you Deepak... I will try to do it as per your suggestion and let you know if any help required.

              • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                pradeep nirer

                Hi Deepak and John,

                Sorry for the delayed reply... I was busy with some other things.

                Ok now coming to the problem, I am not able to call all the configurations of the Assembly in a general table and I also did not use the "design table" to create the configurations inserting a design table is also ruled out case . Please let me know if any options to do the same...?(may be macros if any)

                 

                Again I am stating my problem in the below image.

                 

                Regards,

                Pradeep

                Presentation1.png

                • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                  pradeep nirer

                  Hi Elmar Klammer,

                   

                  Thank you for your suggestion. From your suggestion I can sort out the table length issue.

                  But, I have one more issue as described in my previous reply, I need to show the description of the each assembly configuration as well in the drawing as these are having separate part number.

                   

                  Regards,

                  Pradeep 

                  • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                    John Stoltzfus

                    The only way I know to list all properties of the different configurations is a macro written by Markku Lehtola - however the macro search is everything from the folder, so to just collect the data from one component you would need to place that configured part in a folder by itself...

                     

                    See the attached excel file - the file path input is cell D4 in both the part and assembly tabs - In Row 6 in the orange cells is the custom property name that it searches for, you can change that to your own custom properties and cell D3 is the amount of custom properties it will read, you can also change this as well......

                     

                    Once you read everything you can save the results and paste it as a Table into the drawing file..

                    • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                      pradeep nirer

                      Hi All,

                      Below code is working for me to collect configuration names and Description config specific properties associated with them.

                      ption Explicit

                      Dim swApp As Object

                      Dim Part As Object
                      Dim boolstatus As Boolean
                      Dim longstatus As Long, longwarnings As Long
                      Dim myTable1 As TableAnnotation

                      Function InsertTable1(rowCount As Integer, columnCount As Integer) As TableAnnotation

                          If columnCount < 3 Then
                              MsgBox "Invalid table column"
                              Exit Function
                          End If

                          Dim myTable As TableAnnotation
                          Set myTable = Part.InsertTableAnnotation(3.50025261755506E-02, 0.807825915596727, 1, rowCount, columnCount)
                         
                          If Not myTable Is Nothing Then
                             myTable.BorderLineWeight = 0
                             myTable.GridLineWeight = 0
                          End If
                         
                          boolstatus = myTable.MergeCells(0, 0, 0, 2)
                         
                          myTable.Text(0, 0) = "ASSEMBY CONFIGURATION TABLE"
                          myTable.Text(1, 0) = "CONFIG"
                          myTable.Text(1, 1) = "CPN/RPN/GPN"
                          myTable.Text(1, 2) = "DESCRIPTION"
                         
                          Set InsertTable1 = myTable

                      End Function

                      Function GetPartDescription(asmDoc As ModelDoc2, configName As String, propertyName As String) As String

                          Dim cfg As Configuration
                          Set cfg = asmDoc.GetConfigurationByName(configName)
                         
                          Dim custPropertyManager As CustomPropertyManager
                          Set custPropertyManager = cfg.CustomPropertyManager
                         
                          Dim ValOut As String
                          Dim ResolvedValOut As String
                          Dim wasResolved As Boolean
                         
                          custPropertyManager.Get5 propertyName, False, ValOut, ResolvedValOut, wasResolved
                         
                          GetPartDescription = ValOut
                         
                      End Function
                      Sub main()

                      Set swApp = Application.SldWorks

                      Set Part = swApp.ActiveDoc
                      Dim myModelView As Object
                      Set myModelView = Part.activeView

                      Dim dDoc As DrawingDoc
                      Set dDoc = Part

                      Dim activeView As View
                      Set activeView = dDoc.ActiveDrawingView

                      If activeView Is Nothing Then
                          Exit Sub
                      End If

                      Dim dComponent As DrawingComponent
                      Set dComponent = activeView.RootDrawingComponent

                      Dim component As Component2
                      Set component = dComponent.component

                      Dim asmDoc As AssemblyDoc
                      Set asmDoc = component.GetModelDoc2

                      Dim asmModDoc As ModelDoc2
                      Set asmModDoc = asmDoc

                      Dim configNames()  As String
                      Dim configCount As Integer

                      configCount = asmModDoc.GetConfigurationCount

                      'insert table now
                      Set myTable1 = InsertTable1(configCount + 2, 3)

                      'Get names of all configurations and add into table
                      Dim i As Long
                      configNames = asmModDoc.GetConfigurationNames
                      For i = 0 To UBound(configNames)
                             
                              Dim configName As String
                              configName = configNames(i)
                              myTable1.Text(i + 2, 0) = i + 1
                              myTable1.Text(i + 2, 1) = configName
                             
                              ' this is name of custom property we will search for description
                              Dim partDescCustomProperty As String
                              partDescCustomProperty = "DESCRIPTION"
                             
                              Dim partDesc As String
                              partDesc = GetPartDescription(asmModDoc, configName, partDescCustomProperty)
                              myTable1.Text(i + 2, 2) = partDesc
                             
                      Next i

                      End Sub

                       

                      Regards,

                      Pradeep

                      • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                        Chris Appleby

                        Had similar issues, I think that's something that needs some major improving. I found workarounds but none I can apply in all cases which make creating a standard process near impossible. When using a general table you don't have a way to link properties to a specific part's "configuration specific property", like a dimension that is changing.  I also tried using BOM tables showing all configs and hiding all the columns I did not need then trying to add property columns, but again it works in some cases not all.  Really it depends on the assembly.  Even the standard table that is made for all configurations is huge you cant reorganize it I think that it looks sloppy at best, each config has a column but really I would rather have a property in the column. Feel like I've read all messages and tried every combination imaginable still not satisfied.  Inserting a design table in the drawing looks the best after hiding rows and columns however I find it very buggy causing solidworks to lock up, crash, or not load the table as the excel.exe32 gets hung up then you have to use task manager to monitor it the whole time you are working on it and force close as needed.

                         

                        Please look into this Solidworks!

                         

                        Configurations have tons of potential but people avoid them because of these issues.  At a model level they work fairly well but we need to make table drawings with those files.

                        • Re: How to list all the configurations of an assembly in a Solidworks drawing parametrically?
                          Chris Appleby

                          ER #:

                          1-16657929612

                          I submitted this feature request for many of the missing tools we need for making tabulated drawings from configurations.  I think it relates to this thread.  Please review and vote on it by logging into your Solidworks Customer Support Portal and searching for the number above.