12 Replies Latest reply on Dec 22, 2015 9:46 AM by Mladen Krcic

    Textbox value in properties

    Hrituc Alexandru

      Hi everyone,

       

      how configure the button so the inserted text from textbox to be sent to the property?

       

      Thanks

       

      1.JPG

       

       

      Option Explicit

          Dim swApp                   As SldWorks.SldWorks

          Dim swModel                 As SldWorks.ModelDoc2

          Dim vConfNameArr            As Variant

          Dim sConfigName             As String

          Dim i                       As Long

          Dim swFeature As SldWorks.Feature

      Dim swCustPropMgr As SldWorks.CustomPropertyManager

      Dim Proiectat As String

      Dim Desenat As String

      Dim a As String

      Dim b As String

      Dim c As String

      Dim d As String

       

       

       

       

      Private Sub CommandButton1_Click()

        Set swApp = Application.SldWorks

          Set swModel = swApp.ActiveDoc

          vConfNameArr = swModel.GetConfigurationNames

          For i = 0 To UBound(vConfNameArr)

              sConfigName = vConfNameArr(i)

              a = TextBox1.Value

              b = TextBox2.Value

              c = TextBox3.Value

              d = TextBox4.Value

             

              Set swCustPropMgr = swModel.Extension.CustomPropertyManager(sConfigName)

              swCustPropMgr.Add3 "Design by", swCustomInfoText, a, swCustomPropertyReplaceValue

              swCustPropMgr.Add3 "Drawn by", swCustomInfoText, b, swCustomPropertyReplaceValue

              swCustPropMgr.Add3 "Checked by", swCustomInfoText, c, swCustomPropertyReplaceValue

              swCustPropMgr.Add3 "Aprove by", swCustomInfoText, d, swCustomPropertyReplaceValue

             

          Next i

      End Sub