AnsweredAssumed Answered

delete Custom and Configuration Specific

Question asked by Yong Ning on Aug 31, 2014
Latest reply on Aug 31, 2014 by Deepak Gupta

0.jpg

 

delete Custom specific code is

 

Private Sub t0831()

  Dim swModel As ModelDoc2

    Set swModel = Application.SldWorks.ActiveDoc

  Dim CustArr

    CustArr = swModel.GetCustomInfoNames

    For ii = 0 To UBound(CustArr)

      swModel.DeleteCustomInfo2 "", CustArr(ii)

    Next ii

    ''

End Sub

 

 

 

 

1.jpg

 

Private Sub t0831()

  Dim swModel As ModelDoc2

    Set swModel = Application.SldWorks.ActiveDoc

  Dim CustArr

    CustArr = swModel.GetCustomInfoNames

    For ii = 0 To UBound(CustArr)

      swModel.DeleteCustomInfo2 "", CustArr(ii)

    Next ii    ''

End Sub

 

***************

 

Private Sub test0831()

  Dim swModel As ModelDoc2

    Set swModel = Application.SldWorks.ActiveDoc

  Dim SwConfMgr As ConfigurationManager

    Set SwConfMgr = swModel.ConfigurationManager

  Dim SwCustMgr As CustomPropertyManager, PropArr

 

  Dim SwConf As Configuration, ConfArr

    ConfArr = swModel.GetConfigurationNames

  Dim CustArr, valOut As String, resolvedValOut As String

    ''

    Set SwConf = swModel.GetActiveConfiguration

    Set SwCustMgr = SwConf.CustomPropertyManager

    CustArr = SwCustMgr.GetNames

 

    For ii = 0 To UBound(ConfArr)

      'SwCustMgr.Delete CustArr(ii)

      Set SwConf = swModel.GetConfigurationByName(ConfArr(ii))

      Set SwCustMgr = SwConf.CustomPropertyManager

      CustArr = SwCustMgr.GetNames

      'Stop

      For jj = 0 To UBound(CustArr)

         SwCustMgr.Get2 CustArr(jj), valOut, resolvedValOut

         Debug.Print SwConf.Name, CustArr(jj), valOut, resolvedValOut

         'Stop

      Next jj   

    Next ii      ''

End Sub

 

 

 

'

Attachments

Outcomes