12 Replies Latest reply on Aug 2, 2017 2:50 PM by John Alexander

    How to get the vendor information from the property by api?

    Marco Wu

      I have the following code which is to sort the assembly tree. However, I need to sort by vendor and then part number. How I can get the vendor information in this function level?


      Function SORTFOLDERS(SWMODEL As SldWorks.ModelDoc2, featfldr As SldWorks.FeatureFolder)
              Dim Features As Variant
              Dim FOLDERFILES As Object
              Dim swassemblydoc As SldWorks.assemblydoc
              Set swassemblydoc = SWMODEL
              Dim TEMPCOMP As SldWorks.Component2
          Set FOLDERFILES = CreateObject("System.Collections.ArrayList")
              Features = featfldr.GetFeatures
                          For j = 0 To featfldr.GetFeatureCount - 1
                              tempstring = (Features(j).Name)
                              FOLDERFILES.Add (tempstring)
                          For i = 0 To FOLDERFILES.Count - 1
      Set TEMPCOMP = swassemblydoc.GetComponentByName(FOLDERFILES(i))
                          If i < FOLDERFILES.Count Then
                              boolstatus = swassemblydoc.ReorderComponents(TEMPCOMP, featfldr, 3)
                          End If
      End Function