1 Reply Latest reply on Jun 9, 2014 4:01 AM by Simon Turner

    which one the Solidworks version, have the "CustomPropertyManager" ?

    Yong Ning

      In Solidworks 2011, CustomPropertyManager can be run. code is


      Sub main1()

      Dim swApp As SldWorks.SldWorks
      Dim swModel As ModelDoc2, Str, oStr
      Dim swCustProp As CustomPropertyManager
      Dim s As CustomPropertyManager
         Set swApp = Application.SldWorks
         Set swModel = swApp.ActiveDoc
      Dim Wk As Workbook, Sht As Worksheet, Rng As Range
         Set Wk = connectXls
         Set Sht = Wk.Sheets(1)
         With Sht
           nn = .Range("A65536").End(3).Row
           Set Rng = .Range(.Cells(3, 1), .Cells(nn, 1))
           Debug.Print Rng.Address
         End With
         For ii = 1 To Rng.Rows.Count
           Str = Rng(ii, 1)
           Set swCustProp = swModel.Extension.CustomPropertyManager(Str)
           swCustProp.Add2 "质量", swCustomInfoType_e.swCustomInfoText, "MyValue"
           oStr = "SW-Mass@@" & Str & "@" & swModel.GetTitle
           Debug.Print oStr
          swCustProp.Set "质量", Chr(34) & oStr & Chr(34)
         Next ii

      End Sub




      In Solidworks 2006, CustomPropertyManager don't run.


      Help me.


      which one the Solidworks version, have the CustomPropertyManager sentence