4 Replies Latest reply on Oct 4, 2013 10:45 AM by Tapani Sjoman

    How to get Custom Properties of suppressed components in an assembly using VBA?

    Kamaleswaran Arunachala

      Hi,

       

      I need some helpt on my below requirement.

       

      I’m looking to retrieve custom property value of suppressed components using VBA programming in an Assembly file and display them in the listbox of a dialogue form. Can anyone please help with some example code?

       

      I’m able to retrieve the values when the components are “unsuppressed” using the below syntax:

       

         Set swApp = Application.SldWorks

         Set swModel = swApp.ActiveDoc

         VatComp = swApp.ActiveDoc.GetComponents(True)

         For I = 0 To UBound(VatComp)

      Set swComp = VatComp(I)

      Set swCompDoc = swComp.GetModelDoc2

      FileName = swComp.Name

      Set swCPM = swCompDoc.Extension.CustomPropertyManager("")

      swCPM.Get4 "description", False, DescValOut, DescResolvedOut

      Prop = DescResolvedOut

      ListboxAllGroups.AddItem FileName & " - [" & Prop & "]"

         Next

       

       

      Thanks in advance.


      Thanks,
      Kamalesh.